1
0
mirror of synced 2026-08-05 01:36:56 +00:00

Fixes to match TestingAuthenticationToken changes

This commit is contained in:
Luke Taylor
2008-08-04 13:48:44 +00:00
parent b6d088e40d
commit d6918c88a7
3 changed files with 12 additions and 6 deletions
@@ -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);
@@ -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