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 pathParseExceptionpublic void assertValue(String responseContent, Object expectedValue) throws ParseException
ParseExceptionpublic void assertValueIsArray(String responseContent) throws ParseException
ParseExceptionpublic void exists(String content) throws ParseException
ParseExceptionpublic void doesNotExist(String content) throws ParseException
ParseException