diff options
author | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2021-01-22 12:16:21 +0100 |
---|---|---|
committer | Thomas <> | 2022-03-03 16:31:56 +0100 |
commit | bab20b30d6a2ed9c5a6e739260027d23b933dc00 (patch) | |
tree | 4c20511caea428af15832799c48d57ce5130c3dc /eidas_modules/eidas_proxy-sevice/src/test/java/at/asitplus/eidas/specific | |
parent | 1da1de0c549f98facfe71887e0d7f29825cfedfe (diff) | |
download | National_eIDAS_Gateway-bab20b30d6a2ed9c5a6e739260027d23b933dc00.tar.gz National_eIDAS_Gateway-bab20b30d6a2ed9c5a6e739260027d23b933dc00.tar.bz2 National_eIDAS_Gateway-bab20b30d6a2ed9c5a6e739260027d23b933dc00.zip |
add basic modules for integration of MS-specific eIDAS Proxy-Service
Diffstat (limited to 'eidas_modules/eidas_proxy-sevice/src/test/java/at/asitplus/eidas/specific')
-rw-r--r-- | eidas_modules/eidas_proxy-sevice/src/test/java/at/asitplus/eidas/specific/modules/auth/idaustria/test/MsProxyServiceSpringResourceProviderTest.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/eidas_modules/eidas_proxy-sevice/src/test/java/at/asitplus/eidas/specific/modules/auth/idaustria/test/MsProxyServiceSpringResourceProviderTest.java b/eidas_modules/eidas_proxy-sevice/src/test/java/at/asitplus/eidas/specific/modules/auth/idaustria/test/MsProxyServiceSpringResourceProviderTest.java new file mode 100644 index 00000000..8c6da366 --- /dev/null +++ b/eidas_modules/eidas_proxy-sevice/src/test/java/at/asitplus/eidas/specific/modules/auth/idaustria/test/MsProxyServiceSpringResourceProviderTest.java @@ -0,0 +1,56 @@ +package at.asitplus.eidas.specific.modules.auth.idaustria.test; + +import java.io.IOException; +import java.io.InputStream; + +import org.apache.commons.io.IOUtils; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.BlockJUnit4ClassRunner; +import org.springframework.core.io.Resource; + +import at.asitplus.eidas.specific.modules.msproxyservice.MsProxyServiceSpringResourceProvider; +import at.gv.egiz.eaaf.core.test.TestConstants; + + + +@RunWith(BlockJUnit4ClassRunner.class) +public class MsProxyServiceSpringResourceProviderTest { + + @Test + public void testSpringConfig() { + final MsProxyServiceSpringResourceProvider test = + new MsProxyServiceSpringResourceProvider(); + for (final Resource el : test.getResourcesToLoad()) { + try { + IOUtils.toByteArray(el.getInputStream()); + + } catch (final IOException e) { + Assert.fail("Ressouce: " + el.getFilename() + " not found"); + } + + } + + Assert.assertNotNull("no Name", test.getName()); + Assert.assertNull("Find package definitions", test.getPackagesToScan()); + + } + + @Test + public void testSpILoaderConfig() { + final InputStream el = this.getClass().getResourceAsStream(TestConstants.TEST_SPI_LOADER_PATH); + try { + final String spiFile = IOUtils.toString(el, "UTF-8"); + + Assert.assertEquals("Wrong classpath in SPI file", + MsProxyServiceSpringResourceProvider.class.getName(), spiFile); + + + } catch (final IOException e) { + Assert.fail("Ressouce: " + TestConstants.TEST_SPI_LOADER_PATH + " not found"); + + } + } + +} |