use of org.opensaml.saml2.core.Response in project verify-hub by alphagov.
the class EncryptedResponseFromMatchingServiceValidatorTest method validateIssuer_shouldDoNothingIfFormatAttributeIsMissing.
@Test
public void validateIssuer_shouldDoNothingIfFormatAttributeIsMissing() throws Exception {
Issuer issuer = anIssuer().withFormat(null).build();
Response response = aResponse().withIssuer(issuer).withStatus(happyStatus).build();
validator.validate(response);
}
use of org.opensaml.saml2.core.Response in project verify-hub by alphagov.
the class EncryptedResponseFromMatchingServiceValidatorTest method validateResponse_shouldThrowExceptionIfResponseHasUnencryptedAssertion.
@Test
public void validateResponse_shouldThrowExceptionIfResponseHasUnencryptedAssertion() throws Exception {
Assertion assertion = anAssertion().buildUnencrypted();
Response response = aResponse().withStatus(happyStatus).addAssertion(assertion).build();
assertValidationFailure(response, unencryptedAssertion());
}
use of org.opensaml.saml2.core.Response in project verify-hub by alphagov.
the class EncryptedResponseFromMatchingServiceValidatorTest method validateResponse_shouldThrowExceptionForSuccessResponsesWithNoAssertions.
@Test
public void validateResponse_shouldThrowExceptionForSuccessResponsesWithNoAssertions() throws Exception {
Response response = aResponse().withStatus(happyStatus).withNoDefaultAssertion().build();
assertValidationFailure(response, missingSuccessUnEncryptedAssertions());
}
use of org.opensaml.saml2.core.Response 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);
}
use of org.opensaml.saml2.core.Response in project verify-hub by alphagov.
the class EncryptedResponseFromMatchingServiceValidatorTest method validate_shouldThrowExceptionIfSubStatusIsNull.
@Test
public void validate_shouldThrowExceptionIfSubStatusIsNull() throws Exception {
Response response = aResponse().withStatus(createStatus(StatusCode.SUCCESS)).build();
assertValidationFailure(response, SamlTransformationErrorFactory.missingSubStatus());
}
Aggregations