1
0
mirror of synced 2026-08-23 18:47:07 +00:00

Make MockSecurityContextHolderStrategy Thread-safe

Closes gh-19547

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
This commit is contained in:
Josh Cummings
2026-08-19 16:54:12 -06:00
parent 6401fde9f2
commit d7ea83017a
@@ -25,12 +25,12 @@ public class MockSecurityContextHolderStrategy implements SecurityContextHolderS
private SecurityContext context;
@Override
public void clearContext() {
public synchronized void clearContext() {
this.context = null;
}
@Override
public SecurityContext getContext() {
public synchronized SecurityContext getContext() {
if (this.context == null) {
this.context = createEmptyContext();
}
@@ -38,7 +38,7 @@ public class MockSecurityContextHolderStrategy implements SecurityContextHolderS
}
@Override
public void setContext(SecurityContext context) {
public synchronized void setContext(SecurityContext context) {
this.context = context;
}