Class ConsumerBasedExpectedCheckVerifier
- java.lang.Object
-
- org.junit.rules.Verifier
-
- org.openstreetmap.atlas.checks.validation.verifier.ConsumerBasedExpectedCheckVerifier
-
- All Implemented Interfaces:
org.junit.rules.TestRule
public class ConsumerBasedExpectedCheckVerifier extends org.junit.rules.VerifierJUnitVerifierto run verifier functions on the list ofCheckFlags generated by the checks under test.
-
-
Constructor Summary
Constructors Constructor Description ConsumerBasedExpectedCheckVerifier()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactual(org.openstreetmap.atlas.geography.atlas.Atlas atlas, BaseCheck<?> check)Adds a testAtlasand aCheckto verifyConsumerBasedExpectedCheckVerifiergloballyVerify(java.util.function.Consumer<java.util.List<CheckFlag>> verifierFunction)Registers a custom function to verify all of the resulting flags when theCheckis run over the testAtlasprotected voidverify()ConsumerBasedExpectedCheckVerifierverify(java.util.function.Consumer<CheckFlag> verifierFunction)Registers a custom function to verify each resultingCheckFlagindividuallyConsumerBasedExpectedCheckVerifierverifyEmpty()ConsumerBasedExpectedCheckVerifierverifyExpectedSize(int size)ConsumerBasedExpectedCheckVerifierverifyNotEmpty()ConsumerBasedExpectedCheckVerifierverifyNotNull()Checks for null values returned by theCheck
-
-
-
Method Detail
-
actual
public void actual(org.openstreetmap.atlas.geography.atlas.Atlas atlas, BaseCheck<?> check)Adds a testAtlasand aCheckto verify- Parameters:
atlas- a testAtlascheck- theCheckunder test
-
globallyVerify
public ConsumerBasedExpectedCheckVerifier globallyVerify(java.util.function.Consumer<java.util.List<CheckFlag>> verifierFunction)
Registers a custom function to verify all of the resulting flags when theCheckis run over the testAtlas- Parameters:
verifierFunction- a function that verifies the complete results- Returns:
- the
ConsumerBasedExpectedCheckVerifier
-
verify
public ConsumerBasedExpectedCheckVerifier verify(java.util.function.Consumer<CheckFlag> verifierFunction)
Registers a custom function to verify each resultingCheckFlagindividually- Parameters:
verifierFunction- a function that verifies each result individually- Returns:
- the
ConsumerBasedExpectedCheckVerifier
-
verifyEmpty
public ConsumerBasedExpectedCheckVerifier verifyEmpty()
- Returns:
- the
ConsumerBasedExpectedCheckVerifier
-
verifyExpectedSize
public ConsumerBasedExpectedCheckVerifier verifyExpectedSize(int size)
Verifies that a specific number ofCheckFlags were returned when theCheckis run over the testAtlas- Parameters:
size- The number ofCheckFlags expected- Returns:
- the
ConsumerBasedExpectedCheckVerifier
-
verifyNotEmpty
public ConsumerBasedExpectedCheckVerifier verifyNotEmpty()
- Returns:
- the
ConsumerBasedExpectedCheckVerifier
-
verifyNotNull
public ConsumerBasedExpectedCheckVerifier verifyNotNull()
Checks for null values returned by theCheck- Returns:
- the
ConsumerBasedExpectedCheckVerifier
-
verify
protected void verify() throws java.lang.Throwable- Overrides:
verifyin classorg.junit.rules.Verifier- Throws:
java.lang.Throwable
-
-