Search in sources :

Example 1 with AttributeQueryContainerDto

use of uk.gov.ida.hub.samlengine.contracts.AttributeQueryContainerDto 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)

Example 2 with AttributeQueryContainerDto

use of uk.gov.ida.hub.samlengine.contracts.AttributeQueryContainerDto in project verify-hub by alphagov.

the class MatchingServiceRequestGeneratorResourceTest method should_createAttributeQueryRequest.

@Test
public void should_createAttributeQueryRequest() throws Exception {
    configStub.setupCertificatesForEntity(TEST_RP_MS);
    Response response = getAttributeQuery(new AttributeQueryRequestBuilder().build());
    AttributeQueryContainerDto entity = response.readEntity(AttributeQueryContainerDto.class);
    assertThat(response.getStatus()).isEqualTo(Response.Status.OK.getStatusCode());
    assertThat(entity.getSamlRequest()).isNotNull();
}
Also used : Response(javax.ws.rs.core.Response) AttributeQueryContainerDto(uk.gov.ida.hub.samlengine.contracts.AttributeQueryContainerDto) AttributeQueryRequestBuilder(uk.gov.ida.integrationtest.hub.samlengine.builders.AttributeQueryRequestBuilder) Test(org.junit.jupiter.api.Test)

Aggregations

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