From 9eca51b62ef6f69788d5af3a11ffd3191965cf65 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Fri, 22 Oct 2021 11:44:37 +0200 Subject: add deadline into HSM-Facade Health-Check that fails this test if HSM-Facade does not responde --- .../actuator/HsmFacadeProviderHealthCheckNoKeyStoreFactoryTest.java | 3 +++ .../springboot/test/actuator/HsmFacadeProviderHealthCheckTest.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf') 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()); } -- cgit v1.2.3