use of uk.gov.ida.hub.policy.domain.state.AuthnFailedErrorState in project verify-hub by alphagov.
the class ErrorStateControllerTests method shouldReturnErrorResponseWhenAskedAndInAuthnFailedErrorState.
@Test
public void shouldReturnErrorResponseWhenAskedAndInAuthnFailedErrorState() {
AuthnFailedErrorState state = AuthnFailedErrorStateBuilder.anAuthnFailedErrorState().build();
StateController stateController = new AuthnFailedErrorStateController(state, responseFromHubFactory, stateTransitionAction, transactionsConfigProxy, identityProvidersConfigProxy, hubEventLogger);
when(sessionRepository.getStateController(sessionId, ErrorResponsePreparedState.class)).thenReturn(stateController);
ResponseFromHub responseFromHub = authnRequestFromTransactionHandler.getErrorResponseFromHub(sessionId);
assertThat(responseFromHub.getStatus()).isEqualTo(TransactionIdaStatus.NoAuthenticationContext);
}
use of uk.gov.ida.hub.policy.domain.state.AuthnFailedErrorState in project verify-hub by alphagov.
the class TestSessionResourceHelper method createSessionInAuthnFailedErrorState.
public static Response createSessionInAuthnFailedErrorState(SessionId sessionId, Client client, URI uri) {
AuthnFailedErrorState state = AuthnFailedErrorStateBuilder.anAuthnFailedErrorState().build();
TestSessionDto testSessionDto = new TestSessionDto(sessionId, state.getRequestId(), state.getSessionExpiryTimestamp(), state.getIdpEntityId(), state.getRelayState().orNull(), null, null, null, state.getAssertionConsumerServiceUri(), Collections.emptyList(), false, state.getTransactionSupportsEidas());
return client.target(uri).request(MediaType.APPLICATION_JSON_TYPE).post(Entity.json(testSessionDto));
}
Aggregations