Junit4 validation components
- ../validation Checking model consistency
After importing the bom
:
<dependency>
<!-- model validation -->
<groupId>com.mastercard.test.flow</groupId>
<artifactId>validation-junit4</artifactId>
</dependency>
The Validator
implementation provided by this module can used in a parameterised test:
@RunWith(Parameterized.class)
public class MyTest {
@Parameters(name = "{0}")
public static Collection<Object[]> flows() {
return new Validator()
.checking( MY_SYSTEM_MODEL )
.with( AbstractValidator.defaultChecks() )
.parameters();
}
@Parameter(0)
public String name;
@Parameter(1)
public Runnable check;
@Test
public void test() {
check.run();
}
}