org.mockito.stubbing
A0
- type of the single argument@Incubating public interface VoidAnswer1<A0>
Example of stubbing a mock with this custom answer:
when(mock.someMethod(anyString())).thenAnswer(new Answer<String>() {
void answer(String msg) {
throw new Exception(msg);
}
});
//Following will raise an exception with the message "boom"
mock.someMethod("boom");
Answer