2
0
Эх сурвалжийг харах

Import cleaning and suppression of deprecation warnings.

Luke Taylor 15 жил өмнө
parent
commit
695c8f4ad6

+ 3 - 13
core/src/test/java/org/springframework/security/access/hierarchicalroles/UserDetailsWrapperTests.java

@@ -1,22 +1,19 @@
 package org.springframework.security.access.hierarchicalroles;
 
-import java.util.List;
-
 import junit.framework.TestCase;
-
-import org.springframework.security.access.hierarchicalroles.RoleHierarchyImpl;
-import org.springframework.security.access.hierarchicalroles.UserDetailsWrapper;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.authority.AuthorityUtils;
 import org.springframework.security.core.userdetails.User;
 import org.springframework.security.core.userdetails.UserDetails;
 
+import java.util.*;
+
 /**
  * Tests for {@link UserDetailsWrapper}.
  *
  * @author Michael Mayr
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation"})
 public class UserDetailsWrapperTests extends TestCase {
 
     private List<GrantedAuthority> authorities = null;
@@ -25,13 +22,6 @@ public class UserDetailsWrapperTests extends TestCase {
     private UserDetailsWrapper userDetailsWrapper1 = null;
     private UserDetailsWrapper userDetailsWrapper2 = null;
 
-    public UserDetailsWrapperTests() {
-    }
-
-    public UserDetailsWrapperTests(String testCaseName) {
-        super(testCaseName);
-    }
-
     protected void setUp() throws Exception {
         RoleHierarchyImpl roleHierarchy = new RoleHierarchyImpl();
         roleHierarchy.setHierarchy("ROLE_A > ROLE_B");

+ 1 - 3
core/src/test/java/org/springframework/security/authentication/AuthenticationDetailsSourceImplTests.java

@@ -3,14 +3,12 @@ package org.springframework.security.authentication;
 import static org.junit.Assert.*;
 
 import org.junit.Test;
-import org.springframework.security.authentication.AuthenticationDetails;
-import org.springframework.security.authentication.AuthenticationDetailsSourceImpl;
-import org.springframework.security.authentication.TestingAuthenticationToken;
 
 /**
  *
  * @author Luke Taylor
  */
+@SuppressWarnings({"deprecation"})
 public class AuthenticationDetailsSourceImplTests {
 
     @Test

+ 4 - 12
core/src/test/java/org/springframework/security/core/userdetails/memory/InMemoryDaoTests.java

@@ -16,13 +16,9 @@
 package org.springframework.security.core.userdetails.memory;
 
 import junit.framework.TestCase;
-
 import org.springframework.security.core.userdetails.UsernameNotFoundException;
-import org.springframework.security.core.userdetails.memory.InMemoryDaoImpl;
-import org.springframework.security.core.userdetails.memory.UserMap;
-import org.springframework.security.core.userdetails.memory.UserMapEditor;
 
-import java.util.Properties;
+import java.util.*;
 
 
 /**
@@ -30,7 +26,7 @@ import java.util.Properties;
  *
  * @author Ben Alex
  */
-@SuppressWarnings("deprecation")
+@SuppressWarnings({"deprecation"})
 public class InMemoryDaoTests extends TestCase {
 
     //~ Methods ========================================================================================================
@@ -42,10 +38,6 @@ public class InMemoryDaoTests extends TestCase {
         return (UserMap) editor.getValue();
     }
 
-    public final void setUp() throws Exception {
-        super.setUp();
-    }
-
     public void testLookupFails() throws Exception {
         InMemoryDaoImpl dao = new InMemoryDaoImpl();
         dao.setUserMap(makeUserMap());
@@ -80,7 +72,7 @@ public class InMemoryDaoTests extends TestCase {
 
         try {
             dao.afterPropertiesSet();
-            fail("Shoudl have thrown IllegalArgumentException");
+            fail("Should have thrown IllegalArgumentException");
         } catch (IllegalArgumentException expected) {
             assertTrue(true);
         }
@@ -92,7 +84,7 @@ public class InMemoryDaoTests extends TestCase {
 
         try {
             dao.afterPropertiesSet();
-            fail("Shoudl have thrown IllegalArgumentException");
+            fail("Should have thrown IllegalArgumentException");
         } catch (IllegalArgumentException expected) {
             assertTrue(true);
         }

+ 0 - 3
core/src/test/java/org/springframework/security/core/userdetails/memory/UserMapEditorTests.java

@@ -16,10 +16,7 @@
 package org.springframework.security.core.userdetails.memory;
 
 import junit.framework.TestCase;
-
 import org.springframework.security.core.authority.AuthorityUtils;
-import org.springframework.security.core.userdetails.memory.UserMap;
-import org.springframework.security.core.userdetails.memory.UserMapEditor;
 
 
 /**