Package | Description |
---|---|
org.mockito |
Mockito is a mock library for java - see Mockito class for for usage.
|
org.mockito.stubbing |
External stubbing related classes
|
Modifier and Type | Method and Description |
---|---|
static <T> OngoingStubbing<T> |
Mockito.when(T methodCall)
Enables stubbing methods.
|
Modifier and Type | Method and Description |
---|---|
OngoingStubbing<T> |
OngoingStubbing.then(Answer<?> answer)
Sets a generic Answer for the method.
|
OngoingStubbing<T> |
OngoingStubbing.thenAnswer(Answer<?> answer)
Sets a generic Answer for the method.
|
OngoingStubbing<T> |
OngoingStubbing.thenCallRealMethod()
Sets the real implementation to be called when the method is called on a mock object.
|
OngoingStubbing<T> |
OngoingStubbing.thenReturn(T value)
Sets a return value to be returned when the method is called.
|
OngoingStubbing<T> |
OngoingStubbing.thenReturn(T value,
T... values)
Sets consecutive return values to be returned when the method is called.
|
OngoingStubbing<T> |
OngoingStubbing.thenThrow(Class<? extends Throwable> throwableType)
Sets a Throwable type to be thrown when the method is called.
|
OngoingStubbing<T> |
OngoingStubbing.thenThrow(Class<? extends Throwable> toBeThrown,
Class<? extends Throwable>... nextToBeThrown)
Sets Throwable classes to be thrown when the method is called.
|
OngoingStubbing<T> |
OngoingStubbing.thenThrow(Throwable... throwables)
Sets Throwable objects to be thrown when the method is called.
|