use of uk.gov.ida.hub.policy.domain.ResponseFromMatchingService in project verify-hub by alphagov.
the class UserAccountCreationRequestSentStateControllerTest method getNextState_shouldThrowStateProcessingValidationExceptionIfResponseIsNotFromTheExpectedMatchingService.
@Test
public void getNextState_shouldThrowStateProcessingValidationExceptionIfResponseIsNotFromTheExpectedMatchingService() {
UserAccountCreationRequestSentState state = aUserAccountCreationRequestSentState().build();
UserAccountCreationRequestSentStateController controller = new UserAccountCreationRequestSentStateController(state, null, null, null, null, null, null);
ResponseFromMatchingService responseFromMatchingService = new UserAccountCreatedFromMatchingService("issuer-id", "", "", Optional.absent());
try {
controller.validateResponse(responseFromMatchingService);
fail("fail");
} catch (StateProcessingValidationException e) {
assertThat(e.getMessage()).isEqualTo("Response to request ID [" + state.getRequestId() + "] came from [issuer-id] and was expected to come from [matchingServiceEntityId]");
}
}
Aggregations