use of io.smallrye.graphql.client.core.Document in project smallrye-graphql by smallrye.
the class AbstractDynamicClientSubscriptionTest method testFailingImmediately.
@Test
public void testFailingImmediately() throws InterruptedException {
Document document = document(operation(OperationType.SUBSCRIPTION, field("failingImmediately")));
AtomicReference<Response> response = new AtomicReference<>();
CountDownLatch finished = new CountDownLatch(1);
client.subscription(document).subscribe().with(item -> {
response.set(item);
}, throwable -> {
// nothing
}, () -> {
finished.countDown();
});
finished.await(10, TimeUnit.SECONDS);
Response actualResponse = response.get();
assertNotNull("One response was expected to arrive", actualResponse);
Assert.assertEquals(JsonValue.NULL, actualResponse.getData().get("failingImmediately"));
// FIXME: add an assertion about the contained error message
// right now, there is no error message present, which is a bug
}
Aggregations