Update ExpressionUrlAuthorizationConfigurer Error Message

Update error message
This commit is contained in:
Matthias Merdes 2016-04-14 22:33:48 +02:00 committed by Rob Winch
parent 40208127e8
commit b6800bdb4d
2 changed files with 3 additions and 3 deletions

View File

@ -174,7 +174,7 @@ public final class ExpressionUrlAuthorizationConfigurer<H extends HttpSecurityBu
.createRequestMap(); .createRequestMap();
if (requestMap.isEmpty()) { if (requestMap.isEmpty()) {
throw new IllegalStateException( throw new IllegalStateException(
"At least one mapping is required (i.e. authorizeRequests().anyRequest.authenticated())"); "At least one mapping is required (i.e. authorizeRequests().anyRequest().authenticated())");
} }
return new ExpressionBasedFilterInvocationSecurityMetadataSource(requestMap, return new ExpressionBasedFilterInvocationSecurityMetadataSource(requestMap,
getExpressionHandler(http)); getExpressionHandler(http));
@ -393,4 +393,4 @@ public final class ExpressionUrlAuthorizationConfigurer<H extends HttpSecurityBu
return ExpressionUrlAuthorizationConfigurer.this.REGISTRY; return ExpressionUrlAuthorizationConfigurer.this.REGISTRY;
} }
} }
} }

View File

@ -97,7 +97,7 @@ public class ExpressionUrlAuthorizationConfigurerTests extends BaseSpringSpec {
loadConfig(NoRequestsConfig) loadConfig(NoRequestsConfig)
then: "A meaningful exception is thrown" then: "A meaningful exception is thrown"
BeanCreationException success = thrown() BeanCreationException success = thrown()
success.message.contains "At least one mapping is required (i.e. authorizeRequests().anyRequest.authenticated())" success.message.contains "At least one mapping is required (i.e. authorizeRequests().anyRequest().authenticated())"
} }
@EnableWebSecurity @EnableWebSecurity