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 --- .../eIDASAttributePostProcessingTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'eidas_modules/authmodule-eIDAS-v2') 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