use of io.smallrye.graphql.client.InvalidResponseException in project smallrye-graphql by smallrye.
the class ErrorBehavior method shouldFailOnMissingQueryResponse.
@Test
void shouldFailOnMissingQueryResponse() {
fixture.returnsData("");
StringApi api = fixture.build(StringApi.class);
InvalidResponseException thrown = catchThrowableOfType(api::greeting, InvalidResponseException.class);
then(thrown).hasMessageContaining("No data for 'greeting'");
}
use of io.smallrye.graphql.client.InvalidResponseException in project smallrye-graphql by smallrye.
the class NestedBehavior method shouldFailToAssignStringToSet.
@Test
void shouldFailToAssignStringToSet() {
fixture.returnsData("'greetings':'a'");
StringSetApi api = fixture.build(StringSetApi.class);
InvalidResponseException thrown = catchThrowableOfType(api::greetings, InvalidResponseException.class);
then(thrown).hasMessage("invalid java.util.Set<java.lang.String> value for " + StringSetApi.class.getName() + "#greetings: \"a\"");
}
use of io.smallrye.graphql.client.InvalidResponseException in project smallrye-graphql by smallrye.
the class NestedBehavior method shouldFailToAssignObjectToSet.
@Test
void shouldFailToAssignObjectToSet() {
fixture.returnsData("'greetings':{'foo':'bar'}");
StringSetApi api = fixture.build(StringSetApi.class);
InvalidResponseException thrown = catchThrowableOfType(api::greetings, InvalidResponseException.class);
then(thrown).hasMessage("invalid java.util.Set<java.lang.String> value for " + StringSetApi.class.getName() + "#greetings: {\"foo\":\"bar\"}");
}
use of io.smallrye.graphql.client.InvalidResponseException in project smallrye-graphql by smallrye.
the class NestedBehavior method shouldFailToCallNonNullStringListQuery.
@Test
void shouldFailToCallNonNullStringListQuery() {
fixture.returnsData("'greetings':['a',null]");
NonNullStringListApi api = fixture.build(NonNullStringListApi.class);
InvalidResponseException thrown = catchThrowableOfType(api::greetings, InvalidResponseException.class);
then(thrown).hasMessage("invalid null java.lang.String value for " + NonNullStringListApi.class.getName() + "#greetings[1]");
}
use of io.smallrye.graphql.client.InvalidResponseException in project smallrye-graphql by smallrye.
the class NestedBehavior method shouldFailToAssignStringToObjectListQuery.
@Test
void shouldFailToAssignStringToObjectListQuery() {
fixture.returnsData("'greetings':[{'text':'a','code':1},123456]");
ObjectListApi api = fixture.build(ObjectListApi.class);
InvalidResponseException thrown = catchThrowableOfType(api::greetings, InvalidResponseException.class);
then(thrown).hasMessage("invalid " + Greeting.class.getName() + " value for " + ObjectListApi.class.getName() + "#greetings[1]: 123456");
}
Aggregations