Import cleaning and suppression of deprecation warnings.
This commit is contained in:
parent
bd84a2bfa1
commit
695c8f4ad6
|
@ -1,22 +1,19 @@
|
||||||
package org.springframework.security.access.hierarchicalroles;
|
package org.springframework.security.access.hierarchicalroles;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
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.GrantedAuthority;
|
||||||
import org.springframework.security.core.authority.AuthorityUtils;
|
import org.springframework.security.core.authority.AuthorityUtils;
|
||||||
import org.springframework.security.core.userdetails.User;
|
import org.springframework.security.core.userdetails.User;
|
||||||
import org.springframework.security.core.userdetails.UserDetails;
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link UserDetailsWrapper}.
|
* Tests for {@link UserDetailsWrapper}.
|
||||||
*
|
*
|
||||||
* @author Michael Mayr
|
* @author Michael Mayr
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings({"deprecation"})
|
||||||
public class UserDetailsWrapperTests extends TestCase {
|
public class UserDetailsWrapperTests extends TestCase {
|
||||||
|
|
||||||
private List<GrantedAuthority> authorities = null;
|
private List<GrantedAuthority> authorities = null;
|
||||||
|
@ -25,13 +22,6 @@ public class UserDetailsWrapperTests extends TestCase {
|
||||||
private UserDetailsWrapper userDetailsWrapper1 = null;
|
private UserDetailsWrapper userDetailsWrapper1 = null;
|
||||||
private UserDetailsWrapper userDetailsWrapper2 = null;
|
private UserDetailsWrapper userDetailsWrapper2 = null;
|
||||||
|
|
||||||
public UserDetailsWrapperTests() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public UserDetailsWrapperTests(String testCaseName) {
|
|
||||||
super(testCaseName);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
RoleHierarchyImpl roleHierarchy = new RoleHierarchyImpl();
|
RoleHierarchyImpl roleHierarchy = new RoleHierarchyImpl();
|
||||||
roleHierarchy.setHierarchy("ROLE_A > ROLE_B");
|
roleHierarchy.setHierarchy("ROLE_A > ROLE_B");
|
||||||
|
|
|
@ -3,14 +3,12 @@ package org.springframework.security.authentication;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
import org.junit.Test;
|
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
|
* @author Luke Taylor
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings({"deprecation"})
|
||||||
public class AuthenticationDetailsSourceImplTests {
|
public class AuthenticationDetailsSourceImplTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -16,13 +16,9 @@
|
||||||
package org.springframework.security.core.userdetails.memory;
|
package org.springframework.security.core.userdetails.memory;
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
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
|
* @author Ben Alex
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings({"deprecation"})
|
||||||
public class InMemoryDaoTests extends TestCase {
|
public class InMemoryDaoTests extends TestCase {
|
||||||
|
|
||||||
//~ Methods ========================================================================================================
|
//~ Methods ========================================================================================================
|
||||||
|
@ -42,10 +38,6 @@ public class InMemoryDaoTests extends TestCase {
|
||||||
return (UserMap) editor.getValue();
|
return (UserMap) editor.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testLookupFails() throws Exception {
|
public void testLookupFails() throws Exception {
|
||||||
InMemoryDaoImpl dao = new InMemoryDaoImpl();
|
InMemoryDaoImpl dao = new InMemoryDaoImpl();
|
||||||
dao.setUserMap(makeUserMap());
|
dao.setUserMap(makeUserMap());
|
||||||
|
@ -80,7 +72,7 @@ public class InMemoryDaoTests extends TestCase {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
dao.afterPropertiesSet();
|
dao.afterPropertiesSet();
|
||||||
fail("Shoudl have thrown IllegalArgumentException");
|
fail("Should have thrown IllegalArgumentException");
|
||||||
} catch (IllegalArgumentException expected) {
|
} catch (IllegalArgumentException expected) {
|
||||||
assertTrue(true);
|
assertTrue(true);
|
||||||
}
|
}
|
||||||
|
@ -92,7 +84,7 @@ public class InMemoryDaoTests extends TestCase {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
dao.afterPropertiesSet();
|
dao.afterPropertiesSet();
|
||||||
fail("Shoudl have thrown IllegalArgumentException");
|
fail("Should have thrown IllegalArgumentException");
|
||||||
} catch (IllegalArgumentException expected) {
|
} catch (IllegalArgumentException expected) {
|
||||||
assertTrue(true);
|
assertTrue(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,10 +16,7 @@
|
||||||
package org.springframework.security.core.userdetails.memory;
|
package org.springframework.security.core.userdetails.memory;
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
import org.springframework.security.core.authority.AuthorityUtils;
|
import org.springframework.security.core.authority.AuthorityUtils;
|
||||||
import org.springframework.security.core.userdetails.memory.UserMap;
|
|
||||||
import org.springframework.security.core.userdetails.memory.UserMapEditor;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue