use of org.allGraphQLCases.subscription.SubscriptionCallbackToADate in project graphql-maven-plugin-project by graphql-java-generator.
the class GraphQLVariablesIT method test_GraphQLVariables_subscribeToADate.
@Execution(ExecutionMode.CONCURRENT)
@Test
public void test_GraphQLVariables_subscribeToADate() throws GraphQLRequestExecutionException, GraphQLRequestPreparationException, InterruptedException {
// Preparation
SubscriptionCallbackToADate callback = new SubscriptionCallbackToADate("test_GraphQLVariables_subscribeToAList");
Date date = new GregorianCalendar(2021, 4 - 1, 15).getTime();
// Go, go, go
GraphQLRequest subscription = subscriptionExecutor.getGraphQLRequest("subscription sub($aCustomScalarParam: Date!) {issue53(date: $aCustomScalarParam){}}");
SubscriptionClient sub = subscription.execSubscription(callback, Date.class, "aCustomScalarParam", date);
// Let's wait a max of 10 second, until we receive some notifications (my PC is really slow, especially when the
// antivirus consumes 98% of my CPU!
callback.latchForMessageReception.await(10, TimeUnit.SECONDS);
// Let's disconnect from the subscription
sub.unsubscribe();
// Verification
assertNull(callback.lastReceivedError, "expected no error, but received " + callback.lastReceivedError);
assertNotNull(callback.lastReceivedMessage, "The subscription should have received a message");
}
Aggregations