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

Support ContextLoader config in @SpringJUnitConfig and @SpringJUnitWebConfig #31498

Closed
neckbosov opened this issue Oct 25, 2023 · 2 comments
Closed
Assignees
Labels
in: test Issues in the test module type: enhancement A general enhancement
Milestone

Comments

@neckbosov
Copy link

neckbosov commented Oct 25, 2023

Affects: 5.3.26

@SpringJUnitConfig and @SpringJUnitWebConfig alias all attributes of @ContextConfiguration except loader for some reason, which forces one to replace them with

@ExtendWith(SpringExtension.class)
@WebAppConfiguration
@ContextConfiguration(loader = ...)

I think it would be great to add a loader attribute to these annotations to make them fully compatible with @ContextConfiguration.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 25, 2023
@sbrannen sbrannen changed the title There is no way to specify context loader in tests through @SpringJUnitConfig and @SpringJUnitWebConfig There is no way to specify ContextLoader in tests via @SpringJUnitConfig or @SpringJUnitWebConfig Oct 25, 2023
@sbrannen sbrannen added in: test Issues in the test module type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 25, 2023
@sbrannen sbrannen self-assigned this Oct 25, 2023
@sbrannen
Copy link
Member

@SpringJUnitConfig and @SpringJUnitWebConfig wrap all parameters of @ContextConfiguration except loader for some reason

I believe that was merely an oversight on my part.

Thanks for bringing this to our attention! 👍

@sbrannen sbrannen added this to the 6.1.0-RC2 milestone Oct 25, 2023
@sbrannen sbrannen changed the title There is no way to specify ContextLoader in tests via @SpringJUnitConfig or @SpringJUnitWebConfig Support ContextLoader config in @SpringJUnitConfig and @SpringJUnitWebConfig Oct 25, 2023
@sbrannen
Copy link
Member

Since there are viable workarounds for Spring Framework 5.3.x and 6.0.x, I've incorporated these changes for the upcoming Spring Framework 6.1 RC2 in commit 6c4cbd2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants