Class LoggerAnnotationEngine

  • All Implemented Interfaces:
    org.mockito.plugins.AnnotationEngine

    public final class LoggerAnnotationEngine
    extends org.mockito.internal.configuration.InjectingAnnotationEngine
    Extension for Mockito Annotation Engine.

    Shouldn't be used directly.

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.mockito.plugins.AnnotationEngine

        org.mockito.plugins.AnnotationEngine.NoAction
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static org.slf4j.Logger FAKE_LOGGER  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.util.List<org.mockito.internal.util.reflection.InstanceField> allDeclaredFieldsOf​(java.lang.Object testInstance)  
      private static java.util.List<org.mockito.internal.util.reflection.InstanceField> findClassUnderTest​(java.lang.Object testInstance)  
      private static java.util.Map<java.lang.String,​org.slf4j.Logger> findLoggersMocks​(java.lang.Object testInstance, org.mockito.internal.util.reflection.InstanceField spyToSet)  
      private static java.util.Optional<org.slf4j.spi.MDCAdapter> findMDCMock​(java.lang.Object testInstance)  
      private static org.slf4j.Logger getLoggerFromFiled​(org.mockito.internal.util.reflection.InstanceField field)  
      private static java.lang.String getLoggerName​(org.mockito.internal.util.reflection.InstanceField field)  
      private static org.slf4j.Logger mockLoggerMerge​(org.slf4j.Logger l1, org.slf4j.Logger l2)  
      private static org.mockito.internal.util.reflection.InstanceField prepareSpyLogger​(java.lang.Object testInstance)  
      java.lang.AutoCloseable process​(java.lang.Class<?> clazz, java.lang.Object testInstance)  
      • Methods inherited from class org.mockito.internal.configuration.InjectingAnnotationEngine

        injectMocks, onInjection
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • FAKE_LOGGER

        private static final org.slf4j.Logger FAKE_LOGGER
    • Constructor Detail

      • LoggerAnnotationEngine

        public LoggerAnnotationEngine()
    • Method Detail

      • process

        public java.lang.AutoCloseable process​(java.lang.Class<?> clazz,
                                               java.lang.Object testInstance)
        Specified by:
        process in interface org.mockito.plugins.AnnotationEngine
        Overrides:
        process in class org.mockito.internal.configuration.InjectingAnnotationEngine
      • allDeclaredFieldsOf

        private static java.util.List<org.mockito.internal.util.reflection.InstanceField> allDeclaredFieldsOf​(java.lang.Object testInstance)
      • prepareSpyLogger

        private static org.mockito.internal.util.reflection.InstanceField prepareSpyLogger​(java.lang.Object testInstance)
      • findMDCMock

        private static java.util.Optional<org.slf4j.spi.MDCAdapter> findMDCMock​(java.lang.Object testInstance)
      • findClassUnderTest

        private static java.util.List<org.mockito.internal.util.reflection.InstanceField> findClassUnderTest​(java.lang.Object testInstance)
      • findLoggersMocks

        private static java.util.Map<java.lang.String,​org.slf4j.Logger> findLoggersMocks​(java.lang.Object testInstance,
                                                                                               org.mockito.internal.util.reflection.InstanceField spyToSet)
      • mockLoggerMerge

        private static org.slf4j.Logger mockLoggerMerge​(org.slf4j.Logger l1,
                                                        org.slf4j.Logger l2)
      • getLoggerName

        private static java.lang.String getLoggerName​(org.mockito.internal.util.reflection.InstanceField field)
      • getLoggerFromFiled

        private static org.slf4j.Logger getLoggerFromFiled​(org.mockito.internal.util.reflection.InstanceField field)