Tags » Mockito

The pragmatic migration to JUnit 5

This article shows how get from JUnit 3.x / 4.x to JUnit 5.x as fast as possible.

Just a short clarification of the term “JUnit 5” (from the… 1,187 more words

Software Development

Convenient mocking in Mockito with JUnit 5 - the official way

Starting with the version 2.17.0 Mockito provides the official (built-in) support for managing a mocking life cycle if JUnit 5 is used.

Getting started

To take advantage of the integration, the Mockito’s… 622 more words

Tests

How to write unit test cases for an abstract class?

This is my 2nd post related to writing test cases and in this post, I though to discuss about how to write unit tests for an abstract class. 972 more words

How to mock setters and why would we do that?

When we write unit tests we start replacing our objects with all kind of fakes. We call this process mocking. We do it because we want to test our logic in isolation. 781 more words

Programming

ArgumentCaptor vs InOrder to verify subsequent callbacks with different arguments

I was testing my DAO class generated using the Room library from Architecture Components. I wanted to check that the LiveData returned by a query joining multiple tables was going to be updated when data changes. 612 more words

Java