aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/test/java/org/openecomp/sdc/be/components/HealthCheckBusinessLogicTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/test/java/org/openecomp/sdc/be/components/HealthCheckBusinessLogicTest.java')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/HealthCheckBusinessLogicTest.java23
1 files changed, 22 insertions, 1 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/HealthCheckBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/HealthCheckBusinessLogicTest.java
index 8d73b9e855..b0500fd5af 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/HealthCheckBusinessLogicTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/HealthCheckBusinessLogicTest.java
@@ -39,7 +39,7 @@ public class HealthCheckBusinessLogicTest {
private final SwitchoverDetector switchoverDetector = Mockito.mock(SwitchoverDetector.class);
- HealthCheckBusinessLogic healthCheckBusinessLogic = new HealthCheckBusinessLogic(switchoverDetector);
+ HealthCheckBusinessLogic healthCheckBusinessLogic = new HealthCheckBusinessLogic();
@Test
public void checkStausUpdated() {
@@ -56,10 +56,26 @@ public class HealthCheckBusinessLogicTest {
HealthCheckInfo checkInfoJanusGraphUp = new HealthCheckInfo(Constants.HC_COMPONENT_JANUSGRAPH, HealthCheckStatus.UP, null, null);
HealthCheckInfo checkInfoJanusGraphDown = new HealthCheckInfo(Constants.HC_COMPONENT_JANUSGRAPH, HealthCheckStatus.DOWN, null, null);
+ HealthCheckInfo checkInfoDmaapProducerUp = new HealthCheckInfo(Constants.HC_COMPONENT_DMAAP_PRODUCER, HealthCheckStatus.UP, null, null);
+
+ HealthCheckInfo healthCheckInfoCADIUp = new HealthCheckInfo(Constants.HC_COMPONENT_CADI, HealthCheckStatus.UP, null, null);
+
+ /*
+ * HealthCheckInfo checkInfoUebUp = new HealthCheckInfo(HealthCheckComponent.DE, HealthCheckStatus.UP, null, null); HealthCheckInfo checkInfoUebDown = new HealthCheckInfo(HealthCheckComponent.DE, HealthCheckStatus.DOWN, null, null);
+ */
+
checkInfosLeft.add(checkInfoJanusGraphUp);
checkInfosRight.add(checkInfoJanusGraphUp);
+ checkInfosLeft.add(checkInfoDmaapProducerUp);
+
+ checkInfosRight.add(checkInfoDmaapProducerUp);
+
+ checkInfosLeft.add(healthCheckInfoCADIUp);
+
+ checkInfosRight.add(healthCheckInfoCADIUp);
+
statusChanged = healthCheckBusinessLogic.anyStatusChanged(checkInfosLeft, checkInfosRight);
assertFalse("check false", statusChanged);
@@ -79,6 +95,11 @@ public class HealthCheckBusinessLogicTest {
statusChanged = healthCheckBusinessLogic.anyStatusChanged(checkInfosLeft, checkInfosRight);
assertFalse("check false", statusChanged);
+ checkInfosRight.remove(healthCheckInfoCADIUp);
+ statusChanged = healthCheckBusinessLogic.anyStatusChanged(checkInfosLeft, checkInfosRight);
+ assertTrue("check true", statusChanged);
+
+ checkInfosRight.add(healthCheckInfoCADIUp);
statusChanged = healthCheckBusinessLogic.anyStatusChanged(checkInfosLeft, null);
assertTrue("check true", statusChanged);