Why black-box tests could be a bad idea?

Blackbox tests are tests that are being done end-to-end. This means a UI automaton clicking on your mobile app that connects to the actual backend server - not prod, of course, but something close to staging. On Android specifically, you could use Espresso or UiAutomator to achieve those results.

April 12, 2025 · 2 min · gmirchev90

How to mock a dynamic value returned from a method with Mockito?

Probably, most of you already know this, but it is good to keep it in mind when you want to dynamically change the values returned by a mock you have.

May 4, 2020 · 1 min · gmirchev90

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

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