Class ArrayComparisonElementCondition
java.lang.Object
uk.org.webcompere.modelassert.json.condition.tree.ArrayComparisonElementCondition
- All Implemented Interfaces:
ArrayElementCondition
Allow the
LooseComparison algorithm to
use elements of the expected as conditions, while still honouring the various rules that guide how matching
is performed-
Constructor Summary
ConstructorsConstructorDescriptionArrayComparisonElementCondition(com.fasterxml.jackson.databind.JsonNode elementInExpected, int indexOfExpected, Location pathToHere, TreeComparisonCondition treeComparisonCondition) Compare an element in the target array -
Method Summary
-
Constructor Details
-
ArrayComparisonElementCondition
public ArrayComparisonElementCondition(com.fasterxml.jackson.databind.JsonNode elementInExpected, int indexOfExpected, Location pathToHere, TreeComparisonCondition treeComparisonCondition) Compare an element in the target array- Parameters:
elementInExpected- which target element is being matchedindexOfExpected- what is its indexpathToHere- what is the path in the tree to this pointtreeComparisonCondition- what is the parent tree comparer - used to recurse into for child elements
-
-
Method Details
-
test
Description copied from interface:ArrayElementConditionExecute the test of the condition- Specified by:
testin interfaceArrayElementCondition- Parameters:
json- the json to test- Returns:
- a
Resultexplaining whether the condition was met and if not, why not
-
describe
Description copied from interface:ArrayElementConditionDescribe the condition- Specified by:
describein interfaceArrayElementCondition- Returns:
- description of the condition
-