Class DefaultAnnotationEngine

java.lang.Object
org.mockito.internal.configuration.DefaultAnnotationEngine
All Implemented Interfaces:
AnnotationEngine

public class DefaultAnnotationEngine extends Object implements AnnotationEngine
Initializes fields annotated with @Mock or @Captor.

The process(Class, Object) method implementation does not process super classes!

See Also:
  • Constructor Details

    • DefaultAnnotationEngine

      public DefaultAnnotationEngine()
  • Method Details

    • createMockFor

      public Object createMockFor(Annotation annotation, Field field)
      Specified by:
      createMockFor in interface AnnotationEngine
      Parameters:
      annotation - Annotation
      field - Field details
    • process

      public void process(Class<?> clazz, Object testInstance)
      Description copied from interface: AnnotationEngine
      Allows extending the interface to perform action on specific fields on the test class.

      See the implementation of this method to figure out what is it for.

      Specified by:
      process in interface AnnotationEngine
      Parameters:
      clazz - Class where to extract field information, check implementation for details
      testInstance - Test instance