Package dev.voidframework.test.utils
Class MockitoUtils
java.lang.Object
dev.voidframework.test.utils.MockitoUtils
Mockito utility methods.
- Since:
- 1.11.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <C extends BiConsumer<?,?>>
CspyBiConsumer(C biconsumer) Creates a spy of a real consumer that accept two parameters.static <F extends BiFunction<?,?, ?>>
FspyBiFunction(F bifunction) Creates a spy of a real function that accept two parameters.static <P extends BiPredicate<?,?>>
PspyBiPredicate(P bipredicate) Creates a spy of a real predicate that accept two parameters.static <C extends Consumer<?>>
CspyConsumer(C consumer) Creates a spy of a real consumer.static <F extends Function<?,?>>
FspyFunction(F function) Creates a spy of a real function.static <C,L extends C>
LCreates a spy of a real lambda function.static <P extends Predicate<?>>
PspyPredicate(P predicate) Creates a spy of a real predicate.static <S extends Supplier<?>>
SspySupplier(S supplier) Creates a spy of a real supplier.
-
Method Details
-
spyLambda
Creates a spy of a real lambda function.- Type Parameters:
C- The type of the lambda class typeL- The lambda type- Parameters:
lambdaClassType- The class of the lambda function to spylambda- The lambda function to spy- Returns:
- A spy of the provided lambda function
- Since:
- 1.11.0
-
spyConsumer
Creates a spy of a real consumer.- Type Parameters:
C- The consumer type- Parameters:
consumer- The consumer to spy- Returns:
- A spy of the provided consumer
- Since:
- 1.11.0
-
spyBiConsumer
Creates a spy of a real consumer that accept two parameters.- Type Parameters:
C- The consumer type- Parameters:
biconsumer- The consumer to spy- Returns:
- A spy of the provided consumer
- Since:
- 1.11.0
-
spyFunction
Creates a spy of a real function.- Type Parameters:
F- The function type- Parameters:
function- The function to spy- Returns:
- A spy of the provided function
- Since:
- 1.11.0
-
spyBiFunction
Creates a spy of a real function that accept two parameters.- Type Parameters:
F- The function type- Parameters:
bifunction- The function to spy- Returns:
- A spy of the provided function
- Since:
- 1.11.0
-
spyPredicate
Creates a spy of a real predicate.- Type Parameters:
P- The predicate type- Parameters:
predicate- The predicate to spy- Returns:
- A spy of the provided predicate
- Since:
- 1.11.0
-
spyBiPredicate
Creates a spy of a real predicate that accept two parameters.- Type Parameters:
P- The predicate type- Parameters:
bipredicate- The predicate to spy- Returns:
- A spy of the provided predicate
- Since:
- 1.11.0
-
spySupplier
Creates a spy of a real supplier.- Type Parameters:
S- The supplier type- Parameters:
supplier- The supplier to spy- Returns:
- A spy of the provided supplier
- Since:
- 1.11.0
-