Use message in all Assert
This ensures compatibility with Spring 5. Fixes gh-4193
This commit is contained in:
+1
-1
@@ -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");
|
||||
}
|
||||
|
||||
+1
-1
@@ -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();
|
||||
|
||||
+2
-2
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user