use of org.opensaml.saml.saml2.core.Status in project verify-hub by alphagov.
the class TransactionIdaStatusMarshallerTest method toSamlStatus_shouldTransformSuccess.
@Test
public void toSamlStatus_shouldTransformSuccess() {
Status transformedStatus = marshaller.toSamlStatus(TransactionIdaStatus.Success);
assertThat(transformedStatus.getStatusCode().getValue()).isEqualTo(StatusCode.SUCCESS);
}
use of org.opensaml.saml.saml2.core.Status in project verify-hub by alphagov.
the class TransactionIdaStatusMarshallerTest method toSamlStatus_shouldTransformNoMatchingServiceMatchMayRetry.
@Test
public void toSamlStatus_shouldTransformNoMatchingServiceMatchMayRetry() {
Status transformedStatus = marshaller.toSamlStatus(TransactionIdaStatus.NoMatchingServiceMatchFromHub);
assertThat(transformedStatus.getStatusCode().getValue()).isEqualTo(StatusCode.SUCCESS);
assertThat(transformedStatus.getStatusCode().getStatusCode()).isNotNull();
assertThat(transformedStatus.getStatusCode().getStatusCode().getValue()).isEqualTo(SamlStatusCode.NO_MATCH);
}
use of org.opensaml.saml.saml2.core.Status in project verify-hub by alphagov.
the class TransactionIdaStatusMarshallerTest method toSamlStatus_shouldTransformRequesterError.
@Test
public void toSamlStatus_shouldTransformRequesterError() {
Status transformedStatus = marshaller.toSamlStatus(TransactionIdaStatus.RequesterError);
assertThat(transformedStatus.getStatusCode().getValue()).isEqualTo(StatusCode.RESPONDER);
assertThat(transformedStatus.getStatusCode().getStatusCode().getValue()).isEqualTo(StatusCode.REQUESTER);
}
use of org.opensaml.saml.saml2.core.Status in project verify-hub by alphagov.
the class ResponseValidatorTestHelper method createStatus.
public static Status createStatus(String statusCodeValue, StatusCode subStatusCode) {
StatusCodeBuilder statusCodeBuilder = aStatusCode().withValue(statusCodeValue);
StatusCode statusCode = subStatusCode == null ? statusCodeBuilder.build() : statusCodeBuilder.withSubStatusCode(subStatusCode).build();
return aStatus().withStatusCode(statusCode).build();
}
use of org.opensaml.saml.saml2.core.Status in project verify-hub by alphagov.
the class EncryptedResponseFromIdpValidatorTest method validateStatus_shouldNotErrorIfStatusIsResponderWithSubStatusNoAuthnContext.
@Test
public void validateStatus_shouldNotErrorIfStatusIsResponderWithSubStatusNoAuthnContext() throws Exception {
Status status = createStatus(StatusCode.RESPONDER, createSubStatusCode(StatusCode.NO_AUTHN_CONTEXT));
Response response = aResponse().withStatus(status).withNoDefaultAssertion().build();
validator.validate(response);
}
Aggregations