From 7ba8da297b7be40255ba5efb40c69a21fb130b3b Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 21 Feb 2020 16:22:31 +0100 Subject: update to latest EAAF-components that uses OpenSAML3.x --- .../connector/test/AuthnRequestValidatorTest.java | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'connector/src/test/java/at') diff --git a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/AuthnRequestValidatorTest.java b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/AuthnRequestValidatorTest.java index db863815..e34c8036 100644 --- a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/AuthnRequestValidatorTest.java +++ b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/AuthnRequestValidatorTest.java @@ -12,11 +12,11 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; -import org.opensaml.saml2.core.AuthnRequest; -import org.opensaml.xml.ConfigurationException; -import org.opensaml.xml.io.Unmarshaller; -import org.opensaml.xml.io.UnmarshallerFactory; -import org.opensaml.xml.io.UnmarshallingException; +import org.opensaml.core.config.InitializationException; +import org.opensaml.core.xml.io.Unmarshaller; +import org.opensaml.core.xml.io.UnmarshallingException; +import org.opensaml.core.xml.util.XMLObjectSupport; +import org.opensaml.saml.saml2.core.AuthnRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; @@ -38,7 +38,8 @@ import at.gv.egiz.eaaf.core.exceptions.AuthnRequestValidatorException; import at.gv.egiz.eaaf.core.impl.idp.module.test.TestRequestImpl; import at.gv.egiz.eaaf.core.impl.utils.DomUtils; import at.gv.egiz.eaaf.modules.pvp2.api.validation.IAuthnRequestPostProcessor; -import at.gv.egiz.eaaf.modules.pvp2.impl.opensaml.initialize.EaafDefaultSaml2Bootstrap; +import at.gv.egiz.eaaf.modules.pvp2.impl.opensaml.initialize.EaafOpenSaml3xInitializer; +import net.shibboleth.utilities.java.support.component.ComponentInitializationException; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration({ @@ -61,15 +62,16 @@ public class AuthnRequestValidatorTest { /** * jUnit class initializer. - * @throws ConfigurationException In case of an error + * @throws ComponentInitializationException In case of an error + * @throws InitializationException In case of an error * */ @BeforeClass - public static void classInitializer() throws ConfigurationException { + public static void classInitializer() throws InitializationException, ComponentInitializationException { final String current = new java.io.File(".").toURI().toString(); System.setProperty("eidas.ms.configuration", current + "src/test/resources/config/junit_config_1.properties"); - EaafDefaultSaml2Bootstrap.bootstrap(); + EaafOpenSaml3xInitializer.eaafInitialize(); } /** @@ -286,9 +288,7 @@ public class AuthnRequestValidatorTest { final Element authBlockDom = DomUtils.parseXmlValidating(AuthnRequestValidatorTest.class.getResourceAsStream(resource)); - final UnmarshallerFactory unmarshallerFactory = - org.opensaml.xml.Configuration.getUnmarshallerFactory(); - final Unmarshaller unmarshaller = unmarshallerFactory.getUnmarshaller(authBlockDom); + final Unmarshaller unmarshaller = XMLObjectSupport.getUnmarshaller(authBlockDom); return (AuthnRequest) unmarshaller.unmarshall(authBlockDom); } -- cgit v1.2.3