public String getAuthenticationStatusPage(HttpRequest request, HttpResponse response) {
    try {
      Auth auth = initSamlAuth(request, response);
      return getSamlAuthStatusHtml(request, getSamlAuthenticationStatus(request.getParameter("SAMLResponse"), auth, samlSettings));
    } catch (IllegalStateException e) {
      return getSamlAuthStatusHtml(request, getSamlAuthenticationStatus(String.format("%s due to: %s", e.getMessage(), e.getCause().getMessage())));
    }
  }
@Test
  public void authentication_status_with_errors_returned_when_init_fails() {
    HttpRequest request = new JavaxHttpRequest(mock(HttpServletRequest.class));
    HttpResponse response = new JavaxHttpResponse(mock(HttpServletResponse.class));
    when(request.getContextPath()).thenReturn("context");

    String authenticationStatus = underTest.getAuthenticationStatusPage(request, response);

    assertFalse(authenticationStatus.isEmpty());
  }