Constructor and Description |
---|
JsonPathExpectationsHelper(String expression,
Object... args)
Construct a new JsonPathExpectationsHelper.
|
Modifier and Type | Method and Description |
---|---|
<T> void |
assertValue(String content,
org.hamcrest.Matcher<T> matcher)
Evaluate the JSON path and assert the resulting value with the given
Matcher . |
void |
assertValue(String responseContent,
Object expectedValue)
Apply the JSON path and assert the resulting value.
|
void |
assertValueIsArray(String responseContent)
Apply the JSON path and assert the resulting value is an array.
|
void |
doesNotExist(String content)
Evaluate the JSON path and assert it doesn't point to any content.
|
void |
exists(String content)
Evaluate the JSON path and assert the resulting content exists.
|
public JsonPathExpectationsHelper(String expression, Object... args)
expression
- the JsonPath expressionargs
- arguments to parameterize the JSON path expression with
formatting specifiers defined in String.format(String, Object...)
public <T> void assertValue(String content, org.hamcrest.Matcher<T> matcher) throws ParseException
Matcher
.content
- the response contentmatcher
- the matcher to assert on the resulting json pathParseException
public void assertValue(String responseContent, Object expectedValue) throws ParseException
ParseException
public void assertValueIsArray(String responseContent) throws ParseException
ParseException
public void exists(String content) throws ParseException
ParseException
public void doesNotExist(String content) throws ParseException
ParseException