Quellcode durchsuchen

Removed locale-specific message value assertions which will cause tests to fail if run with a different standard locale for which we have a message file (e.g. Chinese).

Luke Taylor vor 18 Jahren
Ursprung
Commit
0a214e4930

+ 0 - 11
core/src/test/java/org/springframework/security/providers/anonymous/AnonymousAuthenticationProviderTests.java

@@ -35,7 +35,6 @@ public class AnonymousAuthenticationProviderTests extends TestCase {
     //~ Constructors ===================================================================================================
 
     public AnonymousAuthenticationProviderTests() {
-        super();
     }
 
     public AnonymousAuthenticationProviderTests(String arg0) {
@@ -44,14 +43,6 @@ public class AnonymousAuthenticationProviderTests extends TestCase {
 
     //~ Methods ========================================================================================================
 
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(AnonymousAuthenticationProviderTests.class);
-    }
-
-    public final void setUp() throws Exception {
-        super.setUp();
-    }
-
     public void testDetectsAnInvalidKey() throws Exception {
         AnonymousAuthenticationProvider aap = new AnonymousAuthenticationProvider();
         aap.setKey("qwerty");
@@ -63,8 +54,6 @@ public class AnonymousAuthenticationProviderTests extends TestCase {
             Authentication result = aap.authenticate(token);
             fail("Should have thrown BadCredentialsException");
         } catch (BadCredentialsException expected) {
-            assertEquals("The presented AnonymousAuthenticationToken does not contain the expected key",
-                expected.getMessage());
         }
     }
 

+ 0 - 7
core/src/test/java/org/springframework/security/providers/cas/CasAuthenticationProviderTests.java

@@ -48,7 +48,6 @@ public class CasAuthenticationProviderTests extends TestCase {
     //~ Constructors ===================================================================================================
 
     public CasAuthenticationProviderTests() {
-        super();
     }
 
     public CasAuthenticationProviderTests(String arg0) {
@@ -57,10 +56,6 @@ public class CasAuthenticationProviderTests extends TestCase {
 
     //~ Methods ========================================================================================================
 
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(CasAuthenticationProviderTests.class);
-    }
-
     private UserDetails makeUserDetails() {
         return new User("user", "password", true, true, true, true,
             new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_ONE"), new GrantedAuthorityImpl("ROLE_TWO")});
@@ -170,7 +165,6 @@ public class CasAuthenticationProviderTests extends TestCase {
             Authentication result = cap.authenticate(token);
             fail("Should have thrown BadCredentialsException");
         } catch (BadCredentialsException expected) {
-            assertEquals("Failed to provide a CAS service ticket to validate", expected.getMessage());
         }
     }
 
@@ -192,7 +186,6 @@ public class CasAuthenticationProviderTests extends TestCase {
             Authentication result = cap.authenticate(token);
             fail("Should have thrown BadCredentialsException");
         } catch (BadCredentialsException expected) {
-            assertEquals("The presented CasAuthenticationToken does not contain the expected key", expected.getMessage());
         }
     }
 

+ 0 - 11
core/src/test/java/org/springframework/security/providers/rememberme/RememberMeAuthenticationProviderTests.java

@@ -35,7 +35,6 @@ public class RememberMeAuthenticationProviderTests extends TestCase {
     //~ Constructors ===================================================================================================
 
     public RememberMeAuthenticationProviderTests() {
-        super();
     }
 
     public RememberMeAuthenticationProviderTests(String arg0) {
@@ -44,14 +43,6 @@ public class RememberMeAuthenticationProviderTests extends TestCase {
 
     //~ Methods ========================================================================================================
 
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(RememberMeAuthenticationProviderTests.class);
-    }
-
-    public final void setUp() throws Exception {
-        super.setUp();
-    }
-
     public void testDetectsAnInvalidKey() throws Exception {
         RememberMeAuthenticationProvider aap = new RememberMeAuthenticationProvider();
         aap.setKey("qwerty");
@@ -63,8 +54,6 @@ public class RememberMeAuthenticationProviderTests extends TestCase {
             Authentication result = aap.authenticate(token);
             fail("Should have thrown BadCredentialsException");
         } catch (BadCredentialsException expected) {
-            assertEquals("The presented RememberMeAuthenticationToken does not contain the expected key",
-                expected.getMessage());
         }
     }