| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static void | createMocksForAnnotations(Class<?>
class to search hostClass, Object object of the class host, InjectionPlan output parameter where the created mocks and fields to inject are added injectionPlan)Create the mocks and find the fields annotated with |
| private static List | |
| private static Injection | |
| private static Field | |
| private static List | |
| private static void | |
| private static InjectionTarget | |
| public static void | injectMocks(Object
the object on which to inject mocks host)Inject a mock to every fields annotated with |
| private static void | injectMocksOnClass(Class<?>
class where the fields are taken clazz, Object object being a instance of clazz obj, InjectionPlan details of possible mocks for injection injectionPlan)Try to inject a mock to every fields in the class |
| pack-priv static <T> T | |
| private static MockType | |
| private static boolean |
| Injector | back to summary |
|---|---|
| public Injector() | |
| createMocksForAnnotations | back to summary |
|---|---|
| private static void createMocksForAnnotations(Class<?> hostClass, Object host, InjectionPlan injectionPlan) Create the mocks and find the fields annotated with
| |
| fieldsOf | back to summary |
|---|---|
| private static List | |
| findUniqueAssignable | back to summary |
|---|---|
| private static Injection findUniqueAssignable(List<Injection> injections, InjectionTarget target) | |
| getFieldByName | back to summary |
|---|---|
| private static Field getFieldByName(Class<?> clazz, String fieldName) | |
| injectByName | back to summary |
|---|---|
| private static List | |
| injectByType | back to summary |
|---|---|
| private static void injectByType(Object obj, List<Field> fields, List<Injection> injections) | |
| injectionTargetWithField | back to summary |
|---|---|
| private static InjectionTarget injectionTargetWithField(Field f) | |
| injectMocks | back to summary |
|---|---|
| public static void injectMocks(Object host) Inject a mock to every fields annotated with The rules are
Note If the parameter extends
| |
| injectMocksOnClass | back to summary |
|---|---|
| private static void injectMocksOnClass(Class<?> clazz, Object obj, InjectionPlan injectionPlan) Try to inject a mock to every fields in the class
| |
| instantiateTestSubject | back to summary |
|---|---|
| pack-priv static <T> T instantiateTestSubject(Field f) | |
| mockTypeFromAnnotation | back to summary |
|---|---|
| private static MockType mockTypeFromAnnotation(Mock annotation) | |
| shouldNotAssignTo | back to summary |
|---|---|
| private static boolean shouldNotAssignTo(Field f) | |