public final class Customization extends Object
| Constructor and Description |
|---|
Customization(String path,
ValueMatcher<Object> comparator) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
appliesToPath(String path) |
static Customization |
customization(String path,
ValueMatcher<Object> comparator)
|
boolean |
matches(Object actual,
Object expected)
Deprecated.
|
boolean |
matches(String prefix,
Object actual,
Object expected,
JSONCompareResult result)
Return true if actual value matches expected value using this
Customization's comparator.
|
public Customization(String path, ValueMatcher<Object> comparator)
public static Customization customization(String path, ValueMatcher<Object> comparator)
path - the json pathcomparator - the comparatorpublic boolean appliesToPath(String path)
@Deprecated public boolean matches(Object actual, Object expected)
actual - JSON value being testedexpected - expected JSON valuepublic boolean matches(String prefix, Object actual, Object expected, JSONCompareResult result) throws ValueMatcherException
prefix - JSON path of the JSON item being tested (only used if
comparator is a LocationAwareValueMatcher)actual - JSON value being testedexpected - expected JSON valueresult - JSONCompareResult to which match failure may be passed (only
used if comparator is a LocationAwareValueMatcher)ValueMatcherException - if expected and actual values not equal and ValueMatcher
needs to override default comparison failure message that
would be generated if this method returned false.Copyright © 2017. All Rights Reserved.