public class GraphQLFieldAssert extends java.lang.Object implements GraphQLResponseAssertion
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
EXPECTED_FIELD_S_TO_BE_PRESENT |
static java.lang.String |
EXPECTED_THAT_CONTENT_OF_FIELD_S_CAN_BE_CONVERTED_TO_S |
| Constructor and Description |
|---|
GraphQLFieldAssert() |
| Modifier and Type | Method and Description |
|---|---|
GraphQLResponse |
and() |
<T> GraphQLGenericObjectAssert<T> |
as(java.lang.Class<T> clazz)
Returns an assertion for the content of the field as an instance of the specified class.
|
<T> GraphQLGenericObjectAssert<T> |
as(com.fasterxml.jackson.databind.JavaType javaType)
Returns an assertion for the content of the field as an instance of the specified type.
|
GraphQLBigDecimalAssert |
asBigDecimal()
Returns an assertion for the content of the field as
BigDecimal. |
GraphQLBigIntegerAssert |
asBigInteger()
Returns an assertion for the content of the field as
BigInteger. |
GraphQLBooleanAssert |
asBoolean()
Returns an assertion for the content of the field as
Boolean. |
GraphQLByteAssert |
asByte()
Returns an assertion for the content of the field as
Byte. |
GraphQLIntegerAssert |
asInteger()
Returns an assertion for the content of the field as
Integer. |
<T> GraphQLListAssert<T> |
asList(com.fasterxml.jackson.databind.JavaType javaListType)
Returns an assertion for the content of the field as an instance of the specified list type.
|
<T> GraphQLListAssert<T> |
asListOf(java.lang.Class<T> elementClass)
Returns an assertion for the content of the field as list of objects.
|
GraphQLLongAssert |
asLong()
Returns an assertion for the content of the field as
Long. |
GraphQLShortAssert |
asShort()
Returns an assertion for the content of the field as
Short. |
GraphQLStringAssert |
asString()
Returns an assertion for the content of the field as
String. |
GraphQLFieldAssert |
isNotNull()
Asserts that the field specified by the provided JSON path is not null.
|
GraphQLFieldAssert |
isNotPresent()
Asserts that the field specified by the provided JSON path is not present in the response.
|
GraphQLFieldAssert |
isNotPresentOrNull()
Asserts that the field specified by the provided JSON path is not present in the response or
its value is null.
|
GraphQLFieldAssert |
isNull()
Asserts that the field specified by the provided JSON path is null.
|
public static final java.lang.String EXPECTED_FIELD_S_TO_BE_PRESENT
public static final java.lang.String EXPECTED_THAT_CONTENT_OF_FIELD_S_CAN_BE_CONVERTED_TO_S
public GraphQLFieldAssert isNotPresent()
java.lang.AssertionError - if the field is present in the responsepublic GraphQLFieldAssert isNotPresentOrNull()
java.lang.AssertionError - if the field is present in the response and its value is not null.public GraphQLFieldAssert isNull()
java.lang.AssertionError - if the field is not present in the response or its value is not null.public GraphQLFieldAssert isNotNull()
java.lang.AssertionError - if the field is not present in the response or its value is null.public GraphQLBigDecimalAssert asBigDecimal()
BigDecimal.GraphQLBigDecimalAssert instancejava.lang.AssertionError - if the path does not exist or the content could not be converted to
BigDecimalpublic GraphQLBigIntegerAssert asBigInteger()
BigInteger.GraphQLBigIntegerAssert instancejava.lang.AssertionError - if the path does not exist or the content could not be converted to
BigIntegerpublic GraphQLLongAssert asLong()
Long.GraphQLLongAssert instancejava.lang.AssertionError - if the path does not exist or the content could not be converted to
Longpublic GraphQLIntegerAssert asInteger()
Integer.GraphQLIntegerAssert instancejava.lang.AssertionError - if the path does not exist or the content could not be converted to
Integerpublic GraphQLShortAssert asShort()
Short.GraphQLShortAssert instancejava.lang.AssertionError - if the path does not exist or the content could not be converted to
Shortpublic GraphQLByteAssert asByte()
Byte.GraphQLByteAssert instancejava.lang.AssertionError - if the path does not exist or the content could not be converted to
Bytepublic GraphQLBooleanAssert asBoolean()
Boolean.GraphQLBooleanAssert instancejava.lang.AssertionError - if the path does not exist or the content could not be converted to
Booleanpublic GraphQLStringAssert asString()
String.GraphQLStringAssert instancejava.lang.AssertionError - if the path does not exist or the content could not be converted to
Stringpublic <T> GraphQLGenericObjectAssert<T> as(java.lang.Class<T> clazz)
clazz - The class of the object. to assertGraphQLGenericObjectAssert instancejava.lang.AssertionError - if the path does not exist or the content could not be converted to the
specified classpublic <T> GraphQLGenericObjectAssert<T> as(com.fasterxml.jackson.databind.JavaType javaType)
javaType - The java type definition.GraphQLGenericObjectAssert instancejava.lang.AssertionError - if the path does not exist or the content could not be converted to the
specified classpublic <T> GraphQLListAssert<T> asList(com.fasterxml.jackson.databind.JavaType javaListType)
javaListType - The java type definition. Expected to define a list type.GraphQLListAssert instancejava.lang.AssertionError - if the path does not exist or the content could not be converted to the
specified class or if the provided type is not a list type.public <T> GraphQLListAssert<T> asListOf(java.lang.Class<T> elementClass)
elementClass - the type of objects in the listGraphQLGenericObjectAssert instancejava.lang.AssertionError - if the path does not exist or the content could not be converted to the
specified classpublic GraphQLResponse and()
and in interface GraphQLResponseAssertionGraphQLResponse for which this assertion was created. Allows
chaining fluent assertions.