There may be many reasons can cause this error. But in this case, this error was wrongly spit out when I wrote:
when(myObject.myMethod(any(), any())).thenReturn("something");
It turned out that it is because the first parameters of myObject.myMethod(int, String) is expecting an int. So that the correction is:
when(myObject.myMethod(anyInt(), any())).thenReturn("something");
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment