summaryrefslogtreecommitdiff
path: root/eaaf-springboot-utils/src/test/java
diff options
context:
space:
mode:
authorThomas <>2021-10-22 11:44:37 +0200
committerThomas <>2021-10-22 11:44:37 +0200
commit9eca51b62ef6f69788d5af3a11ffd3191965cf65 (patch)
tree01f1b6eceac84a22688a1e7616b523b6ca138bb7 /eaaf-springboot-utils/src/test/java
parent405cd6a73cf0c31a15ca0e8c254ac4f431a15fe2 (diff)
downloadEAAF-Components-9eca51b62ef6f69788d5af3a11ffd3191965cf65.tar.gz
EAAF-Components-9eca51b62ef6f69788d5af3a11ffd3191965cf65.tar.bz2
EAAF-Components-9eca51b62ef6f69788d5af3a11ffd3191965cf65.zip
add deadline into HSM-Facade Health-Check that fails this test if HSM-Facade does not responde
Diffstat (limited to 'eaaf-springboot-utils/src/test/java')
-rw-r--r--eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/actuator/HsmFacadeProviderHealthCheckNoKeyStoreFactoryTest.java3
-rw-r--r--eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/actuator/HsmFacadeProviderHealthCheckTest.java2
2 files changed, 4 insertions, 1 deletions
diff --git a/eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/actuator/HsmFacadeProviderHealthCheckNoKeyStoreFactoryTest.java b/eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/actuator/HsmFacadeProviderHealthCheckNoKeyStoreFactoryTest.java
index 92c88544..9d3c0d02 100644
--- a/eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/actuator/HsmFacadeProviderHealthCheckNoKeyStoreFactoryTest.java
+++ b/eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/actuator/HsmFacadeProviderHealthCheckNoKeyStoreFactoryTest.java
@@ -8,6 +8,8 @@ import org.mockito.Mock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;
+import org.springframework.test.annotation.DirtiesContext;
+import org.springframework.test.annotation.DirtiesContext.ClassMode;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -16,6 +18,7 @@ import at.gv.egiz.eaaf.utils.springboot.actuator.HsmFacadeProviderHealthCheck;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/spring/test_spring_actuator.xml")
+@DirtiesContext(classMode = ClassMode.BEFORE_CLASS)
public class HsmFacadeProviderHealthCheckNoKeyStoreFactoryTest {
@Mock
diff --git a/eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/actuator/HsmFacadeProviderHealthCheckTest.java b/eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/actuator/HsmFacadeProviderHealthCheckTest.java
index 29feee5e..d6bdf26a 100644
--- a/eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/actuator/HsmFacadeProviderHealthCheckTest.java
+++ b/eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/actuator/HsmFacadeProviderHealthCheckTest.java
@@ -88,7 +88,7 @@ public class HsmFacadeProviderHealthCheckTest {
Health status = check.health();
//validate result
- Assert.assertEquals("wrong statusCode", Status.UNKNOWN.getCode(), status.getStatus().getCode());
+ Assert.assertEquals("wrong statusCode", Status.OUT_OF_SERVICE.getCode(), status.getStatus().getCode());
}