@Test(expected = PreAuthenticatedCredentialsNotFoundException.class) public void testGetAttributeNotInContext() { final RequestAttributePreAuthenticatedProcessingFilter sut = new RequestAttributePreAuthenticatedProcessingFilter(); final HttpServletRequest request = context.mock(HttpServletRequest.class); context.checking(new Expectations() { { oneOf(request).getAttribute(PRINCIPALREQUESTATTRIBUTEDEFAULT); will(returnValue(null)); } }); sut.getPreAuthenticatedPrincipal(request); context.assertIsSatisfied(); }
protected Object getPreAuthenticatedPrincipal(final HttpServletRequest request) { String principal = (String) request.getAttribute(principalRequestAttribute); if (principal == null) { throw new PreAuthenticatedCredentialsNotFoundException(principalRequestAttribute + " attribute not found in request."); } return principal; }
RequestAttributePreAuthenticatedProcessingFilter extends AbstractPreAuthenticatedProcessingFilter { protected Object getPreAuthenticatedPrincipal(final HttpServletRequest request) { String principal = (String) request.getAttribute(principalRequestAttribute); if (principal == null) { throw new PreAuthenticatedCredentialsNotFoundException(principalRequestAttribute + " attribute not found in request."); } return principal; } }
RequestAttributePreAuthenticatedProcessingFilter extends AbstractPreAuthenticatedProcessingFilter { protected Object getPreAuthenticatedPrincipal(final HttpServletRequest request) { String principal = (String) request.getAttribute(principalRequestAttribute); if (principal == null) { throw new PreAuthenticatedCredentialsNotFoundException(principalRequestAttribute + " attribute not found in request."); } return principal; }  }
RequestAttributePreAuthenticatedProcessingFilter extends AbstractPreAuthenticatedProcessingFilter { protected Object getPreAuthenticatedPrincipal(final HttpServletRequest request) { String principal = (String) request.getAttribute(principalRequestAttribute); if (principal == null) { throw new PreAuthenticatedCredentialsNotFoundException(principalRequestAttribute + " attribute not found in request."); } return principal; }  void setPrincipalRequestAttribute(final String prinRequestAttribute); void setCredentialsRequestHeader(final String credRequestHeader); int getOrder(); }
RequestAttributePreAuthenticatedProcessingFilter extends AbstractPreAuthenticatedProcessingFilter { protected Object getPreAuthenticatedPrincipal(final HttpServletRequest request) { String principal = (String) request.getAttribute(principalRequestAttribute); if (principal == null) { throw new PreAuthenticatedCredentialsNotFoundException(principalRequestAttribute + " attribute not found in request."); } return principal; }  void setPrincipalRequestAttribute(final String prinRequestAttribute); void setCredentialsRequestHeader(final String credRequestHeader); int getOrder();  }