Skip to content

Commit 99493a3

Browse files
author
etienne-sf
committed
Issue #213:err when custom scalar's name differs from GraphQLType's name
1 parent d87ecf4 commit 99493a3

File tree

31 files changed

+154
-120
lines changed

31 files changed

+154
-120
lines changed

TODO.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Here are the next tasks listed, as a TODO list:
22

33
## TODO list for the 2.x branch
4+
* (re)Publish the wiki for the 2.6 release
45
* Check that the two generated graphQLClient (httpGraphQLClient and webSocketGraphQLClient) are properly documented in the tutorials
56
* Add a test for the GraphQL json schema
67
* Indicates in the Gradle tutorials that there are two versions of the plugin

graphql-java-client-runtime/src/main/java/com/graphql_java_generator/client/request/InputParameter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,7 @@ String getStringContentForGraphqlQuery(boolean writingGraphQLVariables, Object v
789789
return getStringContentForAListValue(writingGraphQLVariables, val, listDepth, graphQLTypeNameParam,
790790
graphQLScalarTypeParam, graphQLVariable);
791791
} else if (graphQLScalarTypeParam != null) {
792+
// This parameter is a scalar. We must apply its coercing method.
792793
Object ret = graphQLScalarTypeParam.getCoercing().serialize(val);
793794
if (ret instanceof String)
794795
return getStringValue((String) ret);

graphql-java-client-runtime/src/main/java/com/graphql_java_generator/customscalars/CustomScalarRegistryImpl.java

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,35 @@ public class CustomScalarRegistryImpl implements CustomScalarRegistry {
3636
Map<String, CustomScalar> customScalarTypes = new HashMap<>();
3737

3838
@Override
39-
public void registerGraphQLScalarType(GraphQLScalarType type, Class<?> valueClazz) {
40-
customScalarTypes.put(type.getName(), new CustomScalar(type, valueClazz));
39+
public void registerGraphQLScalarType(String typeName, GraphQLScalarType type, Class<?> valueClazz) {
40+
this.customScalarTypes.put(//
41+
typeName, //
42+
new CustomScalar(GraphQLScalarType.newScalar(type).name(typeName).build(), valueClazz));
4143
}
4244

4345
@Override
4446
public GraphQLScalarType getGraphQLCustomScalarType(String graphQLTypeName) {
45-
CustomScalar scalar = customScalarTypes.get(graphQLTypeName);
47+
CustomScalar scalar = this.customScalarTypes.get(graphQLTypeName);
4648
return (scalar == null) ? null : scalar.getGraphQLScalarType();
4749
}
4850

4951
@Override
5052
public CustomScalar getCustomScalar(String graphQLTypeName) {
51-
return customScalarTypes.get(graphQLTypeName);
53+
return this.customScalarTypes.get(graphQLTypeName);
54+
}
55+
56+
/**
57+
* Indicates whether the {@link CustomScalarRegistry} for the given schema has been initialized.
58+
*
59+
* @param schema
60+
* value of the <i>springBeanSuffix</i> plugin parameter for the searched schema. When there is only one
61+
* schema, this plugin parameter is usually not set. In this case, its default value ("") is used.
62+
* @return true if this registry is already initialized
63+
* @throws IllegalArgumentException
64+
* If no {@link CustomScalarRegistry} has been defined for the given schema
65+
*/
66+
static public boolean isCustomScalarRegistryInitialized(String schema) {
67+
return customScalarRegistries.get(schema) != null;
5268
}
5369

5470
/**

graphql-java-client-runtime/src/test/java/com/graphql_java_generator/client/request/InputParameterTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ void getValueForGraphqlQuery_BindParameter_CustomScalar_Date_OK() throws GraphQL
366366
void getValueForGraphqlQuery_BindParameter_CustomScalar_Long_OK() throws GraphQLRequestExecutionException {
367367
CustomScalarRegistryInitializer.initCustomScalarRegistry();
368368
// We add a specific custom scalar for this test, as this test is about the Long custom scalar
369-
CustomScalarRegistryImpl.getCustomScalarRegistry("MySchema")
370-
.registerGraphQLScalarType(ExtendedScalars.GraphQLLong, Long.class);
369+
CustomScalarRegistryImpl.getCustomScalarRegistry("MySchema").registerGraphQLScalarType("Long",
370+
ExtendedScalars.GraphQLLong, Long.class);
371371

372372
GraphQLScalarType graphQLScalarTypeLong = ExtendedScalars.GraphQLLong;
373373
String name = "aName";

graphql-java-client-runtime/src/test/java/com/graphql_java_generator/domain/client/allGraphQLCases/CustomScalarRegistryInitializer.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ public static CustomScalarRegistry initCustomScalarRegistry() {
1818
CustomScalarRegistry customScalarRegistry = new CustomScalarRegistryImpl();
1919

2020
// Registering the ID parser, for client mode
21-
customScalarRegistry.registerGraphQLScalarType(GraphQLScalarTypeIDClient.ID, String.class);
21+
customScalarRegistry.registerGraphQLScalarType("ID", GraphQLScalarTypeIDClient.ID, String.class);
2222

23-
customScalarRegistry.registerGraphQLScalarType(
23+
customScalarRegistry.registerGraphQLScalarType("Date",
2424
com.graphql_java_generator.customscalars.GraphQLScalarTypeDate.Date, java.util.Date.class);
25-
customScalarRegistry.registerGraphQLScalarType(ExtendedScalars.GraphQLLong, java.lang.Long.class);
26-
customScalarRegistry.registerGraphQLScalarType(
25+
customScalarRegistry.registerGraphQLScalarType("Long", ExtendedScalars.GraphQLLong, java.lang.Long.class);
26+
customScalarRegistry.registerGraphQLScalarType("Base64String",
2727
com.graphql_java_generator.customscalars.GraphQLScalarTypeBase64String.GraphQLBase64String,
2828
byte[].class);
29-
customScalarRegistry.registerGraphQLScalarType(
29+
customScalarRegistry.registerGraphQLScalarType("String",
3030
com.graphql_java_generator.customscalars.GraphQLScalarTypeString.String, java.lang.String.class);
31-
customScalarRegistry.registerGraphQLScalarType(graphql.scalars.ExtendedScalars.NonNegativeInt,
31+
customScalarRegistry.registerGraphQLScalarType("NonNegativeInt", graphql.scalars.ExtendedScalars.NonNegativeInt,
3232
java.lang.Integer.class);
3333

3434
CustomScalarRegistryImpl.setCustomScalarRegistry("MySchema", customScalarRegistry);

graphql-java-client-runtime/src/test/java/com/graphql_java_generator/domain/client/forum/CustomScalarRegistryInitializer.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,22 @@ public static CustomScalarRegistry initCustomScalarRegistry() {
1616
CustomScalarRegistry customScalarRegistry = new CustomScalarRegistryImpl();
1717

1818
// Registering the ID parser, for client mode
19-
customScalarRegistry.registerGraphQLScalarType(GraphQLScalarTypeIDClient.ID, String.class);
19+
customScalarRegistry.registerGraphQLScalarType("ID", GraphQLScalarTypeIDClient.ID, String.class);
2020

21-
customScalarRegistry.registerGraphQLScalarType(
21+
customScalarRegistry.registerGraphQLScalarType("Date",
2222
com.graphql_java_generator.customscalars.GraphQLScalarTypeDate.Date, java.util.Date.class);
23-
customScalarRegistry.registerGraphQLScalarType(graphql.scalars.ExtendedScalars.DateTime,
23+
customScalarRegistry.registerGraphQLScalarType("DateTime", graphql.scalars.ExtendedScalars.DateTime,
2424
java.time.OffsetDateTime.class);
25-
customScalarRegistry.registerGraphQLScalarType(graphql.scalars.ExtendedScalars.GraphQLLong,
25+
customScalarRegistry.registerGraphQLScalarType("Long", graphql.scalars.ExtendedScalars.GraphQLLong,
2626
java.lang.Long.class);
27-
customScalarRegistry.registerGraphQLScalarType(
27+
customScalarRegistry.registerGraphQLScalarType("Base64String",
2828
com.graphql_java_generator.customscalars.GraphQLScalarTypeBase64String.GraphQLBase64String,
2929
byte[].class);
30-
customScalarRegistry.registerGraphQLScalarType(graphql.scalars.ExtendedScalars.Object, java.lang.Object.class);
31-
customScalarRegistry.registerGraphQLScalarType(graphql.scalars.ExtendedScalars.Json,
30+
customScalarRegistry.registerGraphQLScalarType("Object", graphql.scalars.ExtendedScalars.Object,
31+
java.lang.Object.class);
32+
customScalarRegistry.registerGraphQLScalarType("JSON", graphql.scalars.ExtendedScalars.Json,
3233
com.fasterxml.jackson.databind.node.ObjectNode.class);
33-
customScalarRegistry.registerGraphQLScalarType(graphql.scalars.ExtendedScalars.NonNegativeInt,
34+
customScalarRegistry.registerGraphQLScalarType("NonNegativeInt", graphql.scalars.ExtendedScalars.NonNegativeInt,
3435
java.lang.Integer.class);
3536

3637
CustomScalarRegistryImpl.setCustomScalarRegistry("MySchema", customScalarRegistry);

graphql-java-common-runtime/src/main/java/com/graphql_java_generator/customscalars/CustomScalarRegistry.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@ public interface CustomScalarRegistry {
1515
/**
1616
* Manually register one {@link GraphQLScalarType}.
1717
*
18+
* @param typeName
19+
* The name of the custom scalar type, as defined in the provided GaphQL schema. It may be different from
20+
* the provided <code>graphQLScalarType</code>
1821
* @param graphQLScalarType
22+
* The GraphQL custom scalar class, that contain the coercing rules to serialize and unserialize this
23+
* custom scalar
1924
* @param valueClazz
2025
* The java The java type that will contain values for this custom scalar. This is needed to properly
2126
* create the data from the value read in a string, especially when reading a GraphQL request, when in
2227
* client mode
2328
*/
24-
public void registerGraphQLScalarType(GraphQLScalarType graphQLScalarType, Class<?> valueClazz);
29+
public void registerGraphQLScalarType(String typeName, GraphQLScalarType graphQLScalarType, Class<?> valueClazz);
2530

2631
/**
2732
* Retrieves the registered {@link GraphQLScalarType} for this GraphQL CustomScalar.

graphql-maven-plugin-logic/src/main/resources/templates/client_CustomScalarRegistryInitializer.vm.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,31 +27,31 @@ public class CustomScalarRegistryInitializer {
2727
* Initialization of the {@link CustomScalarRegistry} with all known custom scalars, that is with all custom scalars
2828
* defined in the project pom
2929
*/
30-
public static CustomScalarRegistry initCustomScalarRegistry() {
31-
CustomScalarRegistry customScalarRegistry = new CustomScalarRegistryImpl();
30+
public static void initCustomScalarRegistry() {
31+
if (!CustomScalarRegistryImpl.isCustomScalarRegistryInitialized("$springBeanSuffix")) {
32+
CustomScalarRegistry customScalarRegistry = new CustomScalarRegistryImpl();
33+
CustomScalarRegistryImpl.setCustomScalarRegistry("$springBeanSuffix", customScalarRegistry); //$NON-NLS-1$
3234

3335
#if ($isPluginModeClient)
34-
// Registering the ID parser, for client mode
35-
customScalarRegistry.registerGraphQLScalarType(GraphQLScalarTypeIDClient.ID, String.class);
36+
// Registering the ID parser, for client mode
37+
customScalarRegistry.registerGraphQLScalarType("ID", GraphQLScalarTypeIDClient.ID, String.class);
3638
#else
37-
// Registering the ID parser, for server mode
38-
customScalarRegistry.registerGraphQLScalarType(GraphQLScalarTypeIDServer.ID, ${configuration.javaTypeForIDType}.class);
39+
// Registering the ID parser, for server mode
40+
customScalarRegistry.registerGraphQLScalarType("ID", GraphQLScalarTypeIDServer.ID, ${configuration.javaTypeForIDType}.class);
3941
#end
4042

4143
#foreach ($customScalar in $customScalars)
4244
#if (${customScalar.customScalarDefinition.graphQLScalarTypeClass})
43-
customScalarRegistry.registerGraphQLScalarType(new ${customScalar.customScalarDefinition.graphQLScalarTypeClass}(), ${customScalar.customScalarDefinition.javaType}.class);
45+
customScalarRegistry.registerGraphQLScalarType("${customScalar.name}", new ${customScalar.customScalarDefinition.graphQLScalarTypeClass}(), ${customScalar.customScalarDefinition.javaType}.class);
4446
#elseif (${customScalar.customScalarDefinition.graphQLScalarTypeStaticField})
45-
customScalarRegistry.registerGraphQLScalarType(${customScalar.customScalarDefinition.graphQLScalarTypeStaticField}, ${customScalar.customScalarDefinition.javaType}.class);
47+
customScalarRegistry.registerGraphQLScalarType("${customScalar.name}", ${customScalar.customScalarDefinition.graphQLScalarTypeStaticField}, ${customScalar.customScalarDefinition.javaType}.class);
4648
#elseif (${customScalar.customScalarDefinition.graphQLScalarTypeGetter})
47-
customScalarRegistry.registerGraphQLScalarType(${customScalar.customScalarDefinition.graphQLScalarTypeGetter}, ${customScalar.customScalarDefinition.javaType}.class);
49+
customScalarRegistry.registerGraphQLScalarType("${customScalar.name}", ${customScalar.customScalarDefinition.graphQLScalarTypeGetter}, ${customScalar.customScalarDefinition.javaType}.class);
4850
#else
49-
customScalarRegistry.registerGraphQLScalarType: ${customScalar.javaName} : you must define one of graphQLScalarTypeClass, graphQLScalarTypeStaticField or graphQLScalarTypeGetter (in the POM parameters for CustomScalars)
51+
customScalarRegistry.registerGraphQLScalarType: ${customScalar.name} : you must define one of graphQLScalarTypeClass, graphQLScalarTypeStaticField or graphQLScalarTypeGetter (in the POM parameters for CustomScalars)
5052
#end
5153
#end
52-
53-
CustomScalarRegistryImpl.setCustomScalarRegistry("$springBeanSuffix", customScalarRegistry); //$NON-NLS-1$
54-
return customScalarRegistry;
54+
}
5555
}
5656

5757
}

graphql-maven-plugin-logic/src/main/resources/templates/server_GraphQLWiring.vm.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import org.springframework.graphql.execution.RuntimeWiringConfigurer;
1111
import org.springframework.stereotype.Component;
1212

13+
import graphql.schema.GraphQLScalarType;
14+
1315
/**
1416
* Thanks to spring-graphql, the POJO classes are auto-magically discovered and mapped. But the custom scalars still needs to be 'manually' wired.
1517
* This is the objective of this class.
@@ -33,15 +35,18 @@ public void configure(graphql.schema.idl.RuntimeWiring.Builder builder) {
3335
##
3436
## Step 1: wiring the custom scalar definitions
3537
##
38+
.scalar(GraphQLScalarType.newScalar(
3639
#if (${customScalar.customScalarDefinition.graphQLScalarTypeClass})
37-
.scalar(new ${customScalar.customScalarDefinition.graphQLScalarTypeClass}())
40+
new ${customScalar.customScalarDefinition.graphQLScalarTypeClass}())
3841
#elseif (${customScalar.customScalarDefinition.graphQLScalarTypeStaticField})
39-
.scalar(${customScalar.customScalarDefinition.graphQLScalarTypeStaticField})
42+
${customScalar.customScalarDefinition.graphQLScalarTypeStaticField})
4043
#elseif (${customScalar.customScalarDefinition.graphQLScalarTypeGetter})
41-
.scalar(${customScalar.customScalarDefinition.graphQLScalarTypeGetter})
44+
${customScalar.customScalarDefinition.graphQLScalarTypeGetter})
4245
#else
4346
.scalar(): ${customScalar.javaName} : you must define one of graphQLScalarTypeClass, graphQLScalarTypeStaticField or graphQLScalarTypeGetter (in the POM parameters for CustomScalars)
4447
#end
48+
.name("${customScalar.name}")
49+
.build())
4550
#end
4651
//
4752
// Let's finish the job
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package com.graphql_java_generator.plugin.compilation_tests;
22

33
import org.junit.jupiter.api.BeforeEach;
4+
import org.junit.jupiter.api.Disabled;
45
import org.junit.jupiter.api.Tag;
56

67
import com.graphql_java_generator.plugin.test.helper.GraphQLConfigurationTestHelper;
78

89
import graphql.mavenplugin_notscannedbyspring.Github_Client_SpringConfiguration;
910

11+
@Disabled // Disabled because he test execution is long , and no error have ever been found by this test
1012
@Tag("github")
1113
class GithubPublicSchemaClientTest extends AbstractIntegrationTest {
1214

@@ -16,8 +18,8 @@ public GithubPublicSchemaClientTest() {
1618

1719
@BeforeEach
1820
public void setUp() {
19-
((GraphQLConfigurationTestHelper) pluginConfiguration).separateUtilityClasses = true;
20-
graphqlTestHelper.checkSchemaStringProvider("github.schema.public.graphqls");
21+
((GraphQLConfigurationTestHelper) this.pluginConfiguration).separateUtilityClasses = true;
22+
this.graphqlTestHelper.checkSchemaStringProvider("github.schema.public.graphqls");
2123
}
2224

2325
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package com.graphql_java_generator.plugin.compilation_tests;
22

33
import org.junit.jupiter.api.BeforeEach;
4+
import org.junit.jupiter.api.Disabled;
45
import org.junit.jupiter.api.Tag;
56

67
import com.graphql_java_generator.plugin.test.helper.GraphQLConfigurationTestHelper;
78

89
import graphql.mavenplugin_notscannedbyspring.Shopify_Client_SpringConfiguration;
910

11+
@Disabled // Disabled because he test execution is long , and no error have ever been found by this test
1012
@Tag("shopify")
1113
class ShopifyClientTest extends AbstractIntegrationTest {
1214

@@ -16,8 +18,8 @@ public ShopifyClientTest() {
1618

1719
@BeforeEach
1820
public void setUp() {
19-
((GraphQLConfigurationTestHelper) pluginConfiguration).separateUtilityClasses = true;
20-
graphqlTestHelper.checkSchemaStringProvider("shopify.graphqls");
21+
((GraphQLConfigurationTestHelper) this.pluginConfiguration).separateUtilityClasses = true;
22+
this.graphqlTestHelper.checkSchemaStringProvider("shopify.graphqls");
2123
}
2224

2325
}

graphql-maven-plugin-logic/src/test/java/com/graphql_java_generator/plugin/generate_code/DocumentParser_allGraphQLCases_Server_KO_Test.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,31 @@ class DocumentParser_allGraphQLCases_Server_KO_Test {
3131

3232
@AfterEach
3333
void cleanUp() {
34-
if (ctx != null) {
35-
ctx.close();
34+
if (this.ctx != null) {
35+
this.ctx.close();
3636
}
3737
}
3838

3939
@Test
4040
@Execution(ExecutionMode.CONCURRENT)
4141
void test_parseOneDocument_allGraphQLCases() throws IOException {
4242
// Preparation
43-
ctx = new AnnotationConfigApplicationContext(AllGraphQLCases_Server_SpringConfiguration_KO.class);
44-
GenerateCodeDocumentParser documentParser = ctx.getBean(GenerateCodeDocumentParser.class);
43+
this.ctx = new AnnotationConfigApplicationContext(AllGraphQLCases_Server_SpringConfiguration_KO.class);
44+
GenerateCodeDocumentParser documentParser = this.ctx.getBean(GenerateCodeDocumentParser.class);
4545

4646
// Go, go, go
4747
Exception e = assertThrows(Exception.class, () -> documentParser.parseGraphQLSchemas());
48-
assertTrue(e.getMessage().contains("must provide an implementation for the Custom Scalar 'Date'"));
48+
assertTrue(e.getMessage()
49+
.contains("must provide an implementation for the Custom Scalar 'MyCustomScalarForADate'"));
4950
}
5051

5152
@Test
5253
@Execution(ExecutionMode.CONCURRENT)
5354
void test_allGraphQLCases_relayConnTrue_defaultGraphqlsFolder() throws IOException {
5455
// Preparation
55-
ctx = new AnnotationConfigApplicationContext(AllGraphQLCases_Server_SpringConfiguration.class);
56-
GenerateCodeDocumentParser documentParser = ctx.getBean(GenerateCodeDocumentParser.class);
57-
GraphQLConfigurationTestHelper pluginConfiguration = ctx.getBean(GraphQLConfigurationTestHelper.class);
56+
this.ctx = new AnnotationConfigApplicationContext(AllGraphQLCases_Server_SpringConfiguration.class);
57+
GenerateCodeDocumentParser documentParser = this.ctx.getBean(GenerateCodeDocumentParser.class);
58+
GraphQLConfigurationTestHelper pluginConfiguration = this.ctx.getBean(GraphQLConfigurationTestHelper.class);
5859

5960
// Let's update some configuration parameters AFTER the documents are loaded, to check the control tests, when
6061
// the parsing starts

graphql-maven-plugin-logic/src/test/java/com/graphql_java_generator/plugin/generate_code/DocumentParser_allGraphQLCases_Server_Test.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,15 @@ void test_parseOneDocument_allGraphQLCases() throws IOException {
144144
checkNbInputParameter(objectType, j, 0);
145145
j += 1;
146146
// date: Date
147-
checkField(objectType, j, "date", 0, false, null, "Date", "Date");
147+
checkField(objectType, j, "date", 0, false, null, "MyCustomScalarForADate", "Date");
148148
checkNbInputParameter(objectType, j, 0);
149149
j += 1;
150150
// dateTime: DateTime
151-
checkField(objectType, j, "dateTime", 0, false, null, "DateTime", "OffsetDateTime");
151+
checkField(objectType, j, "dateTime", 0, false, null, "MyCustomScalarForADateTime", "OffsetDateTime");
152152
checkNbInputParameter(objectType, j, 0);
153153
j += 1;
154154
// dates: [Date]!
155-
checkField(objectType, j, "dates", 1, true, false, "Date", "Date");
155+
checkField(objectType, j, "dates", 1, true, false, "MyCustomScalarForADate", "Date");
156156
checkNbInputParameter(objectType, j, 0);
157157
j += 1;
158158
// nbComments: Int
@@ -195,8 +195,8 @@ void test_parseOneDocument_allGraphQLCases() throws IOException {
195195
"STP_AllFieldCasesWithIdSubtype_STS");
196196
checkNbInputParameter(objectType, j, 5);
197197
checkInputParameter(objectType, j, 0, "nbItems", 0, true, null, "Long", "Long", null);
198-
checkInputParameter(objectType, j, 1, "date", 0, false, null, "Date", "Date", null);
199-
checkInputParameter(objectType, j, 2, "dates", 1, true, false, "Date", "Date", null);
198+
checkInputParameter(objectType, j, 1, "date", 0, false, null, "MyCustomScalarForADate", "Date", null);
199+
checkInputParameter(objectType, j, 2, "dates", 1, true, false, "MyCustomScalarForADate", "Date", null);
200200
checkInputParameter(objectType, j, 3, "uppercaseName", 0, false, null, "Boolean", "Boolean", null);
201201
checkInputParameter(objectType, j, 4, "textToAppendToTheForname", 0, false, null, "String", "String", null);
202202
j += 1;
@@ -251,13 +251,13 @@ void test_parseOneDocument_allGraphQLCases() throws IOException {
251251
assertEquals("anotherTestDirective", this.generateCodeDocumentParser.getDirectives().get(i++).getName());
252252

253253
// On Scalar
254-
assertEquals(2, this.generateCodeDocumentParser.getType("Date").getAppliedDirectives().size(),
254+
assertEquals(2, this.generateCodeDocumentParser.getType("MyCustomScalarForADate").getAppliedDirectives().size(),
255255
"No directive in the schema, as it is adapted for graphql-java v15.0, see below in the junit test code");
256256
// checkDirectivesOnType(Type type, boolean containsTestDirective, String value, String anotherValue,
257257
// Integer anInt, Float aFloat, Boolean aBoolean, String anID, String anEnumName, String aCustomScalarDate,
258258
// boolean containsAnotherTestDirective, int nbOtherDirectives)
259-
checkDirectivesOnType(this.generateCodeDocumentParser.getType("Date"), true, "on Scalar", null, null, null,
260-
null, null, null, null, true, 0);
259+
checkDirectivesOnType(this.generateCodeDocumentParser.getType("MyCustomScalarForADate"), true, "on Scalar",
260+
null, null, null, null, null, null, null, true, 0);
261261

262262
checkDirectivesOnType(this.generateCodeDocumentParser.getType("Long"), false, null, null, null, null, null,
263263
null, null, null, false, 1);

0 commit comments

Comments
 (0)