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

MockServerWebExchange does not allow setting the ApplicationContext on the base class #34601

Closed
dsyer opened this issue Mar 14, 2025 · 0 comments
Assignees
Labels
in: test Issues in the test module type: enhancement A general enhancement
Milestone

Comments

@dsyer
Copy link
Member

dsyer commented Mar 14, 2025

MockServerWebExchange does not have an ApplicationContext and the constructor that accepts it in the base class isn't visible, so the only workaround is to create your own DefaultServerWebExchange and override getApplicationContext().

Spring Security requires the ApplicationContext, so they apparently have this workaround in their test code, but it would be useful to share it.

@rstoyanchev rstoyanchev self-assigned this Mar 14, 2025
@rstoyanchev rstoyanchev added in: test Issues in the test module type: enhancement A general enhancement labels Mar 14, 2025
@rstoyanchev rstoyanchev added this to the 6.2.5 milestone Mar 14, 2025
@rstoyanchev rstoyanchev changed the title MockServerWebExchange does not have an ApplicationContext MockServerWebExchange does not allow setting the ApplicationContext on the base class Mar 14, 2025
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

2 participants