public class GraphQLResponse
extends java.lang.Object
| Constructor and Description |
|---|
GraphQLResponse(org.springframework.http.ResponseEntity<java.lang.String> responseEntity,
com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
| Modifier and Type | Method and Description |
|---|---|
GraphQLFieldAssert |
assertThatDataField()
Returns an assertion for the root "data" field.
|
GraphQLFieldAssert |
assertThatErrorsField()
Returns an assertion for the root "errors" field.
|
GraphQLFieldAssert |
assertThatExtensionsField()
Returns an assertion for the root "extensions" field.
|
GraphQLFieldAssert |
assertThatField(java.lang.String jsonPath)
Returns an assertion for the given field(s).
|
org.springframework.boot.test.json.JsonContentAssert |
assertThatJsonContent()
Returns an assertion for the JSON content of the response.
|
GraphQLErrorListAssertion |
assertThatListOfErrors()
Returns an assertion for the list of errors in the response.
|
GraphQLResponse |
assertThatNoErrorsArePresent()
Asserts that no errors are present in the response.
|
NumberOfErrorsAssertion |
assertThatNumberOfErrors()
Returns an assertion for the number of errors in the response.
|
com.jayway.jsonpath.ReadContext |
context() |
java.lang.String |
get(java.lang.String path) |
<T> T |
get(java.lang.String path,
java.lang.Class<T> type) |
<T> T |
get(java.lang.String path,
com.fasterxml.jackson.databind.JavaType type) |
<T> java.util.List<T> |
getList(java.lang.String path,
java.lang.Class<T> type) |
java.lang.Object |
getRaw(java.lang.String path) |
org.springframework.http.ResponseEntity<java.lang.String> |
getRawResponse() |
org.springframework.http.HttpStatus |
getStatusCode() |
boolean |
isOk() |
com.fasterxml.jackson.databind.JsonNode |
readTree() |
public GraphQLResponse(org.springframework.http.ResponseEntity<java.lang.String> responseEntity,
com.fasterxml.jackson.databind.ObjectMapper objectMapper)
public com.fasterxml.jackson.databind.JsonNode readTree()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.Object getRaw(java.lang.String path)
public java.lang.String get(java.lang.String path)
public <T> T get(java.lang.String path,
java.lang.Class<T> type)
public <T> T get(java.lang.String path,
com.fasterxml.jackson.databind.JavaType type)
public <T> java.util.List<T> getList(java.lang.String path,
java.lang.Class<T> type)
public com.jayway.jsonpath.ReadContext context()
public boolean isOk()
public org.springframework.http.HttpStatus getStatusCode()
public org.springframework.http.ResponseEntity<java.lang.String> getRawResponse()
public GraphQLResponse assertThatNoErrorsArePresent()
public NumberOfErrorsAssertion assertThatNumberOfErrors()
public GraphQLErrorListAssertion assertThatListOfErrors()
public GraphQLFieldAssert assertThatField(java.lang.String jsonPath)
jsonPath - the JSON path of the field(s) to assert.public GraphQLFieldAssert assertThatDataField()
public GraphQLFieldAssert assertThatExtensionsField()
public GraphQLFieldAssert assertThatErrorsField()
public org.springframework.boot.test.json.JsonContentAssert assertThatJsonContent()
JsonContentAssert (as core AssertJ assertions do),
it is not possible chain other assertions after this one.JsonContentAssert instance for the content of the response.