From 5f260d12f6e159b536542e6279cbf3d5bd0731b0 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Thu, 25 Nov 2021 10:44:33 +0000 Subject: [PATCH] Polishing --- .../annotation/support/DataFetcherHandlerMethod.java | 9 ++++----- .../org/springframework/graphql/GraphQlResponse.java | 5 +++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spring-graphql/src/main/java/org/springframework/graphql/data/method/annotation/support/DataFetcherHandlerMethod.java b/spring-graphql/src/main/java/org/springframework/graphql/data/method/annotation/support/DataFetcherHandlerMethod.java index d33f65f6..e3457934 100644 --- a/spring-graphql/src/main/java/org/springframework/graphql/data/method/annotation/support/DataFetcherHandlerMethod.java +++ b/spring-graphql/src/main/java/org/springframework/graphql/data/method/annotation/support/DataFetcherHandlerMethod.java @@ -84,13 +84,12 @@ public class DataFetcherHandlerMethod extends InvocableHandlerMethodSupport { * @param environment the GraphQL {@link DataFetchingEnvironment} to use to * resolve arguments. * - * @return the raw value returned by the invoked method, which may also be - * wrapped as a {@code Mono} in case of method arguments that require - * asynchronous resolution, e.g. {@code Principal} in WebFlux; this method - * may also return a {@code Mono} if the invocation fails. + * @return the raw value returned by the invoked method, possibly a + * {@code Mono} in case a method argument requires asynchronous resolution; + * {@code Mono resultMono) { - ExecutionResult result = resultMono.block(); + ExecutionResult result = resultMono.block(Duration.ofSeconds(5)); assertThat(result).isNotNull(); return from(result); } @@ -149,7 +150,7 @@ public class GraphQlResponse { @SuppressWarnings("BlockingMethodInNonBlockingContext") public static Flux forSubscription(Mono resultMono) { - ExecutionResult result = resultMono.block(); + ExecutionResult result = resultMono.block(Duration.ofSeconds(5)); assertThat(result).isNotNull(); return forSubscription(result); }