So I started writing tests for our Java-Spring-project.
What I use is JUnit and Mockito. It\'s said, that when I use the when()...thenReturn() option I can mock ser
you need to initialize MockitoAnnotations.initMocks(this) method has to called to initialize annotated fields.
@Before public void initMocks() { MockitoAnnotations.initMocks(this); }
for more details see Doc