use of org.opensaml.saml.saml2.core.Status 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.saml.saml2.core.Status in project verify-hub by alphagov.
the class MatchingServiceIdaStatusUnmarshallerTest method transform_shouldTransformHealthyStatusFromMatchingService.
@Test
public void transform_shouldTransformHealthyStatusFromMatchingService() {
OpenSamlXmlObjectFactory samlObjectFactory = new OpenSamlXmlObjectFactory();
Status status = samlObjectFactory.createStatus();
StatusCode topLevelStatusCode = samlObjectFactory.createStatusCode();
topLevelStatusCode.setValue(StatusCode.SUCCESS);
status.setStatusCode(topLevelStatusCode);
StatusCode subStatusCode = samlObjectFactory.createStatusCode();
subStatusCode.setValue(SamlStatusCode.HEALTHY);
topLevelStatusCode.setStatusCode(subStatusCode);
MatchingServiceIdaStatus transformedStatus = unmarshaller.fromSaml(status);
assertThat(transformedStatus).isEqualTo(MatchingServiceIdaStatus.Healthy);
}
use of org.opensaml.saml.saml2.core.Status in project verify-hub by alphagov.
the class MatchingServiceIdaStatusUnmarshallerTest method transform_shouldTransformNoMatchFromMatchingService.
@Test
public void transform_shouldTransformNoMatchFromMatchingService() {
OpenSamlXmlObjectFactory samlObjectFactory = new OpenSamlXmlObjectFactory();
Status originalStatus = samlObjectFactory.createStatus();
StatusCode topLevelStatusCode = samlObjectFactory.createStatusCode();
topLevelStatusCode.setValue(StatusCode.RESPONDER);
StatusCode subStatusCode = samlObjectFactory.createStatusCode();
subStatusCode.setValue(SamlStatusCode.NO_MATCH);
topLevelStatusCode.setStatusCode(subStatusCode);
originalStatus.setStatusCode(topLevelStatusCode);
MatchingServiceIdaStatus transformedStatus = unmarshaller.fromSaml(originalStatus);
assertThat(transformedStatus).isEqualTo(MatchingServiceIdaStatus.NoMatchingServiceMatchFromMatchingService);
}
use of org.opensaml.saml.saml2.core.Status in project verify-hub by alphagov.
the class MatchingServiceIdaStatusUnmarshallerTest method transform_shouldTransformRequesterErrorFromMatchingService.
@Test
public void transform_shouldTransformRequesterErrorFromMatchingService() {
OpenSamlXmlObjectFactory samlObjectFactory = new OpenSamlXmlObjectFactory();
Status originalStatus = samlObjectFactory.createStatus();
StatusCode topLevelStatusCode = samlObjectFactory.createStatusCode();
topLevelStatusCode.setValue(StatusCode.REQUESTER);
originalStatus.setStatusCode(topLevelStatusCode);
MatchingServiceIdaStatus transformedStatus = unmarshaller.fromSaml(originalStatus);
assertThat(transformedStatus).isEqualTo(MatchingServiceIdaStatus.RequesterError);
}
use of org.opensaml.saml.saml2.core.Status in project verify-hub by alphagov.
the class MatchingServiceIdaStatusUnmarshallerTest method transform_shouldTransformMatchingServiceSuccessfulMatch.
@Test
public void transform_shouldTransformMatchingServiceSuccessfulMatch() {
OpenSamlXmlObjectFactory samlObjectFactory = new OpenSamlXmlObjectFactory();
Status originalStatus = samlObjectFactory.createStatus();
StatusCode successStatusCode = samlObjectFactory.createStatusCode();
successStatusCode.setValue(StatusCode.SUCCESS);
originalStatus.setStatusCode(successStatusCode);
StatusCode matchStatusCode = samlObjectFactory.createStatusCode();
matchStatusCode.setValue(SamlStatusCode.MATCH);
successStatusCode.setStatusCode(matchStatusCode);
MatchingServiceIdaStatus transformedStatus = unmarshaller.fromSaml(originalStatus);
assertThat(transformedStatus).isEqualTo(MatchingServiceIdaStatus.MatchingServiceMatch);
}
Aggregations