Search in sources :

Example 1 with AttributeQueryContainerDto

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

the class AttributeQueryService method sendAttributeQueryRequest.

public void sendAttributeQueryRequest(final SessionId sessionId, final AbstractAttributeQueryRequestDto attributeQueryRequestDto) {
    AttributeQueryContainerDto attributeQueryContainerDto = attributeQueryRequestDto.sendToSamlEngine(samlEngineProxy);
    generateAndSendMatchingServiceRequest(sessionId, attributeQueryRequestDto.isOnboarding(), attributeQueryContainerDto);
}
Also used : AttributeQueryContainerDto(uk.gov.ida.hub.policy.contracts.AttributeQueryContainerDto)

Example 2 with AttributeQueryContainerDto

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

the class EidasMatchingServiceResourceIntegrationTest method stubSamlEngineGenerationOfAQR.

private void stubSamlEngineGenerationOfAQR() throws Exception {
    AttributeQueryContainerDto aqrDto = new AttributeQueryContainerDto("SAML", URI.create("/foo"), "id", DateTime.now(), "issuer", true);
    samlEngineStub.setupStubForEidasAttributeQueryRequestGeneration(aqrDto);
}
Also used : AttributeQueryContainerDto(uk.gov.ida.hub.policy.contracts.AttributeQueryContainerDto)

Example 3 with AttributeQueryContainerDto

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

the class EidasSessionResourceIntegrationTest method stubSamlEngineGenerationOfAQR.

private void stubSamlEngineGenerationOfAQR() throws Exception {
    aqrDto = new AttributeQueryContainerDto("SAML", URI.create("/foo"), "id", DateTime.now(), "issuer", true);
    samlEngineStub.setupStubForEidasAttributeQueryRequestGeneration(aqrDto);
}
Also used : AttributeQueryContainerDto(uk.gov.ida.hub.policy.contracts.AttributeQueryContainerDto)

Example 4 with AttributeQueryContainerDto

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

the class AttributeQueryServiceTest method shouldGenerateAttributeQueryAndSendRequestToMatchingService.

@Test
public void shouldGenerateAttributeQueryAndSendRequestToMatchingService() throws Exception {
    // Given
    boolean isRegistration = true;
    stub(idpSelectedStateController.isRegistrationContext()).toReturn(isRegistration);
    AttributeQueryRequestDto attributeQueryRequestDto = AttributeQueryRequestBuilder.anAttributeQueryRequest().build();
    stub(idpSelectedStateController.createAttributeQuery(any(SuccessFromIdp.class))).toReturn(attributeQueryRequestDto);
    AttributeQueryContainerDto build = anAttributeQueryContainerDto().build();
    stub(samlEngineProxy.generateAttributeQuery(attributeQueryRequestDto)).toReturn(build);
    // When
    service.sendAttributeQueryRequest(sessionId, attributeQueryRequestDto);
    // Then
    verify(samlEngineProxy).generateAttributeQuery(attributeQueryRequestDto);
    verify(samlSoapProxyProxy).sendHubMatchingServiceRequest(eq(sessionId), Matchers.<AttributeQueryRequest>any());
}
Also used : SuccessFromIdp(uk.gov.ida.hub.policy.domain.SuccessFromIdp) AttributeQueryContainerDto(uk.gov.ida.hub.policy.contracts.AttributeQueryContainerDto) AttributeQueryContainerDtoBuilder.anAttributeQueryContainerDto(uk.gov.ida.hub.policy.builder.AttributeQueryContainerDtoBuilder.anAttributeQueryContainerDto) EidasAttributeQueryRequestDtoBuilder.anEidasAttributeQueryRequestDto(uk.gov.ida.hub.policy.builder.EidasAttributeQueryRequestDtoBuilder.anEidasAttributeQueryRequestDto) AttributeQueryRequestDto(uk.gov.ida.hub.policy.contracts.AttributeQueryRequestDto) EidasAttributeQueryRequestDto(uk.gov.ida.hub.policy.contracts.EidasAttributeQueryRequestDto) Test(org.junit.Test)

