@Test public void testDefaultCredentialStringIsReturned() { final RequestAttributePreAuthenticatedProcessingFilter sut = new RequestAttributePreAuthenticatedProcessingFilter(); final HttpServletRequest request = context.mock(HttpServletRequest.class); Object credentials = sut.getPreAuthenticatedCredentials(request); assertTrue(credentials instanceof String); assertEquals(CREDENTIALSDEFAULT, credentials); }
protected Object getPreAuthenticatedCredentials(final HttpServletRequest request) { if (credentialsRequestHeader != null) { String credentials = request.getHeader(credentialsRequestHeader); if (credentials == null) { throw new PreAuthenticatedCredentialsNotFoundException(credentialsRequestHeader + " header value not found in request."); } return credentials; } return "N/A"; }
RequestAttributePreAuthenticatedProcessingFilter extends AbstractPreAuthenticatedProcessingFilter { protected Object getPreAuthenticatedCredentials(final HttpServletRequest request) { if (credentialsRequestHeader != null) { String credentials = request.getHeader(credentialsRequestHeader); if (credentials == null) { throw new PreAuthenticatedCredentialsNotFoundException(credentialsRequestHeader + " header value not found in request."); } return credentials; } return "N/A"; } }
RequestAttributePreAuthenticatedProcessingFilter extends AbstractPreAuthenticatedProcessingFilter { protected Object getPreAuthenticatedCredentials(final HttpServletRequest request) { if (credentialsRequestHeader != null) { String credentials = request.getHeader(credentialsRequestHeader); if (credentials == null) { throw new PreAuthenticatedCredentialsNotFoundException(credentialsRequestHeader + " header value not found in request."); } return credentials; } return "N/A"; }  }
RequestAttributePreAuthenticatedProcessingFilter extends AbstractPreAuthenticatedProcessingFilter { protected Object getPreAuthenticatedCredentials(final HttpServletRequest request) { if (credentialsRequestHeader != null) { String credentials = request.getHeader(credentialsRequestHeader); if (credentials == null) { throw new PreAuthenticatedCredentialsNotFoundException(credentialsRequestHeader + " header value not found in request."); } return credentials; } return "N/A"; }  void setPrincipalRequestAttribute(final String prinRequestAttribute); void setCredentialsRequestHeader(final String credRequestHeader); int getOrder(); }
RequestAttributePreAuthenticatedProcessingFilter extends AbstractPreAuthenticatedProcessingFilter { protected Object getPreAuthenticatedCredentials(final HttpServletRequest request) { if (credentialsRequestHeader != null) { String credentials = request.getHeader(credentialsRequestHeader); if (credentials == null) { throw new PreAuthenticatedCredentialsNotFoundException(credentialsRequestHeader + " header value not found in request."); } return credentials; } return "N/A"; }  void setPrincipalRequestAttribute(final String prinRequestAttribute); void setCredentialsRequestHeader(final String credRequestHeader); int getOrder();  }