org.mockito.exceptions.misusing.MissingMethodInvocationException:
when() requires an argument which has to be 'a method call on a mock'.
For example:
when(mock.getArticles()).thenReturn(articles);
Or 'a static method call on a prepared class`
For example:
@PrepareForTest( { StaticService.class })
TestClass{
public void testMethod(){
PowerMockito.mockStatic(StaticService.class);
when(StaticService.say()).thenReturn(expected);
}
}
Also, this error might show up because:
1. inside when() you don't call method on mock but on some other object.
2. inside when() you don't call static method, but class has not been prepared.
PowerMockito.mockStatic(User.class);
when(User.find.byId(1L)).thenReturn(null);
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/ad17ad86-4847-4c9c-b3b3-7423750ed1b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.