public class PanacheStubber extends Object
| Constructor and Description |
|---|
PanacheStubber(org.mockito.stubbing.Stubber stubber) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
when(Class<T> mock)
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style
|
public <T> T when(Class<T> mock)
Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods:
Mockito.doThrow(Throwable[])
Mockito.doAnswer(Answer)
Mockito.doNothing()
Mockito.doReturn(Object)
See examples in javadoc for Mockito
mock - The mockCopyright © 2020 JBoss by Red Hat. All rights reserved.