Implementations of the Model interface
- ../flow Testing framework
This module provides an API by which Flows can be grouped and collected into a coherent model of system behaviour.
The three concrete classes are:
EagerModel
- this will build all of its constituent flows immediately upon model constructionLazyModel
- this combines multipleEagerModel
implementations, and constructs them as required as Flows are requested.CombineModel
- combines multiple childModel
instances.
The point of structuring Flow construction into separate models is to improve testing performance and iteration time.
For example, let's assume that the system under test has two separate functions, called foo
and bar
.
Our system model will thus contains a bunch Flow instances, some tagged with foo
, and some tagged with bar
.
Let's also assume that those flow instances are defined in two separate EagerModels, one for foo
flows and one for bar
flows, and those two models are combined in a LazyModel.
Thus when we're iterating on changing the foo
behaviour we can supply the foo
tag to the assert component and avoid building all the bar
flows that we don't even want to run.
<dependency>
<!-- flow grouping -->
<groupId>com.mastercard.test.flow</groupId>
<artifactId>model</artifactId>
<version>${flow.version}</version>
</dependency>
Note that the above assumes that your system model is being defined in a module on its own and the system model is the published artifact of the module.
If the system model is being defined directly in the system's test suite then you should add <scope>test</scope>
to this dependency.