public class JSONCompareResult extends Object
Constructor and Description |
---|
JSONCompareResult()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
fail(String message) |
JSONCompareResult |
fail(String field,
Object expected,
Object actual)
Identify that the comparison failed
|
JSONCompareResult |
fail(String field,
ValueMatcherException exception)
Identify that the comparison failed
|
boolean |
failed()
Did the comparison fail?
|
Object |
getActual()
Deprecated.
Superseded by
getFieldFailures() |
Object |
getExpected()
Deprecated.
Superseded by
getFieldFailures() |
String |
getField()
Deprecated.
Superseded by
getFieldFailures() |
List<FieldComparisonFailure> |
getFieldFailures()
Get the list of failures on field comparisons
|
List<FieldComparisonFailure> |
getFieldMissing()
Get the list of missed on field comparisons
|
List<FieldComparisonFailure> |
getFieldUnexpected()
Get the list of failures on field comparisons
|
String |
getMessage()
Result message
|
boolean |
isFailureOnField()
Check if comparison failed on any particular fields
|
boolean |
isMissingOnField()
Check if comparison failed with missing on any particular fields
|
boolean |
isUnexpectedOnField()
Check if comparison failed with unexpected on any particular fields
|
JSONCompareResult |
missing(String field,
Object expected) |
boolean |
passed()
Did the comparison pass?
|
String |
toString() |
JSONCompareResult |
unexpected(String field,
Object value) |
public boolean passed()
public boolean failed()
public String getMessage()
public List<FieldComparisonFailure> getFieldFailures()
public List<FieldComparisonFailure> getFieldMissing()
public List<FieldComparisonFailure> getFieldUnexpected()
@Deprecated public Object getActual()
getFieldFailures()
JSONObject
, JSONArray
or other Object
instance, or null
if the comparison did not fail on a
particular field@Deprecated public Object getExpected()
getFieldFailures()
JSONObject
, JSONArray
or other Object
instance, or null
if the comparison did not fail on a
particular fieldpublic boolean isFailureOnField()
public boolean isMissingOnField()
public boolean isUnexpectedOnField()
@Deprecated public String getField()
getFieldFailures()
String
instance, or null
if the comparison did
not fail on a particular fieldpublic void fail(String message)
public JSONCompareResult fail(String field, Object expected, Object actual)
field
- Which field failedexpected
- Expected resultactual
- Actual resultpublic JSONCompareResult fail(String field, ValueMatcherException exception)
field
- Which field failedexception
- exception containing details of match failurepublic JSONCompareResult missing(String field, Object expected)
public JSONCompareResult unexpected(String field, Object value)
Copyright © 2018. All rights reserved.