From 4c6d132ead6a9d8bffa79286185a61e78caf9f5b Mon Sep 17 00:00:00 2001 From: Vishal Puri Date: Thu, 24 May 2007 23:35:01 +0000 Subject: [PATCH] SEC-411: fixed broken unit tests as a consequence of adding anoter constructor argument --- .../SecurityContextHolderAwareRequestWrapperTests.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/test/java/org/acegisecurity/wrapper/SecurityContextHolderAwareRequestWrapperTests.java b/core/src/test/java/org/acegisecurity/wrapper/SecurityContextHolderAwareRequestWrapperTests.java index 85ba4b06f6..62f57d760e 100644 --- a/core/src/test/java/org/acegisecurity/wrapper/SecurityContextHolderAwareRequestWrapperTests.java +++ b/core/src/test/java/org/acegisecurity/wrapper/SecurityContextHolderAwareRequestWrapperTests.java @@ -26,6 +26,8 @@ import org.acegisecurity.context.SecurityContextHolder; import org.acegisecurity.providers.TestingAuthenticationToken; import org.acegisecurity.userdetails.User; +import org.acegisecurity.util.PortResolver; +import org.acegisecurity.util.PortResolverImpl; import org.acegisecurity.wrapper.SecurityContextHolderAwareRequestWrapper; @@ -68,7 +70,7 @@ public class SecurityContextHolderAwareRequestWrapperTests extends TestCase { MockHttpServletRequest request = new MockHttpServletRequest(); request.setRequestURI("/"); - SecurityContextHolderAwareRequestWrapper wrapper = new SecurityContextHolderAwareRequestWrapper(request); + SecurityContextHolderAwareRequestWrapper wrapper = new SecurityContextHolderAwareRequestWrapper(request, new PortResolverImpl()); assertEquals("marissa", wrapper.getRemoteUser()); assertTrue(wrapper.isUserInRole("ROLE_FOO")); @@ -88,7 +90,7 @@ public class SecurityContextHolderAwareRequestWrapperTests extends TestCase { MockHttpServletRequest request = new MockHttpServletRequest(); request.setRequestURI("/"); - SecurityContextHolderAwareRequestWrapper wrapper = new SecurityContextHolderAwareRequestWrapper(request); + SecurityContextHolderAwareRequestWrapper wrapper = new SecurityContextHolderAwareRequestWrapper(request, new PortResolverImpl()); assertEquals("marissaAsUserDetails", wrapper.getRemoteUser()); assertFalse(wrapper.isUserInRole("ROLE_FOO")); @@ -106,7 +108,7 @@ public class SecurityContextHolderAwareRequestWrapperTests extends TestCase { MockHttpServletRequest request = new MockHttpServletRequest(); request.setRequestURI("/"); - SecurityContextHolderAwareRequestWrapper wrapper = new SecurityContextHolderAwareRequestWrapper(request); + SecurityContextHolderAwareRequestWrapper wrapper = new SecurityContextHolderAwareRequestWrapper(request,new PortResolverImpl()); assertNull(wrapper.getRemoteUser()); assertFalse(wrapper.isUserInRole("ROLE_ANY")); assertNull(wrapper.getUserPrincipal()); @@ -122,7 +124,7 @@ public class SecurityContextHolderAwareRequestWrapperTests extends TestCase { MockHttpServletRequest request = new MockHttpServletRequest(); request.setRequestURI("/"); - SecurityContextHolderAwareRequestWrapper wrapper = new SecurityContextHolderAwareRequestWrapper(request); + SecurityContextHolderAwareRequestWrapper wrapper = new SecurityContextHolderAwareRequestWrapper(request, new PortResolverImpl()); assertNull(wrapper.getRemoteUser()); assertFalse(wrapper.isUserInRole("ROLE_HELLO")); // principal is null, so reject