Package io.quarkus.panache.mock
Class PanacheStubber
- java.lang.Object
-
- io.quarkus.panache.mock.PanacheStubber
-
public class PanacheStubber extends Object
-
-
Constructor Summary
Constructors Constructor Description PanacheStubber(org.mockito.stubbing.Stubber stubber)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Twhen(Class<T> mock)Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style
-
-
-
Method Detail
-
when
public <T> T when(Class<T> mock)
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() styleExample:
Read more about those methods:doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear();Mockito.doThrow(Throwable[])Mockito.doAnswer(Answer)Mockito.doNothing()Mockito.doReturn(Object)See examples in javadoc for
Mockito- Parameters:
mock- The mock- Returns:
- select method for stubbing
-
-