8000 Adds option to set Principal in MockServerWebExchange by blake-bauman · Pull Request #34789 · spring-projects/spring-framework · GitHub
[go: up one dir, main page]

Skip to content

Adds option to set Principal in MockServerWebExchange#34789

Closed
blake-bauman wants to merge 1 commit intospring-projects:mainfrom
blake-bauman:mock-server-web-exchange-mock-principal
Closed

Adds option to set Principal in MockServerWebExchange#34789
blake-bauman wants to merge 1 commit intospring-projects:mainfrom
blake-bauman:mock-server-web-exchange-mock-principal

Conversation

@blake-bauman
Copy link
Contributor

Add a Principal for MockServerWebExchange.Builder to allow for a mock Principal object to be used with unit tests.

Add a Principal for MockServerWebExchange.Builder to allow for
a mock Principal object to be used with unit tests

Signed-off-by: blake_bauman <blake_bauman@apple.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 21, 2025
@blake-bauman
Copy link
Contributor Author

Use case: If the class you're testing makes a call to exchange.getPrincipal() the current MockServerWebExchange will only ever return Mono.empty().

@rstoyanchev rstoyanchev self-assigned this Apr 22, 2025
@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Apr 22, 2025
@rstoyanchev rstoyanchev added this to the 6.2.7 milestone Apr 22, 2025
Copy link
Contributor
@rstoyanchev rstoyanchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We made a similar change in 6.2.5 to allow setting the ApplicationContext. We can add this as well.

@rstoyanchev rstoyanchev changed the title Adds option for Principal in MockServerWebExchange Adds option to set Principal in MockServerWebExchange Apr 22, 2025
rstoyanchev pushed a commit that referenced this pull request Apr 25, 2025
See gh-34789

Signed-off-by: blake_bauman <blake_bauman@apple.com>
@sbrannen sbrannen added the in: test Issues in the test module label May 15, 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 in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

0