Class ConstructorInjection.SimpleArgumentResolver
- java.lang.Object
-
- org.mockito.internal.configuration.injection.ConstructorInjection.SimpleArgumentResolver
-
- All Implemented Interfaces:
FieldInitializer.ConstructorArgumentResolver
- Enclosing class:
- ConstructorInjection
static class ConstructorInjection.SimpleArgumentResolver extends java.lang.Object implements FieldInitializer.ConstructorArgumentResolver
Returns mocks that match the argument type, if not possible assigns null.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Set<java.lang.Object>objects
-
Constructor Summary
Constructors Constructor Description SimpleArgumentResolver(java.util.Set<java.lang.Object> objects)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.ObjectobjectThatIsAssignableFrom(java.lang.Class<?> argType)java.lang.Object[]resolveTypeInstances(java.lang.Class<?>... argTypes)Try to resolve instances from types.
-
-
-
Method Detail
-
resolveTypeInstances
public java.lang.Object[] resolveTypeInstances(java.lang.Class<?>... argTypes)
Description copied from interface:FieldInitializer.ConstructorArgumentResolverTry to resolve instances from types.Checks on the real argument type or on the correct argument number will happen during the field initialization
FieldInitializer.initialize(). I.e the only responsibility of this method, is to provide instances if possible.- Specified by:
resolveTypeInstancesin interfaceFieldInitializer.ConstructorArgumentResolver- Parameters:
argTypes- Constructor argument types, should not be null.- Returns:
- The argument instances to be given to the constructor, should not be null.
-
objectThatIsAssignableFrom
private java.lang.Object objectThatIsAssignableFrom(java.lang.Class<?> argType)
-
-