@Deprecated public class MockitoTestRule extends Object implements org.junit.rules.TestRule
MockitoRule
with RuleChain
for a defined run order.
Example:
private final MockitoTestRule mockitoRule = new MockitoTestRule(this, MockitoJUnit.rule());
private final ResourceTestRule resourceRule = ResourceTestRule.builder()
.addResource(PersonResource::new)
.build();
@Rule
public final RuleChain ruleChain = RuleChain.outerRule(mockitoRule).around(resourceRule);
MockitoRule
,
RuleChain
,
#351: missing current instance in TestRule apply(),
#997: ClassRule/TestRule version of Mockito's JUnitRuleConstructor and Description |
---|
MockitoTestRule(Object testInstance,
org.mockito.junit.MockitoRule delegate)
Deprecated.
Create a new adapter for a
MockitoRule instance. |
Modifier and Type | Method and Description |
---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description)
Deprecated.
|
public MockitoTestRule(Object testInstance, org.mockito.junit.MockitoRule delegate)
MockitoRule
instance.testInstance
- The instance of the test class (which is most likely this
)delegate
- The instance of MockitoRule
to wrap aroundCopyright © 2019. All rights reserved.