Преглед изворни кода

Fixes to match TestingAuthenticationToken changes

Luke Taylor пре 17 година
родитељ
комит
d6918c88a7

+ 8 - 2
portlet/pom.xml

@@ -8,14 +8,20 @@
     <artifactId>spring-security-portlet</artifactId>
     <name>Spring Security - Portlet support</name>
     <description>Spring Security - Support for JSR 168 Portlets</description>
-    <version>2.0.4-SNAPSHOT</version>
 
     <dependencies>
         <dependency>
             <groupId>org.springframework.security</groupId>
             <artifactId>spring-security-core</artifactId>
-            <version>2.0.4-SNAPSHOT</version>
+            <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-core</artifactId>
+            <version>${project.version}</version>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>                
         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>

+ 1 - 1
portlet/src/test/java/org/springframework/security/providers/portlet/PortletTestUtils.java

@@ -59,7 +59,7 @@ public class PortletTestUtils {
 
     public static void applyPortletRequestSecurity(MockPortletRequest request) {
 		request.setRemoteUser(TESTUSER);
-		request.setUserPrincipal(new TestingAuthenticationToken(TESTUSER, TESTCRED, null));
+		request.setUserPrincipal(new TestingAuthenticationToken(TESTUSER, TESTCRED));
 		request.addUserRole(PORTALROLE1);
 		request.addUserRole(PORTALROLE2);
 //		request.setAuthType(PortletRequest.FORM_AUTH);

+ 3 - 3
portlet/src/test/java/org/springframework/security/ui/portlet/PortletProcessingInterceptorTests.java

@@ -166,8 +166,8 @@ public class PortletProcessingInterceptorTests extends TestCase {
 		interceptor.setAuthenticationManager(new MockPortletAuthenticationManager());
 		interceptor.afterPropertiesSet();
 
-		UsernamePasswordAuthenticationToken testingToken = new UsernamePasswordAuthenticationToken("dummy", "dummy", null);
-		UsernamePasswordAuthenticationToken baselineToken = new UsernamePasswordAuthenticationToken("dummy", "dummy", null);
+		UsernamePasswordAuthenticationToken testingToken = new UsernamePasswordAuthenticationToken("dummy", "dummy");
+		UsernamePasswordAuthenticationToken baselineToken = new UsernamePasswordAuthenticationToken("dummy", "dummy");
 		SecurityContextHolder.getContext().setAuthentication(testingToken);
 
 		// Execute preHandlerAction phase and verify results
@@ -205,7 +205,7 @@ public class PortletProcessingInterceptorTests extends TestCase {
 		// Build mock request and response
 		MockActionRequest request = new MockActionRequest();
 		MockActionResponse response = new MockActionResponse();
-		request.setUserPrincipal(new TestingAuthenticationToken(PortletTestUtils.TESTUSER, PortletTestUtils.TESTCRED, null));
+		request.setUserPrincipal(new TestingAuthenticationToken(PortletTestUtils.TESTUSER, PortletTestUtils.TESTCRED));
 		request.setAuthType(PortletRequest.FORM_AUTH);
 
 		// Prepare and execute interceptor