Class MockitoTestExecutionListener
- java.lang.Object
- org.springframework.test.context.support.AbstractTestExecutionListener
- org.springframework.boot.test.mock.mockito.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 triggerMockitoAnnotations.initMocks(Object)
when@MockBean
annotations are used. Primarily to allowCaptor
annotations.- Since:
- 1.4.2
Constructor Summary
Constructors Constructor Description MockitoTestExecutionListener()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beforeTestMethod(org.springframework.test.context.TestContext testContext)
int
getOrder()
void
prepareTestInstance(org.springframework.test.context.TestContext testContext)
Constructor Detail
MockitoTestExecutionListener
public MockitoTestExecutionListener()
Method Detail
getOrder
public final int getOrder()
- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
- Overrides:
getOrder
in classorg.springframework.test.context.support.AbstractTestExecutionListener
prepareTestInstance
public void prepareTestInstance(org.springframework.test.context.TestContext testContext) throws Exception
- Throws:
Exception
beforeTestMethod
public void beforeTestMethod(org.springframework.test.context.TestContext testContext) throws Exception
- Throws:
Exception