Update ExpressionUrlAuthorizationConfigurer Error Message
Update error message
This commit is contained in:
parent
40208127e8
commit
b6800bdb4d
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue