ModuleWithFixtures

A module is a class that implements this ModuleWithFixtures interface, but in addition is expected to be annotated with Configuration @Configuration and which defines a dependency other modules by Import @Import ing them, and conversely may be a dependency of other modules if they import it.

Modules are therefore classes that define a module hierarchy using these Spring annotations.

These are, in effect, a module hierarchy, declared using types.

Optionally, the @Configuration class can implements this ModuleWithFixtures interface. Doing so allows it to declare setup and teardown fixtures, eg to set up permanent ref data or to teardown test entities within the module.

These setup/teardown fixtures will be called in the correct order as per the transitive dependency graph inferred from the @Configuration imports.

API

ModuleWithFixtures.java
interface ModuleWithFixtures {
  FixtureScript getRefDataSetupFixture()     (1)
  FixtureScript getTeardownFixture()     (2)
}
1 getRefDataSetupFixture()

Optionally each module can define a FixtureScript which holds immutable "reference data".

2 getTeardownFixture()

Optionally each module can define a tear-down FixtureScript , used to remove the contents of all transactional entities (both reference data and operational/transactional data).

Members

getRefDataSetupFixture()

Optionally each module can define a FixtureScript which holds immutable "reference data".

By default, returns a FixtureScript#NOOP noop .

getTeardownFixture()

Optionally each module can define a tear-down FixtureScript , used to remove the contents of all transactional entities (both reference data and operational/transactional data).

By default, returns a FixtureScript#NOOP noop .