Skip to content

Latest commit

 

History

History

model

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

model

Implementations of the Model interface

javadoc

Overview

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 construction
  • LazyModel - this combines multiple EagerModel implementations, and constructs them as required as Flows are requested.
  • CombineModel - combines multiple child Model 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.

Usage

After importing the bom:

<dependency>
  <!-- flow grouping -->
  <groupId>com.mastercard.test.flow</groupId>
  <artifactId>model</artifactId>
</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.