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);
}
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);
}
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);
}
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());
}
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);
}
Aggregations