summaryrefslogtreecommitdiff
path: root/eaaf_modules
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2020-08-03 09:11:39 +0200
committerThomas Lenz <thomas.lenz@egiz.gv.at>2020-08-03 09:11:39 +0200
commit6e803872d1de98b306f781640b694ba48738b00b (patch)
tree6e8bb08ff5acd0f96f31f966e2b490d43c551751 /eaaf_modules
parent2cb55c1694e0c8c8e957789f7754a8dc8c5397d1 (diff)
downloadEAAF-Components-6e803872d1de98b306f781640b694ba48738b00b.tar.gz
EAAF-Components-6e803872d1de98b306f781640b694ba48738b00b.tar.bz2
EAAF-Components-6e803872d1de98b306f781640b694ba48738b00b.zip
fix wrong PackageName in SPI loader configuration
Diffstat (limited to 'eaaf_modules')
-rw-r--r--eaaf_modules/eaaf_module_moa-sig/pom.xml7
-rw-r--r--eaaf_modules/eaaf_module_moa-sig/src/main/resources/META-INF/services/at.gv.egiz.components.spring.api.SpringResourceProvider2
-rw-r--r--eaaf_modules/eaaf_module_moa-sig/src/test/java/at/gv/egiz/eaaf/modules/sigverify/moasig/test/MoaSigSpringResourceProviderTest.java52
3 files changed, 59 insertions, 2 deletions
diff --git a/eaaf_modules/eaaf_module_moa-sig/pom.xml b/eaaf_modules/eaaf_module_moa-sig/pom.xml
index e147a38e..3ee44753 100644
--- a/eaaf_modules/eaaf_module_moa-sig/pom.xml
+++ b/eaaf_modules/eaaf_module_moa-sig/pom.xml
@@ -172,7 +172,12 @@
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
diff --git a/eaaf_modules/eaaf_module_moa-sig/src/main/resources/META-INF/services/at.gv.egiz.components.spring.api.SpringResourceProvider b/eaaf_modules/eaaf_module_moa-sig/src/main/resources/META-INF/services/at.gv.egiz.components.spring.api.SpringResourceProvider
index 2f0ae67f..a0a1d413 100644
--- a/eaaf_modules/eaaf_module_moa-sig/src/main/resources/META-INF/services/at.gv.egiz.components.spring.api.SpringResourceProvider
+++ b/eaaf_modules/eaaf_module_moa-sig/src/main/resources/META-INF/services/at.gv.egiz.components.spring.api.SpringResourceProvider
@@ -1 +1 @@
-at.gv.egiz.eid.authhandler.modules.sigverify.moasig.impl.MoaSigSpringResourceProvider \ No newline at end of file
+at.gv.egiz.eaaf.modules.sigverify.moasig.impl.MoaSigSpringResourceProvider \ No newline at end of file
diff --git a/eaaf_modules/eaaf_module_moa-sig/src/test/java/at/gv/egiz/eaaf/modules/sigverify/moasig/test/MoaSigSpringResourceProviderTest.java b/eaaf_modules/eaaf_module_moa-sig/src/test/java/at/gv/egiz/eaaf/modules/sigverify/moasig/test/MoaSigSpringResourceProviderTest.java
new file mode 100644
index 00000000..341c5a8c
--- /dev/null
+++ b/eaaf_modules/eaaf_module_moa-sig/src/test/java/at/gv/egiz/eaaf/modules/sigverify/moasig/test/MoaSigSpringResourceProviderTest.java
@@ -0,0 +1,52 @@
+package at.gv.egiz.eaaf.modules.sigverify.moasig.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.gv.egiz.eaaf.modules.sigverify.moasig.impl.MoaSigSpringResourceProvider;
+
+
+
+@RunWith(BlockJUnit4ClassRunner.class)
+public class MoaSigSpringResourceProviderTest {
+
+ static final String TEST_SPI_LOADER_PATH =
+ "/META-INF/services/at.gv.egiz.components.spring.api.SpringResourceProvider";
+
+ @Test
+ public void testSpringConfig() {
+ final MoaSigSpringResourceProvider test = new MoaSigSpringResourceProvider();
+ for (final Resource el : test.getResourcesToLoad()) {
+ try {
+ IOUtils.toByteArray(el.getInputStream());
+
+ } catch (final IOException e) {
+ Assert.fail("Ressouce: " + el.getFilename() + " not found");
+ }
+
+ }
+ }
+
+ @Test
+ public void testSpiLoaderConfig() {
+ final InputStream el = this.getClass().getResourceAsStream(TEST_SPI_LOADER_PATH);
+ try {
+ final String spiFile = IOUtils.toString(el, "UTF-8");
+
+ Assert.assertEquals("Wrong classpath in SPI file", MoaSigSpringResourceProvider.class.getName(),
+ spiFile);
+
+
+ } catch (final IOException e) {
+ Assert.fail("Ressouce: " + TEST_SPI_LOADER_PATH + " not found");
+ }
+
+ }
+}