use of uk.gov.ida.hub.samlengine.domain.SamlRequestDto in project verify-hub by alphagov.
the class CountryAuthnRequestGeneratorResourceTest method shouldRespondWithSamlRequest.
@Test
public void shouldRespondWithSamlRequest() throws Exception {
final URI ssoUri = URI.create("http://foo.com/bar");
Response clientResponse = generateCountryAuthnRequest();
assertThat(clientResponse.getStatus()).isEqualTo(Response.Status.OK.getStatusCode());
SamlRequestDto samlRequestDto = clientResponse.readEntity(SamlRequestDto.class);
assertThat(samlRequestDto.getSamlRequest()).isNotNull();
assertThat(samlRequestDto.getSsoUri()).isEqualTo(ssoUri);
}
use of uk.gov.ida.hub.samlengine.domain.SamlRequestDto in project verify-hub by alphagov.
the class IdpAuthnRequestGeneratorResourceTest method sendAuthnRequest_shouldRespondWithSamlRequest.
@Test
public void sendAuthnRequest_shouldRespondWithSamlRequest() throws Exception {
final String idpEntityId = STUB_IDP_ONE;
final URI ssoUri = URI.create("http://foo.com/bar");
IdaAuthnRequestFromHubDto idaAuthnRequestFromHubDto = new IdaAuthnRequestFromHubDto("1", asList(AuthnContext.LEVEL_2), Optional.of(false), new DateTime(), idpEntityId, false);
final URI uri = samlEngineAppRule.getUri(Urls.SamlEngineUrls.GENERATE_IDP_AUTHN_REQUEST_RESOURCE);
Response clientResponse = client.target(uri).request(MediaType.APPLICATION_JSON_TYPE).post(Entity.entity(idaAuthnRequestFromHubDto, MediaType.APPLICATION_JSON_TYPE));
assertThat(clientResponse.getStatus()).isEqualTo(Response.Status.OK.getStatusCode());
SamlRequestDto samlRequestDto = clientResponse.readEntity(SamlRequestDto.class);
assertThat(samlRequestDto.getSamlRequest()).isNotNull();
assertThat(samlRequestDto.getSsoUri()).isEqualTo(ssoUri);
}
Aggregations