use of uk.gov.ida.hub.policy.domain.SessionId in project verify-hub by alphagov.
the class EidasCycle3DataResourceTest method shouldUpdateSessionStateToCancelledCycle3InputStateWhenInputToCycle3IsCancelled.
@Test
public void shouldUpdateSessionStateToCancelledCycle3InputStateWhenInputToCycle3IsCancelled() throws JsonProcessingException {
final SessionId sessionId = SessionIdBuilder.aSessionId().build();
final Response sessionCreatedResponse = createSessionInEidasAwaitingCycle3DataState(sessionId);
assertThat(sessionCreatedResponse.getStatus()).isEqualTo(Response.Status.OK.getStatusCode());
cancelCycle3Data(sessionId);
assertThat(getSessionStateName(sessionId)).isEqualTo(Cycle3DataInputCancelledState.class.getName());
}
use of uk.gov.ida.hub.policy.domain.SessionId in project verify-hub by alphagov.
the class EidasDisabledIntegrationTest method sessionResourceShouldReturnNotFound.
@Test
public void sessionResourceShouldReturnNotFound() throws Exception {
SessionId sessionId = SessionId.createNewSessionId();
Response selectedCountryResponse = selectACountry(sessionId);
assertThat(selectedCountryResponse.getStatus()).isEqualTo(NOT_FOUND.getStatusCode());
}
use of uk.gov.ida.hub.policy.domain.SessionId in project verify-hub by alphagov.
the class EidasMatchingServiceResourceIntegrationTest method shouldTransitionToEidasAwaitingCycle3DataStateWhenNoMatchIsReceivedForEidasCycle0And1WithCycle3Enabled.
@Test
public void shouldTransitionToEidasAwaitingCycle3DataStateWhenNoMatchIsReceivedForEidasCycle0And1WithCycle3Enabled() throws Exception {
final SessionId sessionId = aSessionIsCreated();
selectACountry(sessionId, NETHERLANDS);
samlSoapProxyProxyStub.setUpStubForSendHubMatchingServiceRequest(sessionId);
postAuthnResponseToPolicy(sessionId);
final InboundResponseFromMatchingServiceDto inboundResponseFromMatchingServiceDto = new InboundResponseFromMatchingServiceDto(MatchingServiceIdaStatus.NoMatchingServiceMatchFromMatchingService, translatedAuthnRequest.getId(), MSA_ENTITY_ID, Optional.absent(), Optional.absent());
samlEngineStub.setupStubForAttributeResponseTranslate(inboundResponseFromMatchingServiceDto);
configStub.setUpStubForEnteringAwaitingCycle3DataState(RP_ENTITY_ID);
final Response response = postAttributeQueryResponseToPolicy(sessionId);
assertThat(response.getStatus()).isEqualTo(Response.Status.OK.getStatusCode());
assertThat(getSessionStateName(sessionId)).isEqualTo(EidasAwaitingCycle3DataState.class.getName());
}
use of uk.gov.ida.hub.policy.domain.SessionId in project verify-hub by alphagov.
the class EidasSessionResourceIntegrationTest method shouldFailWhenTranslationDoesNotReturn2XX.
@Test
public void shouldFailWhenTranslationDoesNotReturn2XX() throws Exception {
stubSamlEngineTranslationToReturnBadRequest();
SessionId sessionId = selectACountry(NETHERLANDS);
Response response = postAuthnResponseToPolicy(sessionId);
assertThat(response.getStatus()).isEqualTo(Response.Status.BAD_REQUEST.getStatusCode());
}
use of uk.gov.ida.hub.policy.domain.SessionId in project verify-hub by alphagov.
the class EidasSessionResourceIntegrationTest method shouldReturnPackagedFailureResponseWhenTranslationFails.
@Test
public void shouldReturnPackagedFailureResponseWhenTranslationFails() throws Exception {
stubSamlEngineTranslationToFailForCountry(NETHERLANDS);
SessionId sessionId = selectACountry(NETHERLANDS);
Response response = postAuthnResponseToPolicy(sessionId);
assertThat(response.getStatus()).isEqualTo(Response.Status.OK.getStatusCode());
ResponseAction responseAction = response.readEntity(ResponseAction.class);
assertThat(responseAction.getResult()).isEqualTo(OTHER);
}
Aggregations