Example 5 with AttributeQueryContainerDto

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

the class AttributeQueryServiceTest method shouldGenerateEidasAttributeQueryAndSendRequestToMatchingService.

@Test
public void shouldGenerateEidasAttributeQueryAndSendRequestToMatchingService() {
    final EidasAttributeQueryRequestDto eidasAttributeQueryRequestDto = anEidasAttributeQueryRequestDto().build();
    final AttributeQueryContainerDto attributeQueryContainerDto = anAttributeQueryContainerDto().build();
    final AttributeQueryRequest attributeQueryRequest = new AttributeQueryRequest(attributeQueryContainerDto.getId(), attributeQueryContainerDto.getIssuer(), attributeQueryContainerDto.getSamlRequest(), attributeQueryContainerDto.getMatchingServiceUri(), attributeQueryContainerDto.getAttributeQueryClientTimeOut(), eidasAttributeQueryRequestDto.isOnboarding());
    when(samlEngineProxy.generateEidasAttributeQuery(eidasAttributeQueryRequestDto)).thenReturn(attributeQueryContainerDto);
    service.sendAttributeQueryRequest(sessionId, eidasAttributeQueryRequestDto);
    verify(samlEngineProxy).generateEidasAttributeQuery(eidasAttributeQueryRequestDto);
    verify(samlSoapProxyProxy).sendHubMatchingServiceRequest(sessionId, attributeQueryRequest);
}
Also used : AttributeQueryContainerDto(uk.gov.ida.hub.policy.contracts.AttributeQueryContainerDto) AttributeQueryContainerDtoBuilder.anAttributeQueryContainerDto(uk.gov.ida.hub.policy.builder.AttributeQueryContainerDtoBuilder.anAttributeQueryContainerDto) AttributeQueryRequest(uk.gov.ida.hub.policy.proxy.AttributeQueryRequest) EidasAttributeQueryRequestDtoBuilder.anEidasAttributeQueryRequestDto(uk.gov.ida.hub.policy.builder.EidasAttributeQueryRequestDtoBuilder.anEidasAttributeQueryRequestDto) EidasAttributeQueryRequestDto(uk.gov.ida.hub.policy.contracts.EidasAttributeQueryRequestDto) Test(org.junit.Test)

Aggregations

AttributeQueryContainerDto (uk.gov.ida.hub.policy.contracts.AttributeQueryContainerDto)7 Test (org.junit.Test)3 EidasAttributeQueryRequestDto (uk.gov.ida.hub.policy.contracts.EidasAttributeQueryRequestDto)3 AttributeQueryContainerDtoBuilder.anAttributeQueryContainerDto (uk.gov.ida.hub.policy.builder.AttributeQueryContainerDtoBuilder.anAttributeQueryContainerDto)2 EidasAttributeQueryRequestDtoBuilder.anEidasAttributeQueryRequestDto (uk.gov.ida.hub.policy.builder.EidasAttributeQueryRequestDtoBuilder.anEidasAttributeQueryRequestDto)2 AttributeQueryRequestDto (uk.gov.ida.hub.policy.contracts.AttributeQueryRequestDto)2 SamlAuthnResponseTranslatorDto (uk.gov.ida.hub.policy.contracts.SamlAuthnResponseTranslatorDto)2 SuccessFromIdp (uk.gov.ida.hub.policy.domain.SuccessFromIdp)2 InboundResponseFromCountry (uk.gov.ida.hub.policy.domain.InboundResponseFromCountry)1 InboundResponseFromIdpDto (uk.gov.ida.hub.policy.domain.InboundResponseFromIdpDto)1 LevelOfAssurance (uk.gov.ida.hub.policy.domain.LevelOfAssurance)1 ResponseAction (uk.gov.ida.hub.policy.domain.ResponseAction)1 CountrySelectedStateController (uk.gov.ida.hub.policy.domain.controller.CountrySelectedStateController)1 CountrySelectedState (uk.gov.ida.hub.policy.domain.state.CountrySelectedState)1 AttributeQueryRequest (uk.gov.ida.hub.policy.proxy.AttributeQueryRequest)1