Cleanup explicit type arguments
This commit is contained in:
@@ -53,7 +53,7 @@ public class DelegatingAccessDeniedHandlerTests {
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
handlers = new LinkedHashMap<Class<? extends AccessDeniedException>, AccessDeniedHandler>();
|
||||
handlers = new LinkedHashMap<>();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ExpressionBasedFilterInvocationSecurityMetadataSourceTests {
|
||||
@Test
|
||||
public void expectedAttributeIsReturned() {
|
||||
final String expression = "hasRole('X')";
|
||||
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>>();
|
||||
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<>();
|
||||
requestMap.put(AnyRequestMatcher.INSTANCE, SecurityConfig.createList(expression));
|
||||
ExpressionBasedFilterInvocationSecurityMetadataSource mds = new ExpressionBasedFilterInvocationSecurityMetadataSource(
|
||||
requestMap, new DefaultWebSecurityExpressionHandler());
|
||||
@@ -52,7 +52,7 @@ public class ExpressionBasedFilterInvocationSecurityMetadataSourceTests {
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void invalidExpressionIsRejected() throws Exception {
|
||||
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>>();
|
||||
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<>();
|
||||
requestMap.put(AnyRequestMatcher.INSTANCE,
|
||||
SecurityConfig.createList("hasRole('X'"));
|
||||
ExpressionBasedFilterInvocationSecurityMetadataSource mds = new ExpressionBasedFilterInvocationSecurityMetadataSource(
|
||||
|
||||
@@ -46,7 +46,7 @@ public class DefaultFilterInvocationSecurityMetadataSourceTests {
|
||||
// ~ Methods
|
||||
// ========================================================================================================
|
||||
private void createFids(String pattern, String method) {
|
||||
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>>();
|
||||
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<>();
|
||||
requestMap.put(new AntPathRequestMatcher(pattern, method), this.def);
|
||||
this.fids = new DefaultFilterInvocationSecurityMetadataSource(requestMap);
|
||||
}
|
||||
@@ -134,7 +134,7 @@ public class DefaultFilterInvocationSecurityMetadataSourceTests {
|
||||
// SEC-1236
|
||||
@Test
|
||||
public void mixingPatternsWithAndWithoutHttpMethodsIsSupported() throws Exception {
|
||||
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>>();
|
||||
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<>();
|
||||
Collection<ConfigAttribute> userAttrs = SecurityConfig.createList("A");
|
||||
|
||||
requestMap.put(new AntPathRequestMatcher("/user/**", null), userAttrs);
|
||||
|
||||
@@ -69,7 +69,7 @@ public class DelegatingAuthenticationFailureHandlerTests {
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
handlers = new LinkedHashMap<Class<? extends AuthenticationException>, AuthenticationFailureHandler>();
|
||||
handlers = new LinkedHashMap<>();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -154,7 +154,7 @@ public class J2eeBasedPreAuthenticatedWebAuthenticationDetailsSourceTests {
|
||||
|
||||
private MappableAttributesRetriever getMappableRolesRetriever(String[] mappedRoles) {
|
||||
SimpleMappableAttributesRetriever result = new SimpleMappableAttributesRetriever();
|
||||
result.setMappableAttributes(new HashSet<String>(Arrays.asList(mappedRoles)));
|
||||
result.setMappableAttributes(new HashSet<>(Arrays.asList(mappedRoles)));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ public class CsrfRequestDataValueProcessorTests {
|
||||
public void createGetExtraHiddenFieldsHasCsrfToken() {
|
||||
CsrfToken token = new DefaultCsrfToken("1", "a", "b");
|
||||
this.exchange.getAttributes().put(DEFAULT_CSRF_ATTR_NAME, token);
|
||||
Map<String, String> expected = new HashMap<String, String>();
|
||||
Map<String, String> expected = new HashMap<>();
|
||||
expected.put(token.getParameterName(), token.getToken());
|
||||
|
||||
CsrfRequestDataValueProcessor processor = new CsrfRequestDataValueProcessor();
|
||||
|
||||
Reference in New Issue
Block a user