mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-31 17:22:13 +00:00
Merge branch '5.8.x'
This commit is contained in:
commit
306a3bc20a
@ -180,7 +180,7 @@ public final class SecurityMockMvcRequestPostProcessors {
|
||||
/**
|
||||
* Creates a {@link RequestPostProcessor} that can be used to ensure that the
|
||||
* 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() {
|
||||
return new TestSecurityContextHolderPostProcessor();
|
||||
|
@ -71,7 +71,7 @@ final class SecurityMockMvcConfigurer extends MockMvcConfigurerAdapter {
|
||||
WebApplicationContext context) {
|
||||
String securityBeanId = BeanIds.SPRING_SECURITY_FILTER_CHAIN;
|
||||
if (getSpringSecurityFilterChain() == null && context.containsBean(securityBeanId)) {
|
||||
setSpringSecurityFitlerChain(context.getBean(securityBeanId, Filter.class));
|
||||
setSpringSecurityFilterChain(context.getBean(securityBeanId, Filter.class));
|
||||
}
|
||||
Assert.state(getSpringSecurityFilterChain() != null,
|
||||
() -> "springSecurityFilterChain cannot be null. Ensure a Bean with the name " + securityBeanId
|
||||
@ -81,7 +81,7 @@ final class SecurityMockMvcConfigurer extends MockMvcConfigurerAdapter {
|
||||
return testSecurityContext();
|
||||
}
|
||||
|
||||
private void setSpringSecurityFitlerChain(Filter filter) {
|
||||
private void setSpringSecurityFilterChain(Filter filter) {
|
||||
this.delegateFilter.setDelegate(filter);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user