Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestTypeExcludeFilter is not applied when using SpringApplication.from #35206

Closed
philwebb opened this issue Apr 29, 2023 · 0 comments
Closed
Assignees
Labels
type: bug A general bug
Milestone

Comments

@philwebb
Copy link
Member

Currently TestTypeExcludeFilter is plugged in using a ContextCustomizerFactory. This means that @TestConfiguration and @TestComponent beans are not filtered when using SpringApplication.from on the test classpath.

@philwebb philwebb self-assigned this Apr 29, 2023
@philwebb philwebb added the type: bug A general bug label Apr 29, 2023
@philwebb philwebb added this to the 3.1.0-RC2 milestone Apr 29, 2023
philwebb added a commit to philwebb/spring-boot that referenced this issue Apr 29, 2023
Add `ExcludeFilterApplicationContextInitializer` to register the
`TestTypeExcludeFilter` for regular applications.

Prior to this commit, the filter was only registered using the
`ExcludeFilterContextCustomizerFactory` which meant that test components
were filtered in tests but not when using `SpringApplication.from` with
a test classpath.

Fixes spring-projectsgh-35206
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

No branches or pull requests

1 participant