Update to Spring 4 Build Snapshot

- IdGenerator package change
- Generics added to CollectionUtils.arrayToList()
This commit is contained in:
Gary Russell
2013-11-26 09:28:41 -05:00
parent 48a005ec2a
commit 6fd8d1dba7
10 changed files with 27 additions and 87 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,10 +26,10 @@ import org.springframework.util.CollectionUtils;
/**
* @author Jonas Partner
* @author Oleg Zhurakousky
* @author Gary Russell
*/
public class SecurityTestUtils {
@SuppressWarnings("unchecked")
public static SecurityContext createContext(String username, String password, String... roles) {
SecurityContextImpl ctxImpl = new SecurityContextImpl();
UsernamePasswordAuthenticationToken authToken;
@@ -38,7 +38,8 @@ public class SecurityTestUtils {
for (int i = 0; i < roles.length; i++) {
authorities[i] = new SimpleGrantedAuthority(roles[i]);
}
authToken = new UsernamePasswordAuthenticationToken(username, password, CollectionUtils.arrayToList(authorities));
authToken = new UsernamePasswordAuthenticationToken(username, password,
CollectionUtils.<GrantedAuthority> arrayToList(authorities));
}
else {
authToken = new UsernamePasswordAuthenticationToken(username, password);