1
0
mirror of synced 2026-08-03 00:37:03 +00:00

Use diamond type

This commit is contained in:
Johnny Lim
2017-11-20 02:25:30 +09:00
committed by Rob Winch
parent cfe40358bd
commit 57353d18e5
221 changed files with 423 additions and 428 deletions
@@ -56,7 +56,7 @@ import org.springframework.util.Assert;
*/
public final class TestSecurityContextHolder {
private static final ThreadLocal<SecurityContext> contextHolder = new ThreadLocal<SecurityContext>();
private static final ThreadLocal<SecurityContext> contextHolder = new ThreadLocal<>();
/**
* Clears the {@link SecurityContext} from {@link TestSecurityContextHolder} and
@@ -46,7 +46,7 @@ final class WithMockUserSecurityContextFactory implements
+ " cannot have null username on both username and value properites");
}
List<GrantedAuthority> grantedAuthorities = new ArrayList<GrantedAuthority>();
List<GrantedAuthority> grantedAuthorities = new ArrayList<>();
for (String authority : withUser.authorities()) {
grantedAuthorities.add(new SimpleGrantedAuthority(authority));
}
@@ -71,4 +71,4 @@ final class WithMockUserSecurityContextFactory implements
context.setAuthentication(authentication);
return context;
}
}
}
@@ -796,7 +796,7 @@ public final class SecurityMockMvcRequestPostProcessors {
* @return the UserRequestPostProcessor for further customizations
*/
public UserRequestPostProcessor roles(String... roles) {
List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>(
List<GrantedAuthority> authorities = new ArrayList<>(
roles.length);
for (String role : roles) {
if (role.startsWith(ROLE_PREFIX)) {
@@ -213,7 +213,7 @@ public final class SecurityMockMvcResultMatchers {
* @return the {@link AuthenticatedMatcher} for further customization
*/
public AuthenticatedMatcher withRoles(String... roles) {
Collection<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
Collection<GrantedAuthority> authorities = new ArrayList<>();
for (String role : roles) {
authorities.add(new SimpleGrantedAuthority("ROLE_" + role));
}
@@ -251,4 +251,4 @@ public final class SecurityMockMvcResultMatchers {
private SecurityMockMvcResultMatchers() {
}
}
}