Warning: “The type MockitoJUnitRunner is deprecated” 1. Introduction In this quick tutorial, we’ll have a look at one of the warnings we may see when working with the popular testing framework Mockito. Namely, the one referring to the deprecated MockitoJUnitRunner class. We’ll see why this warning happens and how to… Continue Reading mockito-deprecated-mockitojunitrunner

Mockito Strict Stubbing and The UnnecessaryStubbingException 1. Overview In this quick tutorial, we’ll learn about the Mockito UnnecessaryStubbingException. This exception is one of the common exceptions we’ll likely encounter when using stubs incorrectly. We’ll start by explaining the philosophy behind strict stubbing and why Mockito encourages its use by default.… Continue Reading mockito-unnecessary-stubbing-exception

Testing an Abstract Class With JUnit 1. Overview In this tutorial, we’ll analyze various use cases and possible alternative solutions to unit-testing of abstract classes with non-abstract methods. Note that testing abstract classes should almost always go through the public API of the concrete implementations, so don’t apply the below… Continue Reading junit-test-abstract-class