Search in sources :

Example 1 with EidasAttributeQueryRequestBuilder

use of uk.gov.ida.integrationtest.hub.samlengine.builders.EidasAttributeQueryRequestBuilder in project verify-hub by alphagov.

the class CountryMatchingServiceRequestGeneratorResourceTest method shouldCreateAttributeQueryRequest.

@Test
public void shouldCreateAttributeQueryRequest() throws Exception {
    EidasAttributeQueryRequestDto eidasAttributeQueryRequestDto = new EidasAttributeQueryRequestBuilder().build();
    Response response = generateEidasAttributeQueryRequest(eidasAttributeQueryRequestDto);
    assertThat(response.getStatus()).isEqualTo(Response.Status.OK.getStatusCode());
    AttributeQueryContainerDto attributeQueryContainerDto = response.readEntity(AttributeQueryContainerDto.class);
    assertThat(attributeQueryContainerDto.getId()).isEqualTo(eidasAttributeQueryRequestDto.getRequestId());
    assertThat(attributeQueryContainerDto.getIssuer()).isEqualTo(HUB_ENTITY_ID);
    assertThat(attributeQueryContainerDto.getMatchingServiceUri()).isEqualTo(eidasAttributeQueryRequestDto.getAttributeQueryUri());
    assertThat(attributeQueryContainerDto.getAttributeQueryClientTimeOut()).isEqualTo(eidasAttributeQueryRequestDto.getMatchingServiceRequestTimeOut());
    assertThat(attributeQueryContainerDto.isOnboarding()).isEqualTo(eidasAttributeQueryRequestDto.isOnboarding());
    assertThat(attributeQueryContainerDto.getSamlRequest()).contains("saml2p:AttributeQuery");
}
Also used : Response(javax.ws.rs.core.Response) AttributeQueryContainerDto(uk.gov.ida.hub.samlengine.contracts.AttributeQueryContainerDto) EidasAttributeQueryRequestBuilder(uk.gov.ida.integrationtest.hub.samlengine.builders.EidasAttributeQueryRequestBuilder) EidasAttributeQueryRequestDto(uk.gov.ida.hub.samlengine.domain.EidasAttributeQueryRequestDto) Test(org.junit.Test)

Aggregations

Response (javax.ws.rs.core.Response)1 Test (org.junit.Test)1 AttributeQueryContainerDto (uk.gov.ida.hub.samlengine.contracts.AttributeQueryContainerDto)1 EidasAttributeQueryRequestDto (uk.gov.ida.hub.samlengine.domain.EidasAttributeQueryRequestDto)1 EidasAttributeQueryRequestBuilder (uk.gov.ida.integrationtest.hub.samlengine.builders.EidasAttributeQueryRequestBuilder)1