1
0
mirror of synced 2026-08-04 01:07:02 +00:00

Use message in all Assert

This ensures compatibility with Spring 5.

Fixes gh-4193
This commit is contained in:
Rob Winch
2017-01-30 19:58:24 -06:00
parent 4c79107e01
commit 9c03571bbb
25 changed files with 67 additions and 67 deletions
@@ -84,7 +84,7 @@ public class AnonymousAuthenticationFilter extends GenericFilterBean implements
@Override
public void afterPropertiesSet() {
Assert.hasLength(key);
Assert.hasLength(key, "key must have length");
Assert.notNull(principal, "Anonymous authentication principal must be set");
Assert.notNull(authorities, "Anonymous authorities must be set");
}
@@ -54,7 +54,7 @@ public class PreAuthenticatedGrantedAuthoritiesUserDetailsService implements
*/
public final UserDetails loadUserDetails(PreAuthenticatedAuthenticationToken token)
throws AuthenticationException {
Assert.notNull(token.getDetails());
Assert.notNull(token.getDetails(), "token.getDetails() cannot be null");
Assert.isInstanceOf(GrantedAuthoritiesContainer.class, token.getDetails());
Collection<? extends GrantedAuthority> authorities = ((GrantedAuthoritiesContainer) token
.getDetails()).getGrantedAuthorities();
@@ -48,8 +48,8 @@ public class SessionFixationProtectionEvent extends AbstractAuthenticationEvent
public SessionFixationProtectionEvent(Authentication authentication,
String oldSessionId, String newSessionId) {
super(authentication);
Assert.hasLength(oldSessionId);
Assert.hasLength(newSessionId);
Assert.hasLength(oldSessionId, "oldSessionId must have length");
Assert.hasLength(newSessionId, "newSessionId must have length");
this.oldSessionId = oldSessionId;
this.newSessionId = newSessionId;
}
@@ -68,8 +68,8 @@ public class RedirectUrlBuilder {
public String getUrl() {
StringBuilder sb = new StringBuilder();
Assert.notNull(scheme);
Assert.notNull(serverName);
Assert.notNull(scheme, "scheme cannot be null");
Assert.notNull(serverName, "serverName cannot be null");
sb.append(scheme).append("://").append(serverName);