diff --git a/spring-integration-security/src/test/java/org/springframework/integration/security/SecurityTestUtils.java b/spring-integration-security/src/test/java/org/springframework/integration/security/SecurityTestUtils.java index 04d9d22af4..b7bfd4fb78 100644 --- a/spring-integration-security/src/test/java/org/springframework/integration/security/SecurityTestUtils.java +++ b/spring-integration-security/src/test/java/org/springframework/integration/security/SecurityTestUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2011 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. @@ -18,7 +18,7 @@ package org.springframework.integration.security; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.GrantedAuthorityImpl; +import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextImpl; import org.springframework.util.CollectionUtils; @@ -36,7 +36,7 @@ public class SecurityTestUtils { if (roles != null && roles.length > 0) { GrantedAuthority[] authorities = new GrantedAuthority[roles.length]; for (int i = 0; i < roles.length; i++) { - authorities[i] = new GrantedAuthorityImpl(roles[i]); + authorities[i] = new SimpleGrantedAuthority(roles[i]); } authToken = new UsernamePasswordAuthenticationToken(username, password, CollectionUtils.arrayToList(authorities)); } diff --git a/spring-integration-security/src/test/java/org/springframework/integration/security/channel/ChannelSecurityInterceptorTests.java b/spring-integration-security/src/test/java/org/springframework/integration/security/channel/ChannelSecurityInterceptorTests.java index 31f4665911..4c5a9e2600 100644 --- a/spring-integration-security/src/test/java/org/springframework/integration/security/channel/ChannelSecurityInterceptorTests.java +++ b/spring-integration-security/src/test/java/org/springframework/integration/security/channel/ChannelSecurityInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2011 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. @@ -82,9 +82,8 @@ public class ChannelSecurityInterceptorTests { ChannelSecurityMetadataSource securityMetadataSource = new ChannelSecurityMetadataSource(); securityMetadataSource.addPatternMapping(Pattern.compile("secured.*"), new DefaultChannelAccessPolicy(role, null)); ChannelSecurityInterceptor interceptor = new ChannelSecurityInterceptor(securityMetadataSource); - AffirmativeBased accessDecisionManager = new AffirmativeBased(); - - accessDecisionManager.setDecisionVoters(Collections.singletonList((AccessDecisionVoter)new RoleVoter())); + @SuppressWarnings("rawtypes") + AffirmativeBased accessDecisionManager = new AffirmativeBased(Collections.singletonList(new RoleVoter())); accessDecisionManager.afterPropertiesSet(); interceptor.setAccessDecisionManager(accessDecisionManager); interceptor.setAuthenticationManager(new MockAuthenticationManager(true));