Interface AnnotationEngine


  • public interface AnnotationEngine
    Configures test via annotations.

    Mockito default engine handles the logic behind @Mock, @Captor, @Spy and @InjectMocks annotations.

    This interface is an extension point that make possible to use a different annotation engine allowing to extend or replace mockito default engine.

    If you are interested then see implementations or source code of MockitoAnnotations.openMocks(Object)

    This plugin mechanism supersedes the IMockitoConfiguration in regard of switching mockito components.

    • Method Detail

      • process

        AutoCloseable process​(Class<?> clazz,
                              Object testInstance)
        Processes the test instance to configure annotated members.
        Parameters:
        clazz - Class where to extract field information, check implementation for details
        testInstance - Test instance