public class SpringIntegrationClassRule extends Object implements org.junit.rules.TestRule
TestRule to be used with @ClassRule to run the @BeforeClass and @AfterClass modifiers that are part of SpringJUnit4ClassRunner.| Modifier and Type | Class and Description |
|---|---|
protected static interface |
SpringIntegrationRuleBase.StatementWrapper
A replacement for Java 8's BiFunction
|
| Constructor and Description |
|---|
SpringIntegrationClassRule() |
| Modifier and Type | Method and Description |
|---|---|
protected org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement next,
Class<?> testClass,
Object testInstance,
SpringIntegrationRuleBase.StatementWrapper beforeWrapper,
SpringIntegrationRuleBase.StatementWrapper afterWrapper)
Wraps a before and after statement around the supplied statement, possibly preparing the test instance first.
|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description)
Wraps
RunBeforeTestClassCallbacks and RunAfterTestClassCallbacks around the provided statement. |
static org.springframework.test.context.TestContextManager |
createTestContextManager(Class<?> testClass)
Creates a test context manager.
|
org.springframework.test.context.TestContextManager |
getTestContextManager(Class<?> testClass)
Gets the test context manager, creating it if it doesn't exist.
|
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description)
RunBeforeTestClassCallbacks and RunAfterTestClassCallbacks around the provided statement.apply in interface org.junit.rules.TestRulebase - The base statementdescription - Information about the test class being run.public static org.springframework.test.context.TestContextManager createTestContextManager(Class<?> testClass)
testClass - The test class to create the test context manager for.public org.springframework.test.context.TestContextManager getTestContextManager(Class<?> testClass)
testClass - The test class to create the test context manager for, if it doesn't exist.protected org.junit.runners.model.Statement apply(org.junit.runners.model.Statement next,
Class<?> testClass,
Object testInstance,
SpringIntegrationRuleBase.StatementWrapper beforeWrapper,
SpringIntegrationRuleBase.StatementWrapper afterWrapper)
next - The next statement.testClass - The class being tested.testInstance - The instance of the class being tested.beforeWrapper - The before wrapper.afterWrapper - The after wrapper.Copyright © 2023. All rights reserved.