Mockito verify input parameter was called with a given value

Edit 23.04.2018 According to this issue, Mockito cannot capture var-args still. There is a very easy way to verify a method has been called with the right parameter in Mockito. All you need to do is use captors, to capture the actual argument. Here is how you can use them: ArgumentCaptor argument = ArgumentCaptor.forClass(RuleEntity.class); verify(mRulesRepository).createRule(argument.capture()); assertEquals(1,argument.getValue().getRules().get(0).getTriggers().size()) Simple it is, just a quick reminder for starters.

May 4, 2020 · 1 min · gmirchev90

/dev/kvm permission denied on Ubuntu 18.04

Edit (06.06.2018):{{ double-space-with-newline }}You can follow the simple tutorial here to install KVM. Thanks to azbest! I got this error when I was trying to create an emulator: /dev/kvm permission denied

May 4, 2020 · 1 min · gmirchev90

Ubuntu – Alt + Shift + any key switches the language and does not work

I faced this bug in Ubuntu 18.04. When I used Alt + Shift + 7 inside Webstorm which is the command for Find Usages, it actually changed the language because the command included Alt + Shift (I previously set this by using Gnome Tweak Tool). Here is a bug related to this in Launchpad.

May 4, 2020 · 1 min · gmirchev90

“No space left on device” message with npm & Ubuntu 18.04

I got the “No space left on device” message when trying to run a React website using npm. The fix was fast and easy following THIS advice: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

May 4, 2020 · 1 min · gmirchev90

Installing Grub fails on Ubuntu 16.04

I got this nasty error when it came to having a fresh install of Ubuntu 16.04. It says that GRUB cannot be installed on /target device. In order to fix this you need to: Create a partition around 300 mbs Use the FAT32 format and target it as EFI partition Choose that the GRUB installer should be installed on this 300 mbs partition Then the installation should finish succesfully without any errors.

May 4, 2020 · 1 min · gmirchev90

Add application to launcher in Ubuntu 16.04

Just use a program called alacarte: sudo apt-get install alacarte Click on the New Item button, write the command & name of the app, choose a logo if you want and you will see it appearing shortly in the Unity launcher by typing the name. Otherwise, you will have to create a *.desktop file and add it to .local/share/applications which I couldn’t make it work after spending a couple of hours.

May 4, 2020 · 1 min · gmirchev90

Test push notifications on Android without a server

How I used to do it The biggest problem I have with push notifications and especially GCM is testing them. Every time I want to test a notification, I would create a sample project in Google Developers Console, use the JSON there and then use Postman to send HTTP requests to the device, after obtaining the device registration id and the token for the project.

May 4, 2020 · 2 min · gmirchev90

TransactionTooLargeException when using NotificationManager.notify on Samsung devices

Recently, we got a bug inside the app. The app was crashing in the push notification receiver class that we had on the line where we called notificationManager.notify(notificationId, notificationBuilder.build()).

May 4, 2020 · 2 min · gmirchev90

EditText in CollapsingToolbar with NestedScrollView won’t scroll when the keyboard is open

The problem What we currently have CoordinatorLayout with CollapsingToolbar inside The CollapsingToolbar has an ordinary Toolbar inside that displays text A NestedScrollView with multiple EditText fields inside of it which actually pushes the CollapsingToolbar to collapse when you try to enter something in the EditText

May 4, 2020 · 2 min · gmirchev90

Drawing an arc on Android

This post is like a reminder for all Android devs who forgot the fact that the Canvas class has a method drawArc. Or you can use a simple library like: ArcSeekBar. It has smooth animation, you can control the thumb drawable, progress background and color and many more.

May 4, 2020 · 1 min · gmirchev90