public class JsonPathExpectationsHelper
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
expression |
private JsonPath |
jsonPath |
| Constructor and Description |
|---|
JsonPathExpectationsHelper(java.lang.String expression,
java.lang.Object... args)
Class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
<T> void |
assertValue(java.lang.String content,
Evaluate the JSONPath and assert the resulting value with the given
Matcher. |
void |
assertValue(java.lang.String responseContent,
java.lang.Object expectedValue)
Apply the JSONPath and assert the resulting value.
|
void |
assertValueIsArray(java.lang.String responseContent)
Apply the JSONPath and assert the resulting value is an array.
|
void |
doesNotExist(java.lang.String content)
Evaluate the JSON path and assert it doesn't point to any content.
|
private java.lang.Object |
evaluateJsonPath(java.lang.String content) |
void |
exists(java.lang.String content)
Evaluate the JSON path and assert the resulting content exists.
|
private final java.lang.String expression
private final JsonPath jsonPath
public JsonPathExpectationsHelper(java.lang.String expression,
java.lang.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(java.lang.String content,
matcher)
throws java.text.ParseException
Matcher.content - the response contentmatcher - the matcher to assert on the resulting json pathjava.text.ParseExceptionprivate java.lang.Object evaluateJsonPath(java.lang.String content)
throws java.text.ParseException
java.text.ParseExceptionpublic void assertValue(java.lang.String responseContent,
java.lang.Object expectedValue)
throws java.text.ParseException
java.text.ParseExceptionpublic void assertValueIsArray(java.lang.String responseContent)
throws java.text.ParseException
java.text.ParseExceptionpublic void exists(java.lang.String content)
throws java.text.ParseException
java.text.ParseExceptionpublic void doesNotExist(java.lang.String content)
throws java.text.ParseException
java.text.ParseException