Class MockitoTestExecutionListener

  • All Implemented Interfaces:
    org.springframework.core.Ordered, org.springframework.test.context.TestExecutionListener

    public class MockitoTestExecutionListener
    extends org.springframework.test.context.support.AbstractTestExecutionListener
    TestExecutionListener to trigger MockitoAnnotations.initMocks(Object) when @MockBean annotations are used. Primarily to allow Captor annotations.
    Since:
    1.4.2
    • Method Detail

      • prepareTestInstance

        public void prepareTestInstance​(org.springframework.test.context.TestContext testContext)
                                 throws Exception
        Specified by:
        prepareTestInstance in interface org.springframework.test.context.TestExecutionListener
        Overrides:
        prepareTestInstance in class org.springframework.test.context.support.AbstractTestExecutionListener
        Throws:
        Exception