use of org.mockito.internal.configuration.GlobalConfiguration in project mockito by mockito.
the class MockitoAnnotations method initMocks.
/**
* Initializes objects annotated with Mockito annotations for given testClass:
* @{@link org.mockito.Mock}, @{@link Spy}, @{@link Captor}, @{@link InjectMocks}
* <p>
* See examples in javadoc for {@link MockitoAnnotations} class.
*/
public static void initMocks(Object testClass) {
if (testClass == null) {
throw new MockitoException("testClass cannot be null. For info how to use @Mock annotations see examples in javadoc for MockitoAnnotations class");
}
AnnotationEngine annotationEngine = new GlobalConfiguration().tryGetPluginAnnotationEngine();
annotationEngine.process(testClass.getClass(), testClass);
}
Aggregations