Skip to content

Use existing token repository if present#19001

Open
indy5858 wants to merge 1 commit intospring-projects:mainfrom
indy5858:main
Open

Use existing token repository if present#19001
indy5858 wants to merge 1 commit intospring-projects:mainfrom
indy5858:main

Conversation

@indy5858
Copy link
Copy Markdown

Hi, this PR prevents overwriting the repository set in production code. Instead it only wrap existing repository.

In this way, we avoid communicating tests; otherwise the csrf cookie is not returned in the GET request, once a test has run before that had a call to with(csrf()) to mock the CSRF token.

I know that the tests are far from optimal with using a separate test class.
If there's a better way to make the test setup, please let me know

Closes #17082

do not overwrite repository set in production code;
instead only wrap existing repository

Closes spring-projectsgh-17082

Signed-off-by: Andre Kappes <[email protected]>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MockMvc still does not work in combination with a CookieCsrfTokenRepository

2 participants