Fix flaky test in SpringSecurityPasswordValidationCallbackHandlerTest and SpringDigestPasswordValidationCallbackHandlerTest
This commit is contained in:
@@ -51,7 +51,9 @@ public class SpringSecurityPasswordValidationCallbackHandlerTest {
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
|
||||
// add clearContext() at the beginning of each method in case {@code SecurityContextHolder} isn't clean
|
||||
SecurityContextHolder.clearContext();
|
||||
|
||||
callbackHandler = new SpringSecurityPasswordValidationCallbackHandler();
|
||||
|
||||
grantedAuthority = new SimpleGrantedAuthority("ROLE_1");
|
||||
|
||||
@@ -46,9 +46,11 @@ public class SpringDigestPasswordValidationCallbackHandlerTest {
|
||||
private String password;
|
||||
|
||||
private PasswordValidationCallback callback;
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
// add clearContext() at the beginning of each method in case {@code SecurityContextHolder} isn't clean
|
||||
SecurityContextHolder.clearContext();
|
||||
|
||||
callbackHandler = new SpringDigestPasswordValidationCallbackHandler();
|
||||
userDetailsService = createMock(UserDetailsService.class);
|
||||
|
||||
Reference in New Issue
Block a user