We've got a class with a method with an transactional annotation
public class MyHandler extends BaseHandler {
@Transactional
public void annotatedMethod(String parameter) throws Exception {
}
As soon as we try to make a test using mockito and its annotations
@InjectMocks
private Controller controller;
@Mock
private MyHandler myHandler;
we have a null pointer exception when executing the following line
Mockito.doCallRealMethod().when(myHandler).annotatedMethod(Matchers.any());
We have tried to use the same solution as in Transactional annotation avoids services being mocked with no luck.
We're new with mockito, we have no idea how to solve this. Any clues?
Thank you very much, Elena