use of org.opensaml.saml.saml2.core.StatusCode 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.StatusCode 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.StatusCode 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.StatusCode 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);
}
use of org.opensaml.saml.saml2.core.StatusCode in project verify-hub by alphagov.
the class TransactionIdaStatusUnmarshallerTest method transform_shouldTransformNoMatchFromHub.
@Test
public void transform_shouldTransformNoMatchFromHub() {
OpenSamlXmlObjectFactory samlObjectFactory = new OpenSamlXmlObjectFactory();
Status originalStatus = samlObjectFactory.createStatus();
StatusCode topLevelStatusCode = samlObjectFactory.createStatusCode();
topLevelStatusCode.setValue(StatusCode.SUCCESS);
StatusCode subStatusCode = samlObjectFactory.createStatusCode();
subStatusCode.setValue(SamlStatusCode.NO_MATCH);
topLevelStatusCode.setStatusCode(subStatusCode);
originalStatus.setStatusCode(topLevelStatusCode);
TransactionIdaStatus transformedStatus = unmarshaller.fromSaml(originalStatus);
assertThat(transformedStatus).isEqualTo(TransactionIdaStatus.NoMatchingServiceMatchFromHub);
}
Aggregations