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
@Deprecated(since="3.4.0",
forRemoval=true)
public class MockitoTestExecutionListener
extends org.springframework.test.context.support.AbstractTestExecutionListener
Deprecated, for removal: This API element is subject to removal in a future version.
TestExecutionListener to enable @MockBean and
@SpyBean support. Also triggers
MockitoAnnotations.openMocks(Object) when any Mockito annotations used,
primarily to allow @Captor annotations.
To use the automatic reset support of @MockBean and @SpyBean, configure
ResetMocksTestExecutionListener as well.
- Since:
- 1.4.2
- See Also:
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoidafterTestClass(org.springframework.test.context.TestContext testContext) Deprecated, for removal: This API element is subject to removal in a future version.voidafterTestMethod(org.springframework.test.context.TestContext testContext) Deprecated, for removal: This API element is subject to removal in a future version.voidbeforeTestMethod(org.springframework.test.context.TestContext testContext) Deprecated, for removal: This API element is subject to removal in a future version.final intgetOrder()Deprecated, for removal: This API element is subject to removal in a future version.voidprepareTestInstance(org.springframework.test.context.TestContext testContext) Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class org.springframework.test.context.support.AbstractTestExecutionListener
afterTestExecution, beforeTestClass, beforeTestExecution
-
Constructor Details
-
MockitoTestExecutionListener
public MockitoTestExecutionListener()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
getOrder
public final int getOrder()Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getOrderin interfaceorg.springframework.core.Ordered- Overrides:
getOrderin classorg.springframework.test.context.support.AbstractTestExecutionListener
-
prepareTestInstance
public void prepareTestInstance(org.springframework.test.context.TestContext testContext) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
prepareTestInstancein interfaceorg.springframework.test.context.TestExecutionListener- Overrides:
prepareTestInstancein classorg.springframework.test.context.support.AbstractTestExecutionListener- Throws:
Exception
-
beforeTestMethod
public void beforeTestMethod(org.springframework.test.context.TestContext testContext) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
beforeTestMethodin interfaceorg.springframework.test.context.TestExecutionListener- Overrides:
beforeTestMethodin classorg.springframework.test.context.support.AbstractTestExecutionListener- Throws:
Exception
-
afterTestMethod
public void afterTestMethod(org.springframework.test.context.TestContext testContext) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
afterTestMethodin interfaceorg.springframework.test.context.TestExecutionListener- Overrides:
afterTestMethodin classorg.springframework.test.context.support.AbstractTestExecutionListener- Throws:
Exception
-
afterTestClass
public void afterTestClass(org.springframework.test.context.TestContext testContext) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
afterTestClassin interfaceorg.springframework.test.context.TestExecutionListener- Overrides:
afterTestClassin classorg.springframework.test.context.support.AbstractTestExecutionListener- Throws:
Exception
-
MockitoBeanandMockitoSpyBean.