Class TestSubjectInjector
java.lang.Object
org.powermock.api.extension.listener.TestSubjectInjector
The class injects mocks created with
Mock
, Mock
and Mock
to fields of objects which is annotated with TestSubject
- Since:
- 1.6.5
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTestSubjectInjector
(Object testInstance, AnnotationGlobalMetadata globalMetadata) -
Method Summary
Modifier and TypeMethodDescription(package private) AnnotationMockMetadata
private Field
getFieldByName
(Class<?> clazz, String fieldName) injectByName
(Set<Field> targetFields, Object targetObject) (package private) void
injectByType
(Set<Field> targetFields, Object testSubject) protected void
injectTestSubjectFields
(Object testSubject) protected void
-
Field Details
-
testInstance
-
globalMetadata
-
-
Constructor Details
-
TestSubjectInjector
-
-
Method Details
-
injectTestSubjectMocks
- Throws:
IllegalAccessException
-
injectTestSubjectFields
- Throws:
IllegalAccessException
-
injectByType
- Throws:
IllegalAccessException
-
findUniqueAssignable
-
injectByName
- Throws:
IllegalAccessException
-
getFieldByName
-