use of org.opensaml.saml2.core.Response 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.saml2.core.Response 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.saml2.core.Response in project verify-hub by alphagov.
the class EncryptedResponseFromIdpValidatorTest method validate_shouldThrowExceptionIfIssuerIdIsMissing.
@Test
public void validate_shouldThrowExceptionIfIssuerIdIsMissing() throws Exception {
Issuer issuer = anIssuer().withIssuerId(null).build();
Response response = aResponse().withIssuer(issuer).build();
assertValidationFailure(response, emptyIssuer());
}
use of org.opensaml.saml2.core.Response in project verify-hub by alphagov.
the class EncryptedResponseFromIdpValidatorTest 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 EncryptedResponseFromIdpValidatorTest method validateIssuer_shouldThrowExceptionIfFormatAttributeHasInvalidValue.
@Test
public void validateIssuer_shouldThrowExceptionIfFormatAttributeHasInvalidValue() throws Exception {
String invalidFormat = "goo";
Issuer issuer = anIssuer().withFormat(invalidFormat).build();
Response response = aResponse().withIssuer(issuer).build();
assertValidationFailure(response, illegalIssuerFormat(invalidFormat, NameIDType.ENTITY));
}
Aggregations