Class MockitoTestExecutionListener
java.lang.Object
org.springframework.test.context.support.AbstractTestExecutionListener
org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener
- All Implemented Interfaces:
Ordered
,TestExecutionListener
@Deprecated(since="3.4.0",
forRemoval=true)
public class MockitoTestExecutionListener
extends 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
- Author:
- Phillip Webb, Andy Wilkinson, Moritz Halbritter
- 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 TypeMethodDescriptionvoid
afterTestClass
(TestContext testContext) Deprecated, for removal: This API element is subject to removal in a future version.void
afterTestMethod
(TestContext testContext) Deprecated, for removal: This API element is subject to removal in a future version.void
beforeTestMethod
(TestContext testContext) Deprecated, for removal: This API element is subject to removal in a future version.final int
getOrder()
Deprecated, for removal: This API element is subject to removal in a future version.void
prepareTestInstance
(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:
getOrder
in interfaceOrdered
- Overrides:
getOrder
in classAbstractTestExecutionListener
-
prepareTestInstance
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
prepareTestInstance
in interfaceTestExecutionListener
- Overrides:
prepareTestInstance
in classAbstractTestExecutionListener
- Throws:
Exception
-
beforeTestMethod
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
beforeTestMethod
in interfaceTestExecutionListener
- Overrides:
beforeTestMethod
in classAbstractTestExecutionListener
- Throws:
Exception
-
afterTestMethod
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
afterTestMethod
in interfaceTestExecutionListener
- Overrides:
afterTestMethod
in classAbstractTestExecutionListener
- Throws:
Exception
-
afterTestClass
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
afterTestClass
in interfaceTestExecutionListener
- Overrides:
afterTestClass
in classAbstractTestExecutionListener
- Throws:
Exception
-
MockitoBean
andMockitoSpyBean
.