Skip to content

Commit 2c6ef91

Browse files
committed
Polishing contribution
Closes gh-983
1 parent 45af593 commit 2c6ef91

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

spring-graphql/src/test/java/org/springframework/graphql/execution/ContextDataFetcherDecoratorTests.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -55,15 +55,15 @@
5555
@SuppressWarnings("ReactiveStreamsUnusedPublisher")
5656
public class ContextDataFetcherDecoratorTests {
5757

58-
private static final String SCHEMA_CONTENT = "" +
59-
"directive @UpperCase on FIELD_DEFINITION " +
60-
"type Query { " +
61-
" greeting: String @UpperCase, " +
62-
" greetings: [String] " +
63-
"} " +
64-
"type Subscription { " +
65-
" greetings: String " +
66-
"}";
58+
private static final String SCHEMA_CONTENT = """
59+
directive @UpperCase on FIELD_DEFINITION \
60+
type Query { \
61+
greeting: String @UpperCase, \
62+
greetings: [String] \
63+
} \
64+
type Subscription { \
65+
greetings: String \
66+
}""";
6767

6868

6969
@Test
@@ -241,16 +241,16 @@ else if (value instanceof Mono) {
241241
tester.accept(directiveWiring, env -> Mono.just("hello"));
242242
}
243243

244-
@Test //gh-980
244+
@Test // gh-980
245245
void trivialDataFetcherIsNotDecorated() {
246246
GraphQL graphQl = GraphQlSetup.schemaContent(SCHEMA_CONTENT)
247-
.queryFetcher("greeting", (TrivialDataFetcher) env -> "hello")
248-
.toGraphQl();
247+
.queryFetcher("greeting", (TrivialDataFetcher<?>) env -> "hello")
248+
.toGraphQl();
249249

250250
GraphQLSchema schema = graphQl.getGraphQLSchema();
251251
FieldCoordinates coordinates = FieldCoordinates.coordinates("Query", "greeting");
252-
DataFetcher<?> dataFetcher = schema.getCodeRegistry()
253-
.getDataFetcher(coordinates, schema.getFieldDefinition(coordinates));
252+
GraphQLFieldDefinition fieldDefinition = schema.getFieldDefinition(coordinates);
253+
DataFetcher<?> dataFetcher = schema.getCodeRegistry().getDataFetcher(coordinates, fieldDefinition);
254254

255255
assertThat(dataFetcher).isInstanceOf(TrivialDataFetcher.class);
256256
}

0 commit comments

Comments
 (0)