use of uk.gov.ida.saml.serializers.XmlObjectToElementTransformer in project verify-hub by alphagov.
the class EntitiesDescriptorToElementTransformerTest method transform_shouldTransformASamlObjectIntoAnElement.
@Test
public void transform_shouldTransformASamlObjectIntoAnElement() {
AuthnRequest authnRequest = anAuthnRequest().withIssuer(anIssuer().build()).build();
XmlObjectToElementTransformer<AuthnRequest> transformer = new XmlObjectToElementTransformer<>();
Element result = transformer.apply(authnRequest);
assertThat(result).isNotNull();
}
use of uk.gov.ida.saml.serializers.XmlObjectToElementTransformer in project verify-hub by alphagov.
the class MatchingServiceRequestSenderTest method createMsaResponse.
private static String createMsaResponse() throws MarshallingException, SignatureException {
Credential signingCredential = msaSigningCredential;
org.opensaml.saml.saml2.core.Response response = aResponse().withIssuer(IssuerBuilder.anIssuer().withIssuerId(TEST_RP_MS).build()).withSigningCredential(signingCredential).build();
Document soapEnvelope = new SoapMessageManager().wrapWithSoapEnvelope(new XmlObjectToElementTransformer<>().apply(response));
return XmlUtils.writeToString(soapEnvelope);
}
Aggregations