title: Custom scalar Date not recognized by GraphQL java spring boot plugin for unit test
body: <p>I wrote this unit test for my controller and my schema contains a Date object which is implemented by the DateScalarConfiguration below. When I run the application there is no problems but when I'm testing it it gives me an error. This my code :</p>
  <pre><code>@GraphQlTest(MyController.class)
  @Import(DateScalarConfiguration.class)
  
     .....
  
     @Test
      public void findMyObjectTest() {
          List&lt;String&gt; fileExtensions = Arrays.asList(&quot;.graphql&quot;, &quot;.gql&quot;, &quot;.graphqls&quot;);
          DocumentSource documentSource = new ResourceDocumentSource(
                  Collections.singletonList(new ClassPathResource(&quot;graphql/&quot;)),
                  fileExtensions); // ResourceDocumentSource.FILE_EXTENSIONS
          this.graphQlTester
                  .mutate()
                  .documentSource(documentSource)
                  .build().documentName(&quot;schema&quot;)
                  .variable(&quot;myVar&quot;,618)
                  .execute()
                  .path(&quot;findMyObject&quot;)
                  .matchesJson(&quot;{\&quot;data\&quot;:{\&quot;findMyObject\&quot;:{\&quot;ATTR1\&quot;:618,\&quot;ATTR2\&quot;:\&quot;1999-12-31\&quot;}}}&quot;);
      }
  </code></pre>
  <p>DateScalarConfiguration:</p>
  <pre><code>@Configuration
  public class DateScalarConfiguration  {
  
      @Bean
      public GraphQLScalarType dateScalar() {
          return GraphQLScalarType.newScalar()
                  .name(&quot;Date&quot;)
                  .description(&quot;Java 8 LocalDate as scalar.&quot;)
                  .coercing(new Coercing&lt;Object, Object&gt;() {
                      @Override
                      public String serialize(final Object dataFetcherResult) {
                          if (dataFetcherResult instanceof LocalDate) {
                              return dataFetcherResult.toString();
                          } else {
                              throw new CoercingSerializeException(&quot;Expected a LocalDate object.&quot;);
                          }
                      }
  
                      @Override
                      public LocalDate parseValue(final Object input) {
                          try {
                              if (input instanceof String) {
                                  return LocalDate.parse((String) input);
                              } else {
                                  throw new CoercingParseValueException(&quot;Expected a String&quot;);
                              }
                          } catch (DateTimeParseException e) {
                              throw new CoercingParseValueException(String.format(&quot;Not a valid date: '%s'.&quot;, input), e
                              );
                          }
                      }
  
                      @Override
                      public LocalDate parseLiteral(final Object input) {
                          if (input instanceof StringValue) {
                              try {
                                  return LocalDate.parse(((StringValue) input).getValue());
                              } catch (DateTimeParseException e) {
                                  throw new CoercingParseLiteralException(e);
                              }
                          } else {
                              throw new CoercingParseLiteralException(&quot;Expected a StringValue.&quot;);
                          }
                      }
                  }).build();
      }
  
      @Bean
      RuntimeWiringConfigurer configurer() {
          GraphQLScalarType scalarType = dateScalar();
          return (builder) -&gt; builder.scalar(scalarType);
      }
  }
  </code></pre>
  <p>With this configuration :</p>
  <p>build.gradle</p>
  <pre><code>    implementation 'org.springframework.boot:spring-boot-starter-graphql'
      testImplementation 'org.springframework.graphql:spring-graphql'
      testImplementation 'org.springframework.graphql:spring-graphql-test'
  </code></pre>
  <p>And when I run this test I got :</p>
  <pre><code>[ValidationError{validationErrorType=NonExecutableDefinition, queryPath=null, message=Validation error of type NonExecutableDefinition: The Date definition is not executable., locations=[SourceLocation{line=1, column=1}], description='The Date definition is not executable.'},
  ....
  </code></pre>
  <p>I follow some tutos and I think nothing is wrong with my code ?</p>