use of org.opensaml.saml2.core.Response in project verify-hub by alphagov.
the class EncryptedResponseFromIdpValidatorTest method validateIssuer_shouldNotErrorIfFormatAttributeIsMissing.
@Test
public void validateIssuer_shouldNotErrorIfFormatAttributeIsMissing() throws Exception {
Issuer issuer = anIssuer().withFormat(null).build();
Response response = getResponseBuilderWithTwoAssertions().withIssuer(issuer).build();
validator.validate(response);
}
use of org.opensaml.saml2.core.Response in project verify-hub by alphagov.
the class EncryptedResponseFromIdpValidatorTest method validate_shouldThrowIfResponseContainsTooFewAssertions.
@Test
public void validate_shouldThrowIfResponseContainsTooFewAssertions() throws Exception {
EncryptedAssertion assertion = anAssertion().build();
Response response = aResponse().addEncryptedAssertion(assertion).build();
assertValidationFailure(response, unexpectedNumberOfAssertions(2, 1));
}
use of org.opensaml.saml2.core.Response 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.saml2.core.Response 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.saml2.core.Response in project verify-hub by alphagov.
the class EncryptedResponseFromIdpValidatorTest method validateResponse_shouldThrowExceptionIfThereIsNoInResponseToAttribute.
@Test
public void validateResponse_shouldThrowExceptionIfThereIsNoInResponseToAttribute() throws Exception {
Response response = aResponse().withInResponseTo(null).build();
assertValidationFailure(response, SamlTransformationErrorFactory.missingInResponseTo());
}
Aggregations