use of org.opensaml.saml.saml2.core.Status in project verify-hub by alphagov.
the class EncryptedResponseFromIdpValidatorTest method validateStatus_shouldNotErrorIfStatusIsResponderWithSubStatusAuthnFailed.
@Test
public void validateStatus_shouldNotErrorIfStatusIsResponderWithSubStatusAuthnFailed() throws Exception {
Status status = createStatus(StatusCode.RESPONDER, createSubStatusCode(StatusCode.AUTHN_FAILED));
Response response = aResponse().withStatus(status).withNoDefaultAssertion().build();
validator.validate(response);
}
use of org.opensaml.saml.saml2.core.Status in project verify-hub by alphagov.
the class EncryptedResponseFromIdpValidatorTest method validateStatus_shouldThrowExceptionIfSuccessHasASubStatus.
@Test
public void validateStatus_shouldThrowExceptionIfSuccessHasASubStatus() throws Exception {
StatusCode subStatusCode = createSubStatusCode();
Status status = createStatus(StatusCode.SUCCESS, subStatusCode);
Response response = aResponse().withStatus(status).build();
assertValidationFailure(response, invalidSubStatusCode(subStatusCode.getValue(), StatusCode.SUCCESS));
}
use of org.opensaml.saml.saml2.core.Status in project verify-hub by alphagov.
the class EncryptedResponseFromIdpValidatorTest method validateStatus_shouldThrowExceptionIfRequesterHasASubStatus.
@Test
public void validateStatus_shouldThrowExceptionIfRequesterHasASubStatus() throws Exception {
StatusCode subStatusCode = createSubStatusCode();
Status status = createStatus(StatusCode.REQUESTER, subStatusCode);
Response response = aResponse().withStatus(status).build();
assertValidationFailure(response, invalidSubStatusCode(subStatusCode.getValue(), StatusCode.REQUESTER));
}
use of org.opensaml.saml.saml2.core.Status in project verify-hub by alphagov.
the class EncryptedResponseFromIdpValidatorTest method validateStatus_shouldThrowExceptionIfStatusIsResponderWithNoSubStatus.
@Test
public void validateStatus_shouldThrowExceptionIfStatusIsResponderWithNoSubStatus() throws Exception {
Status status = createStatus(StatusCode.RESPONDER);
Response response = aResponse().withStatus(status).withNoDefaultAssertion().build();
assertValidationFailure(response, invalidStatusCode(StatusCode.RESPONDER));
}
use of org.opensaml.saml.saml2.core.Status in project verify-hub by alphagov.
the class EncryptedResponseFromMatchingServiceValidatorTest method validate_shouldDoNothingIfAResponderStatusContainsASubStatusOfNoMatch.
@Test
public void validate_shouldDoNothingIfAResponderStatusContainsASubStatusOfNoMatch() throws Exception {
Status status = createStatus(StatusCode.RESPONDER, createSubStatusCode(SamlStatusCode.NO_MATCH));
Response response = aResponse().withStatus(status).withNoDefaultAssertion().build();
validator.validate(response);
}
Aggregations