### Question:
DefaultGraphQLInvocation implements GraphQLInvocation { @Override public Mono<ExecutionResult> invoke(GraphQLInvocationData invocationData, ServerWebExchange serverWebExchange) { ExecutionInput.Builder executionInputBuilder = ExecutionInput.newExecutionInput() .query(invocationData.getQuery()) .operationName(invocationData.getOperationName()) .variables(invocationData.getVariables()); if (dataLoaderRegistry != null) { executionInputBuilder.dataLoaderRegistry(dataLoaderRegistry); } ExecutionInput executionInput = executionInputBuilder.build(); Mono<ExecutionInput> customizedExecutionInputMono = executionInputCustomizer.customizeExecutionInput(executionInput, serverWebExchange); return customizedExecutionInputMono.flatMap(customizedExecutionInput -> Mono.fromCompletionStage(graphQL.executeAsync(customizedExecutionInput))); }  @Override Mono<ExecutionResult> invoke(GraphQLInvocationData invocationData, ServerWebExchange serverWebExchange);  }### Answer:
@Test public void testCustomizerIsCalled() { String query = "query myQuery {foo}"; String operationName = "myQuery"; Map<String, Object> variables = new LinkedHashMap<>(); DefaultGraphQLInvocation defaultGraphQLInvocation = new DefaultGraphQLInvocation(); ExecutionInputCustomizer executionInputCustomizer = mock(ExecutionInputCustomizer.class); defaultGraphQLInvocation.executionInputCustomizer = executionInputCustomizer; GraphQL graphQL = mock(GraphQL.class); defaultGraphQLInvocation.graphQL = graphQL; ExecutionResult executionResult = mock(ExecutionResult.class); when(graphQL.executeAsync(any(ExecutionInput.class))).thenReturn(completedFuture(executionResult)); GraphQLInvocationData graphQLInvocationData = new GraphQLInvocationData(query, operationName, variables); ServerWebExchange serverWebExchange = mock(ServerWebExchange.class); ArgumentCaptor<ExecutionInput> captor1 = ArgumentCaptor.forClass(ExecutionInput.class); ArgumentCaptor<ServerWebExchange> captor2 = ArgumentCaptor.forClass(ServerWebExchange.class); ExecutionInput executionInputResult = mock(ExecutionInput.class); when(executionInputCustomizer.customizeExecutionInput(captor1.capture(), captor2.capture())).thenReturn(Mono.just(executionInputResult)); Mono<ExecutionResult> invoke = defaultGraphQLInvocation.invoke(graphQLInvocationData, serverWebExchange); assertThat(captor1.getValue().getQuery()).isEqualTo(query); assertThat(captor1.getValue().getOperationName()).isEqualTo(operationName); assertThat(captor1.getValue().getVariables()).isSameAs(variables); invoke.block(); verify(graphQL).executeAsync(executionInputResult); }