diff options
author | Thomas <> | 2022-03-11 11:49:05 +0100 |
---|---|---|
committer | Thomas <> | 2022-06-03 07:23:47 +0200 |
commit | e8e75813ab549d03b0ac482fe0e1e86ee660b8b0 (patch) | |
tree | 5411fc294d9de60980fa971900c8a32460928e47 /ms_specific_proxyservice/src/test/java/at | |
parent | 86da2487154632cfe5b280ffd87933d08571029b (diff) | |
download | National_eIDAS_Gateway-e8e75813ab549d03b0ac482fe0e1e86ee660b8b0.tar.gz National_eIDAS_Gateway-e8e75813ab549d03b0ac482fe0e1e86ee660b8b0.tar.bz2 National_eIDAS_Gateway-e8e75813ab549d03b0ac482fe0e1e86ee660b8b0.zip |
chore(proxy): add module for stand-alone ms-specific proxy-service application
Diffstat (limited to 'ms_specific_proxyservice/src/test/java/at')
-rw-r--r-- | ms_specific_proxyservice/src/test/java/at/asitplus/eidas/specific/proxy/test/MsConnectorSpringResourceProviderTest.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/ms_specific_proxyservice/src/test/java/at/asitplus/eidas/specific/proxy/test/MsConnectorSpringResourceProviderTest.java b/ms_specific_proxyservice/src/test/java/at/asitplus/eidas/specific/proxy/test/MsConnectorSpringResourceProviderTest.java new file mode 100644 index 00000000..2da6b316 --- /dev/null +++ b/ms_specific_proxyservice/src/test/java/at/asitplus/eidas/specific/proxy/test/MsConnectorSpringResourceProviderTest.java @@ -0,0 +1,56 @@ +package at.asitplus.eidas.specific.proxy.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.proxy.MsSpecificEidasProxySpringResourceProvider; +import at.gv.egiz.eaaf.core.test.TestConstants; + + + +@RunWith(BlockJUnit4ClassRunner.class) +public class MsConnectorSpringResourceProviderTest { + + @Test + public void testSpringConfig() { + final MsSpecificEidasProxySpringResourceProvider test = + new MsSpecificEidasProxySpringResourceProvider(); + 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", + MsSpecificEidasProxySpringResourceProvider.class.getName(), spiFile); + + + } catch (final IOException e) { + Assert.fail("Ressouce: " + TestConstants.TEST_SPI_LOADER_PATH + " not found"); + + } + } + +} |