SEC-411: fixed broken unit tests as a consequence of adding anoter constructor argument
This commit is contained in:
parent
220ba29fc6
commit
4c6d132ead
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue