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

Merge branch '5.8.x'

This commit is contained in:
Steve Riesenberg
2022-09-12 10:49:40 -05:00
2 changed files with 3 additions and 3 deletions
@@ -180,7 +180,7 @@ public final class SecurityMockMvcRequestPostProcessors {
/** /**
* Creates a {@link RequestPostProcessor} that can be used to ensure that the * Creates a {@link RequestPostProcessor} that can be used to ensure that the
* resulting request is ran with the user in the {@link TestSecurityContextHolder}. * resulting request is ran with the user in the {@link TestSecurityContextHolder}.
* @return the {@link RequestPostProcessor} to sue * @return the {@link RequestPostProcessor} to use
*/ */
public static RequestPostProcessor testSecurityContext() { public static RequestPostProcessor testSecurityContext() {
return new TestSecurityContextHolderPostProcessor(); return new TestSecurityContextHolderPostProcessor();
@@ -71,7 +71,7 @@ final class SecurityMockMvcConfigurer extends MockMvcConfigurerAdapter {
WebApplicationContext context) { WebApplicationContext context) {
String securityBeanId = BeanIds.SPRING_SECURITY_FILTER_CHAIN; String securityBeanId = BeanIds.SPRING_SECURITY_FILTER_CHAIN;
if (getSpringSecurityFilterChain() == null && context.containsBean(securityBeanId)) { if (getSpringSecurityFilterChain() == null && context.containsBean(securityBeanId)) {
setSpringSecurityFitlerChain(context.getBean(securityBeanId, Filter.class)); setSpringSecurityFilterChain(context.getBean(securityBeanId, Filter.class));
} }
Assert.state(getSpringSecurityFilterChain() != null, Assert.state(getSpringSecurityFilterChain() != null,
() -> "springSecurityFilterChain cannot be null. Ensure a Bean with the name " + securityBeanId () -> "springSecurityFilterChain cannot be null. Ensure a Bean with the name " + securityBeanId
@@ -81,7 +81,7 @@ final class SecurityMockMvcConfigurer extends MockMvcConfigurerAdapter {
return testSecurityContext(); return testSecurityContext();
} }
private void setSpringSecurityFitlerChain(Filter filter) { private void setSpringSecurityFilterChain(Filter filter) {
this.delegateFilter.setDelegate(filter); this.delegateFilter.setDelegate(filter);
} }