### Question:
SAML2SSOManager { public String handleAuthenticationRequestForPOSTBinding(Request request) throws SSOException { RequestAbstractType requestMessage = buildAuthnRequest(request); if (contextConfiguration.isRequestSigningEnabled()) { requestMessage = SSOUtils.setSignature(requestMessage, XMLSignature.ALGO_ID_SIGNATURE_RSA, new X509CredentialImplementation(SSOX509Credential.getInstance())); } return preparePOSTRequest(requestMessage); } SAML2SSOManager(WebAppSingleSignOn context); String handleAuthenticationRequestForPOSTBinding(Request request); String handleAuthenticationRequestForRedirectBinding(Request request); String handleLogoutRequestForPOSTBinding(Request request); String handleLogoutRequestForRedirectBinding(Request request); void processResponse(Request request);  }### Answer:
@Test(description = "Tests handling a SAML 2.0 Authentication Request for HTTP-POST binding") public void testHandlingAuthRequestForPOSTBinding() throws SSOException { Optional<AppServerWebAppConfiguration> configuration = ContextConfigurationLoader.getContextConfiguration(fooContext); if (configuration.isPresent()) { manager = new SAML2SSOManager(configuration.get().getSingleSignOnConfiguration()); Request request = mock(Request.class); when(request.getContextPath()).thenReturn("/" + TestConstants.FOO_CONTEXT); when(request.getHost()).thenReturn(host); request.setAttribute(Constants.IS_FORCE_AUTH_ENABLED, "false"); request.setAttribute(Constants.IS_PASSIVE_AUTH_ENABLED, "true"); String payload = manager.handleAuthenticationRequestForPOSTBinding(request); boolean checkRedirectURL = payload.contains("<p>You are now redirected back to " + TestConstants .DEFAULT_IDP_URL); boolean checkActionURL = payload.contains("<form method='post' action='" + TestConstants .DEFAULT_IDP_URL + "'"); Assert.assertTrue(checkRedirectURL && checkActionURL); } else { Assert.fail(); } }