aboutsummaryrefslogtreecommitdiff
path: root/connector/src/test
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2020-02-21 16:22:31 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2020-02-21 16:22:31 +0100
commit7ba8da297b7be40255ba5efb40c69a21fb130b3b (patch)
tree14294d39790209235180d6a1de48539e163e7ebf /connector/src/test
parentd5f104bf22d204732897ef7127ad704d43d7a194 (diff)
downloadNational_eIDAS_Gateway-7ba8da297b7be40255ba5efb40c69a21fb130b3b.tar.gz
National_eIDAS_Gateway-7ba8da297b7be40255ba5efb40c69a21fb130b3b.tar.bz2
National_eIDAS_Gateway-7ba8da297b7be40255ba5efb40c69a21fb130b3b.zip
update to latest EAAF-components that uses OpenSAML3.x
Diffstat (limited to 'connector/src/test')
-rw-r--r--connector/src/test/java/at/asitplus/eidas/specific/connector/test/AuthnRequestValidatorTest.java24
-rw-r--r--connector/src/test/resources/config/junit_config_1.properties12
-rw-r--r--connector/src/test/resources/config/keys/junit.jksbin0 -> 3980 bytes
3 files changed, 18 insertions, 18 deletions
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);
}
diff --git a/connector/src/test/resources/config/junit_config_1.properties b/connector/src/test/resources/config/junit_config_1.properties
index 3f290948..982d3e24 100644
--- a/connector/src/test/resources/config/junit_config_1.properties
+++ b/connector/src/test/resources/config/junit_config_1.properties
@@ -39,8 +39,8 @@ eidas.ms.auth.eIDAS.node_v2.loa.requested.minimum=http://eidas.europa.eu/LoA/sub
eidas.ms.auth.eIDAS.szrclient.useTestService=true
eidas.ms.auth.eIDAS.szrclient.endpoint.prod=
eidas.ms.auth.eIDAS.szrclient.endpoint.test=http://localhost:1234/demoszr
-eidas.ms.auth.eIDAS.szrclient.ssl.keyStore.path=keys/.....
-eidas.ms.auth.eIDAS.szrclient.ssl.keyStore.password=
+eidas.ms.auth.eIDAS.szrclient.ssl.keyStore.path=keys/junit.jks
+eidas.ms.auth.eIDAS.szrclient.ssl.keyStore.password=password
eidas.ms.auth.eIDAS.szrclient.ssl.trustStore.path=
eidas.ms.auth.eIDAS.szrclient.ssl.trustStore.password=
eidas.ms.auth.eIDAS.szrclient.timeout.connection=15
@@ -80,8 +80,8 @@ eidas.ms.auth.eIDAS.node_v2.attributes.requested.representation.5=LegalName,true
## PVP2 S-Profile end-point configuration
-eidas.ms.pvp2.keystore.path=keys/.....
-eidas.ms.pvp2.keystore.password=
+eidas.ms.pvp2.keystore.path=keys/junit.jks
+eidas.ms.pvp2.keystore.password=password
eidas.ms.pvp2.key.metadata.alias=
eidas.ms.pvp2.key.metadata.password=
eidas.ms.pvp2.key.signing.alias=
@@ -90,8 +90,8 @@ eidas.ms.pvp2.metadata.validity=24
## Service Provider configuration
eidas.ms.sp.0.uniqueID=
-eidas.ms.sp.0.pvp2.metadata.truststore=
-eidas.ms.sp.0.pvp2.metadata.truststore.password=
+eidas.ms.sp.0.pvp2.metadata.truststore=keys/junit.jks
+eidas.ms.sp.0.pvp2.metadata.truststore.password=password
#eidas.ms.sp.0.friendlyName=
#eidas.ms.sp.0.pvp2.metadata.url=
diff --git a/connector/src/test/resources/config/keys/junit.jks b/connector/src/test/resources/config/keys/junit.jks
new file mode 100644
index 00000000..59e6ad13
--- /dev/null
+++ b/connector/src/test/resources/config/keys/junit.jks
Binary files differ