1
0
mirror of synced 2026-05-22 21:33:16 +00:00

Merge branch '6.1.x'

Closes gh-13884
This commit is contained in:
Marcus Da Coregio
2023-09-29 11:47:38 -03:00
1194 changed files with 11467 additions and 9087 deletions
@@ -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();
@@ -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();
@@ -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();
@@ -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();
@@ -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");
}
}