use of org.opensaml.saml2.core.Response in project verify-hub by alphagov.
the class EncryptedResponseFromMatchingServiceValidatorTest method validate_shouldThrowExceptionIfIdIsMissing.
@Test
public void validate_shouldThrowExceptionIfIdIsMissing() throws Exception {
Response response = aResponse().withId(null).build();
assertValidationFailure(response, missingId());
}
use of org.opensaml.saml2.core.Response in project verify-hub by alphagov.
the class EncryptedResponseFromMatchingServiceValidatorTest method validateRequest_shouldThrowExceptionIfResponseDoesNotContainASignature.
@Test
public void validateRequest_shouldThrowExceptionIfResponseDoesNotContainASignature() throws Exception {
Response response = aResponse().withoutSignatureElement().build();
assertValidationFailure(response, missingSignature());
}
use of org.opensaml.saml2.core.Response in project verify-hub by alphagov.
the class EncryptedResponseFromMatchingServiceValidatorTest method validateResponse_shouldThrowExceptionForFailureResponsesWithAssertions.
@Test
public void validateResponse_shouldThrowExceptionForFailureResponsesWithAssertions() throws Exception {
Status status = createStatus(StatusCode.RESPONDER, createSubStatusCode(SamlStatusCode.NO_MATCH));
Response response = aResponse().withStatus(status).build();
assertValidationFailure(response, nonSuccessHasUnEncryptedAssertions());
}
use of org.opensaml.saml2.core.Response in project verify-hub by alphagov.
the class EncryptedResponseFromMatchingServiceValidatorTest method validate_shouldThrowIfResponseContainsTooManyAssertions.
@Test
public void validate_shouldThrowIfResponseContainsTooManyAssertions() throws Exception {
Response response = aResponse().withStatus(happyStatus).addEncryptedAssertion(anAssertion().build()).addEncryptedAssertion(anAssertion().build()).build();
assertValidationFailure(response, unexpectedNumberOfAssertions(1, 2));
}
use of org.opensaml.saml2.core.Response in project verify-hub by alphagov.
the class EncryptedResponseFromMatchingServiceValidatorTest method validate_shouldThrowInvalidSamlExceptionIfIssuerIdIsMissing.
@Test
public void validate_shouldThrowInvalidSamlExceptionIfIssuerIdIsMissing() throws Exception {
Issuer issuer = anIssuer().withIssuerId(null).build();
Response response = aResponse().withIssuer(issuer).build();
assertValidationFailure(response, emptyIssuer());
}
Aggregations