You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GraphQL slice tests should load `@ControllerAdvice` beans, since Spring
GraphQL will load `@GraphQlExceptionHandler`s declared in
`@ControllerAdvice` beans.
This aligns `@GraphQlTest` with `@WebMvcTest`, which does load
`@ControllerAdvice` beans.
Signed-off-by: Louis Morgan <ljrmorgan@gmail.com>
Copy file name to clipboardExpand all lines: documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/spring-boot-applications.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -458,7 +458,7 @@ There are javadoc:org.springframework.graphql.test.tester.GraphQlTester[] varian
458
458
459
459
Spring Boot helps you to test your {url-spring-graphql-docs}/controllers.html[Spring GraphQL Controllers] with the javadoc:org.springframework.boot.graphql.test.autoconfigure.GraphQlTest[format=annotation] annotation from the `spring-boot-graphql-test` module.
460
460
javadoc:org.springframework.boot.graphql.test.autoconfigure.GraphQlTest[format=annotation] auto-configures the Spring GraphQL infrastructure, without any transport nor server being involved.
461
-
This limits scanned beans to javadoc:org.springframework.stereotype.Controller[format=annotation], javadoc:org.springframework.graphql.execution.RuntimeWiringConfigurer[], javadoc:org.springframework.boot.jackson.JacksonComponent[], javadoc:org.springframework.boot.jackson2.JsonComponent[format=annotation] (deprecated), javadoc:org.springframework.core.convert.converter.Converter[], javadoc:org.springframework.core.convert.converter.GenericConverter[], javadoc:org.springframework.graphql.execution.DataFetcherExceptionResolver[], javadoc:graphql.execution.instrumentation.Instrumentation[] and javadoc:org.springframework.boot.graphql.autoconfigure.GraphQlSourceBuilderCustomizer[].
461
+
This limits scanned beans to javadoc:org.springframework.stereotype.Controller[format=annotation], javadoc:org.springframework.web.bind.annotation.ControllerAdvice[format=annotation] javadoc:org.springframework.graphql.execution.RuntimeWiringConfigurer[], javadoc:org.springframework.boot.jackson.JacksonComponent[], javadoc:org.springframework.boot.jackson2.JsonComponent[format=annotation] (deprecated), javadoc:org.springframework.core.convert.converter.Converter[], javadoc:org.springframework.core.convert.converter.GenericConverter[], javadoc:org.springframework.graphql.execution.DataFetcherExceptionResolver[], javadoc:graphql.execution.instrumentation.Instrumentation[] and javadoc:org.springframework.boot.graphql.autoconfigure.GraphQlSourceBuilderCustomizer[].
462
462
Regular javadoc:org.springframework.stereotype.Component[format=annotation] and javadoc:org.springframework.boot.context.properties.ConfigurationProperties[format=annotation] beans are not scanned when the javadoc:org.springframework.boot.graphql.test.autoconfigure.GraphQlTest[format=annotation] annotation is used.
463
463
javadoc:org.springframework.boot.context.properties.EnableConfigurationProperties[format=annotation] can be used to include javadoc:org.springframework.boot.context.properties.ConfigurationProperties[format=annotation] beans.
Copy file name to clipboardExpand all lines: module/spring-boot-graphql-test/src/main/java/org/springframework/boot/graphql/test/autoconfigure/GraphQlTest.java
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,7 @@
46
46
* relevant to GraphQL tests, including the following:
47
47
* <ul>
48
48
* <li>{@code @Controller}
49
+
* <li>{@code @ControllerAdvice}
49
50
* <li>{@code RuntimeWiringConfigurer}
50
51
* <li>{@code @JacksonComponent}
51
52
* <li>{@code @JsonComponent} (deprecated)
@@ -122,10 +123,11 @@
122
123
* Determines if default filtering should be used with
123
124
* {@link SpringBootApplication @SpringBootApplication}. By default, only
124
125
* {@code @Controller} (when no explicit {@link #controllers() controllers} are
Copy file name to clipboardExpand all lines: module/spring-boot-graphql-test/src/main/java/org/springframework/boot/graphql/test/autoconfigure/GraphQlTypeExcludeFilter.java
Copy file name to clipboardExpand all lines: module/spring-boot-graphql-test/src/test/java/org/springframework/boot/graphql/test/autoconfigure/GraphQlTypeExcludeFilterTests.java
0 commit comments