use of uk.gov.ida.saml.core.extensions.StatusValue in project verify-hub by alphagov.
the class IdpIdaStatusMarshallerTest method shouldMarshallStatusDetailWithStatusValueContainingUpliftFailed.
@Test
public void shouldMarshallStatusDetailWithStatusValueContainingUpliftFailed() {
Status status = marshaller.toSamlStatus(IdpIdaStatus.upliftFailed());
StatusValue actual = (StatusValue) status.getStatusDetail().getOrderedChildren().get(0);
assertThat(actual.getNamespaces()).isEmpty();
assertThat(actual.getValue()).isEqualTo(StatusValue.UPLIFT_FAILED);
}
use of uk.gov.ida.saml.core.extensions.StatusValue in project verify-hub by alphagov.
the class IdpIdaStatusMarshaller method getStatusDetail.
@Override
protected Optional<StatusDetail> getStatusDetail(IdpIdaStatus originalStatus) {
if (REST_TO_STATUS_DETAIL.containsKey(originalStatus)) {
StatusDetail statusDetail = this.samlObjectFactory.createStatusDetail();
StatusValue statusValue = this.samlObjectFactory.createStatusValue(REST_TO_STATUS_DETAIL.get(originalStatus));
statusDetail.getUnknownXMLObjects().add(statusValue);
return of(statusDetail);
}
return empty();
}
use of uk.gov.ida.saml.core.extensions.StatusValue in project verify-hub by alphagov.
the class IdpIdaStatusMarshallerTest method shouldMarshallStatusDetailWithStatusValueContainingAuthnCancelInCaseOfAuthenticationCancelled.
@Test
public void shouldMarshallStatusDetailWithStatusValueContainingAuthnCancelInCaseOfAuthenticationCancelled() {
Status status = marshaller.toSamlStatus(IdpIdaStatus.authenticationCancelled());
StatusValue actual = (StatusValue) status.getStatusDetail().getOrderedChildren().get(0);
assertThat(actual.getNamespaces()).isEmpty();
assertThat(actual.getValue()).isEqualTo(StatusValue.CANCEL);
}
use of uk.gov.ida.saml.core.extensions.StatusValue in project verify-hub by alphagov.
the class IdpIdaStatusMarshallerTest method transform_shouldTransformAuthenticationPending.
@Test
public void transform_shouldTransformAuthenticationPending() {
Status transformedStatus = marshaller.toSamlStatus(IdpIdaStatus.authenticationPending());
StatusValue actual = (StatusValue) transformedStatus.getStatusDetail().getOrderedChildren().get(0);
assertThat(transformedStatus.getStatusCode().getValue()).isEqualTo(StatusCode.RESPONDER);
assertThat(transformedStatus.getStatusCode().getStatusCode().getValue()).isEqualTo(StatusCode.NO_AUTHN_CONTEXT);
assertThat(actual.getValue()).isEqualTo(StatusValue.PENDING);
}
Aggregations