use of org.opensaml.saml2.core.Assertion in project verify-hub by alphagov.
the class IPAddressValidatorTest method validate_shouldNotThrowWhenSecondAttributeStatementContainsAnIPAddressAttribute.
@Test
public void validate_shouldNotThrowWhenSecondAttributeStatementContainsAnIPAddressAttribute() throws Exception {
Assertion assertion = anAssertion().addAttributeStatement(anAttributeStatement().build()).addAttributeStatement(anAttributeStatement().addAttribute(IPAddressAttributeBuilder.anIPAddress().build()).build()).buildUnencrypted();
validator.validate(assertion);
}
use of org.opensaml.saml2.core.Assertion in project verify-hub by alphagov.
the class IPAddressValidatorTest method validate_shouldNotThrowWhenFirstAttributeStatementContainsMultipleAttributesIncludingIPAddressAttribute.
@Test
public void validate_shouldNotThrowWhenFirstAttributeStatementContainsMultipleAttributesIncludingIPAddressAttribute() throws Exception {
Assertion assertion = anAssertion().addAttributeStatement(anAttributeStatement().addAttribute(aPersonName_1_1().buildAsFirstname()).addAttribute(IPAddressAttributeBuilder.anIPAddress().build()).build()).buildUnencrypted();
validator.validate(assertion);
}
use of org.opensaml.saml2.core.Assertion in project verify-hub by alphagov.
the class IPAddressValidatorTest method validate_shouldNotThrowWhenFirstAttributeStatementContainsAnIPAddressAttribute.
@Test
public void validate_shouldNotThrowWhenFirstAttributeStatementContainsAnIPAddressAttribute() throws Exception {
Assertion assertion = anAssertion().addAttributeStatement(anAttributeStatement().addAttribute(IPAddressAttributeBuilder.anIPAddress().build()).build()).buildUnencrypted();
validator.validate(assertion);
}
use of org.opensaml.saml2.core.Assertion in project verify-hub by alphagov.
the class IPAddressValidatorTest method validate_shouldThrowWhenAssertionContainsAttributeStatementsButNoIPAddressAttribute.
@Test
public void validate_shouldThrowWhenAssertionContainsAttributeStatementsButNoIPAddressAttribute() throws Exception {
Assertion assertion = anAssertion().addAttributeStatement(anAttributeStatement().build()).buildUnencrypted();
validateException(SamlTransformationErrorFactory.missingIPAddress(assertion.getID()), assertion);
}
use of org.opensaml.saml2.core.Assertion in project verify-hub by alphagov.
the class PassthroughAssertionUnmarshallerTest method transform_shouldThrowExceptionIfGpg45StatusIsNotRecognised.
@Test
public void transform_shouldThrowExceptionIfGpg45StatusIsNotRecognised() {
Assertions.assertThrows(IllegalStateException.class, () -> {
String gpg45Status = "status not known";
Assertion theAssertion = givenAFraudEventAssertion(gpg45Status);
unmarshaller.fromAssertion(theAssertion);
});
}
Aggregations