use of uk.gov.ida.saml.hub.domain.IdaAuthnRequestFromHub in project verify-hub by alphagov.
the class SamlMessageSenderApiResourceTest method sendJsonAuthnRequestFromHub_shouldRespondWithNextLocation.
@Test
public void sendJsonAuthnRequestFromHub_shouldRespondWithNextLocation() throws Exception {
SessionId sessionId = SessionId.createNewSessionId();
URI nextLocationUri = URI.create("http://blah");
IdaAuthnRequestFromHub authnRequestFromHub = anIdaAuthnRequest().withIssuer(HUB_ENTITY_ID).buildFromHub();
Function<IdaAuthnRequestFromHub, String> idaAuthnRequestFromHubToStringTransformer = new HubTransformersFactory().getIdaAuthnRequestFromHubToStringTransformer(getKeyStore(), SIGNATURE_ALGORITHM, DIGEST_ALGORITHM);
String samlString = idaAuthnRequestFromHubToStringTransformer.apply(authnRequestFromHub);
policyStubRule.aValidAuthnRequestFromHubToIdp(sessionId, new AuthnRequestFromHubContainerDto(samlString, nextLocationUri, false));
Response response = getResponseFromSamlProxy(Urls.SamlProxyUrls.SEND_AUTHN_REQUEST_API_RESOURCE, sessionId);
assertThat(response.readEntity(SamlMessageSenderHandler.SamlMessage.class).getPostEndpoint()).isEqualTo(nextLocationUri.toASCIIString());
}
Aggregations