类 MockitoTestExecutionListener
java.lang.Object
cn.taketoday.test.context.support.AbstractTestExecutionListener
cn.taketoday.framework.test.mock.mockito.MockitoTestExecutionListener
- 所有已实现的接口:
cn.taketoday.core.Ordered,TestExecutionListener
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.
- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb, Andy Wilkinson
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明private static classReflectionUtils.FieldCallbackto collect Mockito annotations.private static final class -
字段概要
字段从接口继承的字段 cn.taketoday.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidafterTestMethod(TestContext testContext) The default implementation is empty.voidbeforeTestMethod(TestContext testContext) The default implementation is empty.final intgetOrder()The default implementation returnsOrdered.LOWEST_PRECEDENCE, thereby ensuring that custom listeners are ordered after default listeners supplied by the framework.private booleanhasMockitoAnnotations(TestContext testContext) private voidinitMocks(TestContext testContext) private voidinjectFields(TestContext testContext) private voidpostProcessFields(TestContext testContext, BiConsumer<MockitoTestExecutionListener.MockitoField, MockitoPostProcessor> consumer) voidprepareTestInstance(TestContext testContext) The default implementation is empty.private voidreinjectFields(TestContext testContext) 从类继承的方法 cn.taketoday.test.context.support.AbstractTestExecutionListener
afterTestClass, afterTestExecution, beforeTestClass, beforeTestExecution
-
字段详细资料
-
MOCKS_ATTRIBUTE_NAME
-
-
构造器详细资料
-
MockitoTestExecutionListener
public MockitoTestExecutionListener()
-
-
方法详细资料
-
getOrder
public final int getOrder()从类复制的说明:AbstractTestExecutionListenerThe default implementation returnsOrdered.LOWEST_PRECEDENCE, thereby ensuring that custom listeners are ordered after default listeners supplied by the framework. Can be overridden by subclasses as necessary.- 指定者:
getOrder在接口中cn.taketoday.core.Ordered- 覆盖:
getOrder在类中AbstractTestExecutionListener
-
prepareTestInstance
从类复制的说明:AbstractTestExecutionListenerThe default implementation is empty. Can be overridden by subclasses as necessary.- 指定者:
prepareTestInstance在接口中TestExecutionListener- 覆盖:
prepareTestInstance在类中AbstractTestExecutionListener- 参数:
testContext- the test context for the test; nevernull- 抛出:
Exception- allows any exception to propagate
-
beforeTestMethod
从类复制的说明:AbstractTestExecutionListenerThe default implementation is empty. Can be overridden by subclasses as necessary.- 指定者:
beforeTestMethod在接口中TestExecutionListener- 覆盖:
beforeTestMethod在类中AbstractTestExecutionListener- 参数:
testContext- the test context in which the test method will be executed; nevernull- 抛出:
Exception- allows any exception to propagate- 另请参阅:
-
afterTestMethod
从类复制的说明:AbstractTestExecutionListenerThe default implementation is empty. Can be overridden by subclasses as necessary.- 指定者:
afterTestMethod在接口中TestExecutionListener- 覆盖:
afterTestMethod在类中AbstractTestExecutionListener- 参数:
testContext- the test context in which the test method was executed; nevernull- 抛出:
Exception- allows any exception to propagate- 另请参阅:
-
initMocks
-
hasMockitoAnnotations
-
injectFields
-
reinjectFields
-
postProcessFields
private void postProcessFields(TestContext testContext, BiConsumer<MockitoTestExecutionListener.MockitoField, MockitoPostProcessor> consumer)
-