-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
Description
When I do a mockStatic with argument matchers like this:
var mockedRequestClass = Mockito.mockStatic(RequestClass.class);
mockedRequestClass.when(() -> RequestClass.sendRequest(mockedUrl, any(), any())).thenReturn(null);
Mockito throws the following exception:
org.mockito.exceptions.misusing.MissingMethodInvocationException: when() requires an argument which has to be 'a method call on a mock'.
How can I use argument matchers with Mockito.mockStatic? Shouldn't that be possible?