use of uk.gov.ida.hub.policy.domain.ResponseProcessingDetails in project verify-hub by alphagov.
the class MatchingServiceResourcesIntegrationTest method isResponseFromHubReady_shouldThrowExceptionWhenMatchingServiceWaitPeriodHasBeenExceeded.
@Test
public void isResponseFromHubReady_shouldThrowExceptionWhenMatchingServiceWaitPeriodHasBeenExceeded() throws Exception {
final SessionId sessionId = aSessionIsCreated();
anIdpIsSelectedForRegistration(sessionId, idpEntityId);
anIdpAuthnRequestWasGenerated(sessionId);
anAuthnResponseFromIdpWasReceivedAndMatchingRequestSent(sessionId);
theMatchingServiceResponseTimeoutHasBeenExceeded();
URI uri = UriBuilder.fromPath(Urls.PolicyUrls.RESPONSE_PROCESSING_DETAILS_RESOURCE).build(sessionId);
Response response = getResponse(uri);
assertThat(response.getStatus()).isEqualTo(Response.Status.OK.getStatusCode());
ResponseProcessingDetails responseProcessingDetails = response.readEntity(ResponseProcessingDetails.class);
assertThat(responseProcessingDetails.getResponseProcessingStatus()).isEqualTo(ResponseProcessingStatus.SHOW_MATCHING_ERROR_PAGE);
assertThat(responseProcessingDetails.getSessionId()).isEqualTo(sessionId);
assertThat(getSessionStateName(sessionId)).isEqualTo(MatchingServiceRequestErrorState.class.getName());
}
Aggregations