1 matchers expected, 2 recorded:

  Kiến thức lập trình

I have a test with this line:

when(interlocutorsP2PService.creationIsAllowed(any(BigInteger.class), any(BigInteger.class))).thenReturn(true);

And I recibe this error

org.mockito.exceptions.misusing.InvalidUseOfMatchersException:  Invalid use of argument matchers! 1 matchers expected, 2 recorded:

I see a lot similar questions but all say something similar to:

When you use an argument matcher for one of the arguments, all the other arguments must also use an argument matcher:

But as you can see in my test I use any(BigInteger.class) and really I don’t know why I have this problem. Can you help me?

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website