Category: Testing

mockito tutorials

Initialize Mockito Tests with JUnit

This example show you how to initialize mockito tests using annotations. First we can use the MockitoAnnotations.initMocks(this) method to explicitly initialize the annotated mocks. The MockitoJUnitRunner JUnit runner uses the MockitoAnnotations.initMocks(this) method to initialize the...
junit tutorials

JUnit Ignore Test using @Ignore Annotation

Suppose we have some failing unit test because of a system reconfiguration or a change of client requirements or even a developer wrote some bad tests and he is currently on vacation. But we need...
junit tutorials

JUnit Timeout for Test Method Execution

This tutorial shows how the JUnit Timeout works. You can specify a timeout in JUnit, this means that when a test execution is longer than the specified timeout the test method will fail automatically and...