summaryrefslogtreecommitdiff
path: root/eaaf_core_utils/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'eaaf_core_utils/src/test')
-rw-r--r--eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/credentials/EaafKeyStoreFactoryTest.java24
1 files changed, 23 insertions, 1 deletions
diff --git a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/credentials/EaafKeyStoreFactoryTest.java b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/credentials/EaafKeyStoreFactoryTest.java
index fc945fdd..6a24f6b4 100644
--- a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/credentials/EaafKeyStoreFactoryTest.java
+++ b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/credentials/EaafKeyStoreFactoryTest.java
@@ -4,6 +4,7 @@ import java.security.Key;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.Provider;
+import java.security.Security;
import java.security.cert.X509Certificate;
import java.util.List;
@@ -27,6 +28,7 @@ import com.google.common.base.Predicates;
import com.google.common.base.Throwables;
import com.google.common.collect.FluentIterable;
+import at.asitplus.hsmfacade.provider.HsmFacadeProvider;
import at.gv.egiz.eaaf.core.exception.EaafKeyAccessException;
import at.gv.egiz.eaaf.core.exceptions.EaafConfigurationException;
import at.gv.egiz.eaaf.core.exceptions.EaafException;
@@ -73,7 +75,8 @@ public class EaafKeyStoreFactoryTest {
@Before
public void testSetup() {
mapConfig.clearAllConfig();
-
+ Security.removeProvider(HsmFacadeProvider.getInstance().getName());
+
}
@Test
@@ -434,6 +437,14 @@ public class EaafKeyStoreFactoryTest {
Assert.assertNull("Provider is not null", key.getSecond());
}
+
+ @Test
+ @DirtiesContext
+ public void hsmFacadeNoHostConfig() {
+ context.getBean(EaafKeyStoreFactory.class);
+
+ }
+
@Test
@DirtiesContext
@@ -600,6 +611,17 @@ public class EaafKeyStoreFactoryTest {
@Test
@DirtiesContext
+ public void hsmFacadeAlreadLoaded() {
+ HsmFacadeProvider provider = HsmFacadeProvider.getInstance();
+ Security.addProvider(provider);
+
+ final EaafKeyStoreFactory keyStoreFactory = context.getBean(EaafKeyStoreFactory.class);
+ Assert.assertTrue("HSM Facade state wrong", keyStoreFactory.isHsmFacadeInitialized());
+
+ }
+
+ @Test
+ @DirtiesContext
public void hsmFacadeKeyStoreNoKeyStoreName() {
configureHsmFacade();