#138 Tests for WebSecurityExpressionHandler bean existing

This commit is contained in:
Rob Winch 2013-07-01 08:37:12 -05:00
parent 4d282cbe0d
commit d8ed429370
1 changed files with 21 additions and 0 deletions

View File

@ -33,6 +33,7 @@ import org.springframework.security.config.annotation.web.builders.WebSecurity
import org.springframework.security.web.FilterChainProxy
import org.springframework.security.web.SecurityFilterChain
import org.springframework.security.web.access.WebInvocationPrivilegeEvaluator;
import org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler;
import org.springframework.security.web.access.expression.WebSecurityExpressionHandler;
import org.springframework.security.web.util.AnyRequestMatcher
@ -214,4 +215,24 @@ class WebSecurityConfigurationTests extends BaseSpringSpec {
.expressionHandler(EH)
}
}
def "#138 webSecurityExpressionHandler defaults"() {
when:
loadConfig(WebSecurityExpressionHandlerDefaultsConfig)
then:
WebSecurityExpressionHandler wseh = context.getBean(WebSecurityExpressionHandler)
wseh instanceof DefaultWebSecurityExpressionHandler
}
@EnableWebSecurity
@Configuration
static class WebSecurityExpressionHandlerDefaultsConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeUrls()
.anyRequest().authenticated()
}
}
}