Class SpringIntegrationClassRule

java.lang.Object
net.serenitybdd.junit.spring.integration.SpringIntegrationClassRule
All Implemented Interfaces:
org.junit.rules.TestRule

public class SpringIntegrationClassRule extends Object implements org.junit.rules.TestRule
A TestRule to be used with @ClassRule to run the @BeforeClass and @AfterClass modifiers that are part of SpringJUnit4ClassRunner.
Author:
[email protected]
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.junit.runners.model.Statement
    apply(org.junit.runners.model.Statement next, Class<?> testClass, Object testInstance, net.serenitybdd.junit.spring.integration.SpringIntegrationRuleBase.StatementWrapper beforeWrapper, net.serenitybdd.junit.spring.integration.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
    Creates a test context manager.
    org.springframework.test.context.TestContextManager
    Gets the test context manager, creating it if it doesn't exist.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SpringIntegrationClassRule

      public SpringIntegrationClassRule()
  • Method Details

    • apply

      public 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.
      Specified by:
      apply in interface org.junit.rules.TestRule
      Parameters:
      base - The base statement
      description - Information about the test class being run.
      Returns:
      The wrapped statement.
    • createTestContextManager

      public static org.springframework.test.context.TestContextManager createTestContextManager(Class<?> testClass)
      Creates a test context manager.
      Parameters:
      testClass - The test class to create the test context manager for.
      Returns:
      The new test context manager.
    • getTestContextManager

      public org.springframework.test.context.TestContextManager getTestContextManager(Class<?> testClass)
      Gets the test context manager, creating it if it doesn't exist.
      Parameters:
      testClass - The test class to create the test context manager for, if it doesn't exist.
      Returns:
      The test context manager.
    • apply

      protected org.junit.runners.model.Statement apply(org.junit.runners.model.Statement next, Class<?> testClass, Object testInstance, net.serenitybdd.junit.spring.integration.SpringIntegrationRuleBase.StatementWrapper beforeWrapper, net.serenitybdd.junit.spring.integration.SpringIntegrationRuleBase.StatementWrapper afterWrapper)
      Wraps a before and after statement around the supplied statement, possibly preparing the test instance first.
      Parameters:
      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.
      Returns:
      The new, wrapped statement.