Merge branch '6.1.x'
Closes gh-13884
This commit is contained in:
+1
-1
@@ -67,7 +67,7 @@ public class HttpNamespaceWithMultipleInterceptorsTests {
|
||||
public HttpSession createAuthenticatedSession(String... roles) {
|
||||
MockHttpSession session = new MockHttpSession();
|
||||
SecurityContextHolder.getContext()
|
||||
.setAuthentication(new TestingAuthenticationToken("bob", "bobspassword", roles));
|
||||
.setAuthentication(new TestingAuthenticationToken("bob", "bobspassword", roles));
|
||||
session.setAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY,
|
||||
SecurityContextHolder.getContext());
|
||||
SecurityContextHolder.clearContext();
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ public class HttpPathParameterStrippingTests {
|
||||
public HttpSession createAuthenticatedSession(String... roles) {
|
||||
MockHttpSession session = new MockHttpSession();
|
||||
SecurityContextHolder.getContext()
|
||||
.setAuthentication(new TestingAuthenticationToken("bob", "bobspassword", roles));
|
||||
.setAuthentication(new TestingAuthenticationToken("bob", "bobspassword", roles));
|
||||
session.setAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY,
|
||||
SecurityContextHolder.getContext());
|
||||
SecurityContextHolder.clearContext();
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ public class PythonInterpreterBasedSecurityTests {
|
||||
@Test
|
||||
public void serviceMethod() {
|
||||
SecurityContextHolder.getContext()
|
||||
.setAuthentication(UsernamePasswordAuthenticationToken.unauthenticated("bob", "bobspassword"));
|
||||
.setAuthentication(UsernamePasswordAuthenticationToken.unauthenticated("bob", "bobspassword"));
|
||||
|
||||
// for (int i=0; i < 1000; i++) {
|
||||
this.service.someMethod();
|
||||
|
||||
+3
-2
@@ -128,8 +128,9 @@ public class FilterChainPerformanceTests {
|
||||
StopWatch sw = new StopWatch("Scaling with nAuthorities");
|
||||
for (int user = 0; user < N_AUTHORITIES / 10; user++) {
|
||||
int nAuthorities = (user != 0) ? user * 10 : 1;
|
||||
SecurityContextHolder.getContext().setAuthentication(UsernamePasswordAuthenticationToken
|
||||
.authenticated("bob", "bobspassword", createRoles(nAuthorities)));
|
||||
SecurityContextHolder.getContext()
|
||||
.setAuthentication(UsernamePasswordAuthenticationToken.authenticated("bob", "bobspassword",
|
||||
createRoles(nAuthorities)));
|
||||
this.session.setAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY,
|
||||
SecurityContextHolder.getContext());
|
||||
SecurityContextHolder.clearContext();
|
||||
|
||||
+3
-2
@@ -42,8 +42,9 @@ public class LdapServerBeanDefinitionParserTests {
|
||||
@Test
|
||||
public void apacheDirectoryServerIsStartedByDefault() {
|
||||
assertThatExceptionOfType(BeanDefinitionStoreException.class)
|
||||
.isThrownBy(() -> this.context = new ClassPathXmlApplicationContext("applicationContext-security.xml"))
|
||||
.havingRootCause().withMessageContaining("Embedded LDAP server is not provided");
|
||||
.isThrownBy(() -> this.context = new ClassPathXmlApplicationContext("applicationContext-security.xml"))
|
||||
.havingRootCause()
|
||||
.withMessageContaining("Embedded LDAP server is not provided");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user