Skip to content

@GraphQlTest does not include @ControllerAdvice#49660

Merged
snicoll merged 2 commits intospring-projects:3.5.xfrom
ljrmorgan:graphql_test_should_load_controller_advice
Mar 20, 2026
Merged

@GraphQlTest does not include @ControllerAdvice#49660
snicoll merged 2 commits intospring-projects:3.5.xfrom
ljrmorgan:graphql_test_should_load_controller_advice

Conversation

@ljrmorgan
Copy link
Copy Markdown
Contributor

GraphQL slice tests should load @ControllerAdvice beans, since Spring GraphQL will load @GraphQlExceptionHandlers declared in @ControllerAdvice beans.

This aligns @GraphQlTest with @WebMvcTest, which does load @ControllerAdvice beans.

Closes #49659

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 19, 2026
@wilkinsona wilkinsona changed the title @GraphQlTest should load @ControllerAdvice @GraphQlTest does not include @ControllerAdvice Mar 19, 2026
@snicoll snicoll changed the title @GraphQlTest does not include @ControllerAdvice '@GraphQlTest' does not include '@ControllerAdvice' Mar 19, 2026
@wilkinsona wilkinsona changed the title '@GraphQlTest' does not include '@ControllerAdvice' @GraphQlTest does not include @ControllerAdvice Mar 19, 2026
@wilkinsona wilkinsona added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 19, 2026
@wilkinsona wilkinsona added this to the 3.5.x milestone Mar 19, 2026
@snicoll snicoll self-assigned this Mar 20, 2026
@snicoll snicoll modified the milestones: 3.5.x, 3.5.13 Mar 20, 2026
@snicoll snicoll changed the base branch from main to 3.5.x March 20, 2026 08:57
ljrmorgan and others added 2 commits March 20, 2026 10:02
This commit updates the GraphQL slice tests to also consider
`@ControllerAdvice`-annotated beans, since Spring GraphQL loads
`@GraphQlExceptionHandler`s declared in `@ControllerAdvice` beans.

This also aligns `@GraphQlTest` with `@WebMvcTest`.

See spring-projectsgh-49660

Signed-off-by: Louis Morgan <ljrmorgan@gmail.com>
@snicoll snicoll force-pushed the graphql_test_should_load_controller_advice branch from b4eec55 to af03b3b Compare March 20, 2026 09:07
@snicoll snicoll merged commit 8c605cc into spring-projects:3.5.x Mar 20, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GraphQL slice tests should load '@ControllerAdvice' beans

4 participants