Class SpringTestContexts

java.lang.Object
org.approvej.spring.SpringTestContexts

@NullMarked public final class SpringTestContexts extends Object
All distinct Spring test application contexts used by the test classes in a set of packages.

Approve this to notice when a new test application context is introduced, as each one slows down the test suite.

The contexts are determined statically: no test is run and no context is started.

  • Method Details

    • springTestContexts

      public static SpringTestContexts springTestContexts(String... basePackages)
      Determines the distinct Spring test application contexts of all Spring test classes in the given packages and their sub-packages.
      Parameters:
      basePackages - the names of the packages to scan
      Returns:
      the SpringTestContexts found
    • contexts

      public List<SpringTestContext> contexts()
      Returns the distinct contexts, including the parent contexts of context hierarchies, in the order they were found.
      Returns:
      the distinct SpringTestContexts