use of uk.gov.ida.hub.policy.domain.ResponseFromHub in project verify-hub by alphagov.
the class ErrorStateControllerTests method shouldReturnErrorResponseWhenAskedAndInUserAccountCreationRequestSentState.
@Test
public void shouldReturnErrorResponseWhenAskedAndInUserAccountCreationRequestSentState() {
UserAccountCreationRequestSentState state = UserAccountCreationRequestSentStateBuilder.aUserAccountCreationRequestSentState().build();
StateController stateController = new UserAccountCreationRequestSentStateController(state, stateTransitionAction, hubEventLogger, policyConfiguration, levelOfAssuranceValidator, responseFromHubFactory, attributeQueryService);
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.ResponseFromHub in project verify-hub by alphagov.
the class ErrorStateControllerTests method shouldReturnErrorResponseWhenAskedAndInFraudEventDetectedState.
@Test
public void shouldReturnErrorResponseWhenAskedAndInFraudEventDetectedState() {
FraudEventDetectedState state = FraudEventDetectedStateBuilder.aFraudEventDetectedState().build();
StateController stateController = new FraudEventDetectedStateController(state, responseFromHubFactory, stateTransitionAction, null, null, null);
when(sessionRepository.getStateController(sessionId, ErrorResponsePreparedState.class)).thenReturn(stateController);
ResponseFromHub responseFromHub = authnRequestFromTransactionHandler.getErrorResponseFromHub(sessionId);
assertThat(responseFromHub.getStatus()).isEqualTo(TransactionIdaStatus.NoAuthenticationContext);
}
Aggregations