Consider DataFetcherExceptionResolver in GraphQTest

Prior to this commit, `@GraphQlTest` slice tests would only consider
JsonComponent, RuntimeWiringConfigurer, Converter and
GenericConverter beans. But DataFetcherExceptionResolver,
Instrumentation and GraphQlSourceBuilderCustomizer are used in
setting up the GraphQL source.

This commit ensures that the `GraphQlTypeExcludeFilter` considers
those bean types.

Closes gh-30078
This commit is contained in:
Gautham Mohan
2022-03-07 11:55:48 +05:30
committed by Brian Clozel
parent 087e853c5d
commit 4388910435
4 changed files with 107 additions and 2 deletions

View File

@@ -444,7 +444,7 @@ There are `GraphQlTester` variants and Spring Boot will auto-configure them depe
Spring Boot helps you to test your {spring-graphql-docs}#controllers[Spring GraphQL Controllers] with the `@GraphQlTest` annotation.
`@GraphQlTest` auto-configures the Spring GraphQL infrastructure, without any transport nor server being involved.
This limits scanned beans to `@Controller`, `RuntimeWiringConfigurer`, `JsonComponent`, `Converter` and `GenericConverter`.
This limits scanned beans to `@Controller`, `RuntimeWiringConfigurer`, `JsonComponent`, `Converter`, `GenericConverter`, `DataFetcherExceptionResolver`, `Instrumentation` and `GraphQlSourceBuilderCustomizer`.
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@GraphQlTest` annotation is used.
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.