It simply
* accepts as valid whatever is contained within the TestingAuthenticationToken.
The purpose of this implementation is to facilitate unit testing. This provider should never be enabled - * on a production system.
+ *+ * The purpose of this implementation is to facilitate unit testing. This provider should never be enabled + * on a production system. * * @author Ben Alex * @version $Id$ @@ -37,10 +38,6 @@ public class TestingAuthenticationProvider implements AuthenticationProvider { } public boolean supports(Class authentication) { - if (TestingAuthenticationToken.class.isAssignableFrom(authentication)) { - return true; - } else { - return false; - } + return TestingAuthenticationToken.class.isAssignableFrom(authentication); } } diff --git a/core/src/test/java/org/springframework/security/providers/TestingAuthenticationToken.java b/core/src/main/java/org/springframework/security/providers/TestingAuthenticationToken.java similarity index 86% rename from core/src/test/java/org/springframework/security/providers/TestingAuthenticationToken.java rename to core/src/main/java/org/springframework/security/providers/TestingAuthenticationToken.java index 4d4ae97206..40f5180545 100644 --- a/core/src/test/java/org/springframework/security/providers/TestingAuthenticationToken.java +++ b/core/src/main/java/org/springframework/security/providers/TestingAuthenticationToken.java @@ -20,8 +20,9 @@ import org.springframework.security.util.AuthorityUtils; /** - * An {@link org.springframework.security.Authentication} implementation that is designed for use whilst unit testing.
The - * corresponding authentication provider is {@link TestingAuthenticationProvider}.
+ * An {@link org.springframework.security.Authentication} implementation that is designed for use whilst unit testing. + *
+ * The corresponding authentication provider is {@link TestingAuthenticationProvider}.
*
* @author Ben Alex
* @version $Id$
@@ -36,15 +37,15 @@ public class TestingAuthenticationToken extends AbstractAuthenticationToken {
//~ Constructors ===================================================================================================
public TestingAuthenticationToken(Object principal, Object credentials) {
- super(null);
+ super(null);
this.principal = principal;
- this.credentials = credentials;
- }
+ this.credentials = credentials;
+ }
+
-
public TestingAuthenticationToken(Object principal, Object credentials, String... authorities) {
- this(principal, credentials, AuthorityUtils.stringArrayToAuthorityArray(authorities));
- }
+ this(principal, credentials, AuthorityUtils.stringArrayToAuthorityArray(authorities));
+ }
public TestingAuthenticationToken(Object principal, Object credentials, GrantedAuthority[] authorities) {
super(authorities);
diff --git a/portlet/pom.xml b/portlet/pom.xml
index 518f85412a..810a83cbfd 100644
--- a/portlet/pom.xml
+++ b/portlet/pom.xml
@@ -14,13 +14,6 @@