Bove means: somevoidmethod() does nothing the 1st time but throws an exception the 2nd time is called
Answers
Answered by
0
Answer:
You should mimic a boolean answer because your method returns a boolean.
Step-by-step explanation:
public interface ABC {
public boolean removeUser(String userId) throws OTPServiceException, RemoteException;
}
ABC abc= mock(ABC.class);
doNothing().when(abc).removeUser(anyString());
org.mockito.exceptions.base.MockitoException:
Only void methods can doNothing()!
Example of correct use of doNothing():
doNothing().
doThrow(new RuntimeException())
.when(mock).someVoidMethod();
Above means:
someVoidMethod() does nothing the 1st time but throws an exception the 2nd time is called
Similar questions