public class JsonPathExpectationsHelper extends Object
Constructor and Description |
---|
JsonPathExpectationsHelper(String expression,
Object... args)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
<T> void |
assertValue(String content,
org.hamcrest.Matcher<T> matcher)
Evaluate the JSONPath and assert the resulting value with the given
Matcher . |
void |
assertValue(String responseContent,
Object expectedValue)
Apply the JSONPath and assert the resulting value.
|
void |
assertValueIsArray(String responseContent)
Apply the JSONPath 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 JSONPath expression with using the
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