From 322aaeb442d0d1e1744e60416aa4e434985dd36e Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Wed, 11 Sep 2019 07:06:36 +0200 Subject: fix broken jUnit test --- basicConfig/default_config.properties | 4 ++-- .../eIDASAttributePostProcessingTest.java | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/basicConfig/default_config.properties b/basicConfig/default_config.properties index 71de5b2b..df18c646 100644 --- a/basicConfig/default_config.properties +++ b/basicConfig/default_config.properties @@ -29,8 +29,8 @@ eidas.ms.auth.eIDAS.node_v2.workarounds.useRequestIdAsTransactionIdentifier=true eidas.ms.auth.eIDAS.node_v2.loa.requested.minimum=http://eidas.europa.eu/LoA/high eidas.ms.auth.eIDAS.szrclient.useTestService=true -eidas.ms.auth.eIDAS.szrclient.endpoint.prod= -eidas.ms.auth.eIDAS.szrclient.endpoint.test= +eidas.ms.auth.eIDAS.szrclient.endpoint.prod=http://prodszr.test +eidas.ms.auth.eIDAS.szrclient.endpoint.test=http://testszr.test eidas.ms.auth.eIDAS.szrclient.ssl.keyStore.path=keys/..... eidas.ms.auth.eIDAS.szrclient.ssl.keyStore.password= eidas.ms.auth.eIDAS.szrclient.ssl.trustStore.path= diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/test/eidas/specific/modules/authmodule_eIDASv2/eIDASAttributePostProcessingTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/test/eidas/specific/modules/authmodule_eIDASv2/eIDASAttributePostProcessingTest.java index ed09ea2d..cd7895ba 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/test/eidas/specific/modules/authmodule_eIDASv2/eIDASAttributePostProcessingTest.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/test/eidas/specific/modules/authmodule_eIDASv2/eIDASAttributePostProcessingTest.java @@ -24,11 +24,13 @@ package at.asitplus.test.eidas.specific.modules.authmodule_eIDASv2; import static org.junit.Assert.fail; +import java.io.File; import java.text.SimpleDateFormat; import java.util.HashMap; import java.util.Map; import org.joda.time.DateTime; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -43,6 +45,18 @@ import at.asitplus.eidas.specific.modules.authmodule_eIDASv2.service.EIDPostProc @ContextConfiguration("/SpringTest-context_basic_test.xml") public class eIDASAttributePostProcessingTest { + @BeforeClass + public static void classInitializer() throws Exception { + final String currentDir = new java.io.File( "." ).getCanonicalPath(); + File configFile = new java.io.File(currentDir + "./../../basicConfig/default_config.properties"); + if (!configFile.exists()) { + throw new Exception("Default Configuration not found. Test will will be FAIL"); + + } + System.setProperty("eidas.ms.configuration", configFile.toURI().toASCIIString()); + + } + @Autowired private EIDPostProcessingService postProcessor; //lower case -- cgit v1.2.3