public abstract class MockObjectsSupport
extends java.lang.Object
MockObjectsSupport class is an abstract base class encapsulating common operations and utilities
used in mocking using Mockito.AtomicBoolean,
AtomicInteger,
AtomicLong,
AtomicReference,
Consumer,
Function,
Supplier,
InvocationOnMock,
Answer| Constructor and Description |
|---|
MockObjectsSupport() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
mockObjectIdentifier() |
static java.lang.String |
mockObjectIdentifier(java.lang.String mockObjectName) |
protected static <E,C extends java.util.Collection<E>,R> |
newAdder(C collection,
R returnValue) |
protected static org.mockito.stubbing.Answer<java.lang.Boolean> |
newGetter(java.util.concurrent.atomic.AtomicBoolean returnValue) |
protected static org.mockito.stubbing.Answer<java.lang.Integer> |
newGetter(java.util.concurrent.atomic.AtomicInteger returnValue) |
protected static org.mockito.stubbing.Answer<java.lang.Long> |
newGetter(java.util.concurrent.atomic.AtomicLong returnValue) |
protected static <R> org.mockito.stubbing.Answer<R> |
newGetter(java.util.concurrent.atomic.AtomicReference<R> returnValue) |
protected static <R,S> org.mockito.stubbing.Answer<S> |
newGetter(java.util.concurrent.atomic.AtomicReference<R> returnValue,
java.util.function.Function<R,S> converter) |
protected static <R> org.mockito.stubbing.Answer<R> |
newGetter(java.util.function.Supplier<R> returnValue) |
protected static <R,S> org.mockito.stubbing.Answer<S> |
newGetter(java.util.function.Supplier<R> returnValue,
java.util.function.Function<R,S> converter) |
protected static <R> org.mockito.stubbing.Answer<R> |
newSetter(java.util.concurrent.atomic.AtomicBoolean argument,
java.lang.Boolean value,
R returnValue) |
protected static <R> org.mockito.stubbing.Answer<R> |
newSetter(java.util.concurrent.atomic.AtomicBoolean argument,
R returnValue) |
protected static <R> org.mockito.stubbing.Answer<R> |
newSetter(java.util.concurrent.atomic.AtomicInteger argument,
java.lang.Integer value,
R returnValue) |
protected static <R> org.mockito.stubbing.Answer<R> |
newSetter(java.util.concurrent.atomic.AtomicInteger argument,
R returnValue) |
protected static <R> org.mockito.stubbing.Answer<R> |
newSetter(java.util.concurrent.atomic.AtomicLong argument,
java.lang.Long value,
R returnValue) |
protected static <R> org.mockito.stubbing.Answer<R> |
newSetter(java.util.concurrent.atomic.AtomicLong argument,
R returnValue) |
protected static <T> org.mockito.stubbing.Answer<T> |
newSetter(java.util.concurrent.atomic.AtomicReference<T> argument) |
protected static <T> org.mockito.stubbing.Answer<T> |
newSetter(java.util.concurrent.atomic.AtomicReference<T> argument,
java.util.function.Function<?,T> converter) |
protected static <T,R> org.mockito.stubbing.Answer<R> |
newSetter(java.util.concurrent.atomic.AtomicReference<T> argument,
java.util.function.Function<?,T> converter,
java.util.function.Supplier<R> returnValue) |
protected static <T,R> org.mockito.stubbing.Answer<R> |
newSetter(java.util.concurrent.atomic.AtomicReference<T> argument,
java.util.function.Supplier<R> returnValue) |
protected static <K,V> org.mockito.stubbing.Answer<V> |
newSetter(java.util.Map<K,V> argument) |
protected static <K,V,R> org.mockito.stubbing.Answer<R> |
newSetter(java.util.Map<K,V> argument,
java.util.function.Supplier<R> returnValue) |
protected static <T,R> org.mockito.stubbing.Answer<R> |
newSetterWithArgument(java.util.concurrent.atomic.AtomicReference<T> argument,
T value,
java.util.function.Supplier<R> returnValue) |
protected static <T> org.mockito.stubbing.Answer<T> |
newSetterWithArument(java.util.concurrent.atomic.AtomicReference<T> argument,
T value) |
protected static <T> org.mockito.stubbing.Answer<java.lang.Void> |
newVoidAnswer(java.util.function.Consumer<org.mockito.invocation.InvocationOnMock> methodInvocation) |
public static java.lang.String mockObjectIdentifier()
public static java.lang.String mockObjectIdentifier(java.lang.String mockObjectName)
protected static org.mockito.stubbing.Answer<java.lang.Boolean> newGetter(java.util.concurrent.atomic.AtomicBoolean returnValue)
protected static org.mockito.stubbing.Answer<java.lang.Integer> newGetter(java.util.concurrent.atomic.AtomicInteger returnValue)
protected static org.mockito.stubbing.Answer<java.lang.Long> newGetter(java.util.concurrent.atomic.AtomicLong returnValue)
protected static <R> org.mockito.stubbing.Answer<R> newGetter(java.util.concurrent.atomic.AtomicReference<R> returnValue)
protected static <R,S> org.mockito.stubbing.Answer<S> newGetter(java.util.concurrent.atomic.AtomicReference<R> returnValue,
java.util.function.Function<R,S> converter)
protected static <R> org.mockito.stubbing.Answer<R> newGetter(java.util.function.Supplier<R> returnValue)
protected static <R,S> org.mockito.stubbing.Answer<S> newGetter(java.util.function.Supplier<R> returnValue,
java.util.function.Function<R,S> converter)
protected static <E,C extends java.util.Collection<E>,R> org.mockito.stubbing.Answer<R> newAdder(C collection,
R returnValue)
protected static <R> org.mockito.stubbing.Answer<R> newSetter(java.util.concurrent.atomic.AtomicBoolean argument,
R returnValue)
protected static <R> org.mockito.stubbing.Answer<R> newSetter(java.util.concurrent.atomic.AtomicBoolean argument,
java.lang.Boolean value,
R returnValue)
protected static <R> org.mockito.stubbing.Answer<R> newSetter(java.util.concurrent.atomic.AtomicInteger argument,
R returnValue)
protected static <R> org.mockito.stubbing.Answer<R> newSetter(java.util.concurrent.atomic.AtomicInteger argument,
java.lang.Integer value,
R returnValue)
protected static <R> org.mockito.stubbing.Answer<R> newSetter(java.util.concurrent.atomic.AtomicLong argument,
R returnValue)
protected static <R> org.mockito.stubbing.Answer<R> newSetter(java.util.concurrent.atomic.AtomicLong argument,
java.lang.Long value,
R returnValue)
protected static <T> org.mockito.stubbing.Answer<T> newSetter(java.util.concurrent.atomic.AtomicReference<T> argument)
protected static <T,R> org.mockito.stubbing.Answer<R> newSetter(java.util.concurrent.atomic.AtomicReference<T> argument,
java.util.function.Supplier<R> returnValue)
protected static <T> org.mockito.stubbing.Answer<T> newSetterWithArument(java.util.concurrent.atomic.AtomicReference<T> argument,
T value)
protected static <T,R> org.mockito.stubbing.Answer<R> newSetterWithArgument(java.util.concurrent.atomic.AtomicReference<T> argument,
T value,
java.util.function.Supplier<R> returnValue)
protected static <T> org.mockito.stubbing.Answer<T> newSetter(java.util.concurrent.atomic.AtomicReference<T> argument,
java.util.function.Function<?,T> converter)
protected static <T,R> org.mockito.stubbing.Answer<R> newSetter(java.util.concurrent.atomic.AtomicReference<T> argument,
java.util.function.Function<?,T> converter,
java.util.function.Supplier<R> returnValue)
protected static <K,V> org.mockito.stubbing.Answer<V> newSetter(java.util.Map<K,V> argument)
protected static <K,V,R> org.mockito.stubbing.Answer<R> newSetter(java.util.Map<K,V> argument,
java.util.function.Supplier<R> returnValue)
protected static <T> org.mockito.stubbing.Answer<java.lang.Void> newVoidAnswer(java.util.function.Consumer<org.mockito.invocation.InvocationOnMock> methodInvocation)