public static String getSamlAuthStatusHtml(HttpRequest request, SamlAuthenticationStatus samlAuthenticationStatus) {
    Map<String, String> substitutionsMap = getSubstitutionsMap(request, samlAuthenticationStatus);
    String htmlTemplate = getPlainTemplate();

    return substitutionsMap
      .keySet()
      .stream()
      .reduce(htmlTemplate, (accumulator, pattern) -> accumulator.replace(pattern, substitutionsMap.get(pattern)));
  }
@Test
  public void getSamlAuthStatusHtml_whenCalled_shouldGeneratePageWithData() {
    SamlAuthenticationStatus samlAuthenticationStatus = mock(SamlAuthenticationStatus.class);
    HttpRequest request = mock(HttpRequest.class);

    when(samlAuthenticationStatus.getStatus()).thenReturn("success");
    when(samlAuthenticationStatus.getErrors()).thenReturn(new ArrayList<>());
    when(samlAuthenticationStatus.getWarnings()).thenReturn(new ArrayList<>());
    when(samlAuthenticationStatus.getAvailableAttributes()).thenReturn(new HashMap<>());
    when(samlAuthenticationStatus.getMappedAttributes()).thenReturn(new HashMap<>());
    when(samlAuthenticationStatus.isEncryptionEnabled()).thenReturn(false);
    when(samlAuthenticationStatus.isSignatureEnabled()).thenReturn(false);
    when(request.getContextPath()).thenReturn("context");

    String decodedDataResponse = getDecodedDataResponse(getSamlAuthStatusHtml(request, samlAuthenticationStatus));

    assertThat(decodedDataResponse).contains(
      "\"encryptionEnabled\":false",
      "\"signatureEnabled\":false",
      "\"errors\":[]",
      "\"warnings\":[]",
      "\"status\":\"success\"",
      "\"availableAttributes\":{}",
      "\"mappedAttributes\":{}");
  }