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 Object
implements FieldInitializer.ConstructorArgumentResolver
Returns mocks that match the argument type, if not possible assigns null.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Object
objectThatIsAssignableFrom
(Class<?> argType) Object[]
resolveTypeInstances
(Class<?>... argTypes) Try to resolve instances from types.
-
Field Details
-
objects
-
-
Constructor Details
-
SimpleArgumentResolver
-
-
Method Details
-
resolveTypeInstances
Description copied from interface:FieldInitializer.ConstructorArgumentResolver
Try 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:
resolveTypeInstances
in 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
-