Search in sources :

Example 1 with BuildException

use of io.smallrye.graphql.client.core.exceptions.BuildException in project smallrye-graphql by smallrye.

the class EnumsTest method invalidValue.

@Test
public void invalidValue() {
    try {
        Document document = document(operation(QUERY, field("exams", args(arg("result", gqlEnum("wrong { }"))), field("score"))));
        fail("Invalid enum value should not be accepted");
    } catch (BuildException be) {
    // OK
    }
}
Also used : BuildException(io.smallrye.graphql.client.core.exceptions.BuildException) Document(io.smallrye.graphql.client.core.Document) Test(org.junit.jupiter.api.Test)

Example 2 with BuildException

use of io.smallrye.graphql.client.core.exceptions.BuildException in project smallrye-graphql by smallrye.

the class EnumsTest method invalidValueTrue.

@Test
public void invalidValueTrue() {
    try {
        Document document = document(operation(QUERY, field("exams", args(arg("result", gqlEnum("true"))), field("score"))));
        fail("Invalid enum value should not be accepted");
    } catch (BuildException be) {
    // OK
    }
}
Also used : BuildException(io.smallrye.graphql.client.core.exceptions.BuildException) Document(io.smallrye.graphql.client.core.Document) Test(org.junit.jupiter.api.Test)

Aggregations

Document (io.smallrye.graphql.client.core.Document)2 BuildException (io.smallrye.graphql.client.core.exceptions.BuildException)2 Test (org.junit.jupiter.api.Test)2