public final class SpringRunner extends SpringJUnit4ClassRunner
SpringRunner
is an alias for the SpringJUnit4ClassRunner
.
To use this class, simply annotate a JUnit 4 based test class with
@RunWith(SpringRunner.class)
.
If you would like to use the Spring TestContext Framework with a runner other than
this one, use SpringClassRule
and SpringMethodRule
.
NOTE: This class requires JUnit 4.12 or higher.
SpringJUnit4ClassRunner
,
SpringClassRule
,
SpringMethodRule
Constructor and Description |
---|
SpringRunner(java.lang.Class<?> clazz)
Construct a new
SpringRunner and initialize a
TestContextManager
to provide Spring testing functionality to standard JUnit 4 tests. |
createTest, createTestContextManager, getDescription, getExpectedException, getJUnitTimeout, getSpringTimeout, getTestContextManager, isTestMethodIgnored, methodBlock, possiblyExpectingExceptions, run, runChild, withAfterClasses, withAfters, withBeforeClasses, withBefores, withPotentialRepeat, withPotentialTimeout
collectInitializationErrors, computeTestMethods, describeChild, getChildren, getTestRules, isIgnored, methodInvoker, rules, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor
public SpringRunner(java.lang.Class<?> clazz) throws org.junit.runners.model.InitializationError
SpringRunner
and initialize a
TestContextManager
to provide Spring testing functionality to standard JUnit 4 tests.clazz
- the test class to be runorg.junit.runners.model.InitializationError
SpringJUnit4ClassRunner.createTestContextManager(Class)