use of uk.gov.ida.hub.samlengine.domain.AttributeQueryContainerDto in project verify-hub by alphagov.
the class AttributeQueryGeneratorTest method handle_shouldReturnDtoWithSamlMatchingServiceRequest.
// This test should move to the request builder?
@Test
public void handle_shouldReturnDtoWithSamlMatchingServiceRequest() {
HubAttributeQueryRequest hubAttributeQueryRequest = aHubAttributeQueryRequest();
Element transformedRequest = mock(Element.class);
when(transformer.apply(any(HubAttributeQueryRequest.class))).thenReturn(transformedRequest);
AttributeQueryContainerDto attributeQueryDto = attributeQueryGenerator.createAttributeQueryContainer(hubAttributeQueryRequest, URI.create("/dont_care"), MATCHING_SERVICE_ENTITY_ID, null, false);
assertThat(attributeQueryDto.getSamlRequest()).isEqualTo(XmlUtils.writeToString(transformedRequest));
}
use of uk.gov.ida.hub.samlengine.domain.AttributeQueryContainerDto in project verify-hub by alphagov.
the class AttributeQueryGeneratorTest method handle_shouldReturnDtoWithMatchingServiceEndpointReturnedFromConfig.
@Test
public void handle_shouldReturnDtoWithMatchingServiceEndpointReturnedFromConfig() {
HubAttributeQueryRequest hubAttributeQueryRequest = aHubAttributeQueryRequest();
URI attributeQueryUri = URI.create("/attribute-query-uri");
AttributeQueryContainerDto attributeQueryDto = attributeQueryGenerator.createAttributeQueryContainer(hubAttributeQueryRequest, attributeQueryUri, MATCHING_SERVICE_ENTITY_ID, null, false);
assertThat(attributeQueryDto.getMatchingServiceUri()).isEqualTo(attributeQueryUri);
}
Aggregations