You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there is support for setting up a SecurityContext after @before by
using TestExecutionEvent.TEST_EXECUTION. The current implementation, however,
already creates the SecurityContext in @before and just does not set it yet.
This leads to issues like #6591. For the case of @WithUserDetails, the
creation of the SecurityContext already looks up a user from the repository.
If the user was inserted in @before, the user is not found despite using
TestExecutionEvent.TEST_EXECUTION. This commit changes the creation of the
SecurityContext to happen after @before if using
TestExecutionEvent.TEST_EXECUTION.
Closesgh-6591
Copy file name to clipboardExpand all lines: test/src/main/java/org/springframework/security/test/context/support/WithSecurityContextTestExecutionListener.java
Copy file name to clipboardExpand all lines: test/src/test/java/org/springframework/security/test/context/support/WithSecurityContextTestExecutionListenerTests.java
0 commit comments