I'm trying to test this method, however I am getting the following error:
Method threw 'org.mockito.exceptions.misusing.InvalidUseOfMatchersException' exception.
On this line of Code:
when(tester.method(
any(String.class), any(LocalDate.class), any(boolean.class),any(boolean.class), any(String.class))).thenReturn(item);
There are already built-in matchers for most of the types you are using.
when(tester.method(anyString(), any(LocalDate.class), anyBoolean(),anyBoolean(), anyString()))
.thenReturn(item);
Reference Class ArgumentMatchers
For primitive types use
any{Type}()
family.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments