mockito -using one of the values from list of values to compare in matcher
or
does not have a three-argument overload. (See docs.) If your code compiles, you may be importing a different or
method than org.mockito.AdditionalMatchers.or
.
or(or(eq("amol84"),eq("arpan")),eq("juhi"))
should work.
You might also try the isOneOf
Hamcrest matcher, accessed through the argThat
Mockito matcher:
when(authService.isAuthenticated(argThat(isOneOf("amol84", "arpan", "juhi"))))
.thenReturn(true);
You could define separate answers:
when(authService.isAuthenticated(eq("amol84"))).thenReturn(true);
when(authService.isAuthenticated(eq("arpan"))).thenReturn(true);
when(authService.isAuthenticated(eq("juhi"))).thenReturn(true);