aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckProvider.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckProvider.java')
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckProvider.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckProvider.java b/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckProvider.java
index bdf4700c..ff2159d2 100644
--- a/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckProvider.java
+++ b/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckProvider.java
@@ -2,6 +2,7 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2020 Nordix Foundation.
* Modifications Copyright (C) 2020 AT&T Corp.
+ * Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -193,6 +194,14 @@ public class TestPolicyComponentsHealthCheckProvider {
}
@Test
+ public void testFetchPolicyComponentsHealthStatus_PdpDown() {
+ // Set currentInstanceCount as 0 to simulate PDP down
+ groups.get(0).getPdpSubgroups().get(0).setCurrentInstanceCount(0);
+ Map<String, Object> result = callFetchPolicyComponentsHealthStatus();
+ assertFalse((Boolean) result.get(HEALTHY));
+ }
+
+ @Test
public void testFetchPolicyComponentsHealthStatus_unhealthyPap() {
when(papActivator.isAlive()).thenReturn(false);
Map<String, Object> result = callFetchPolicyComponentsHealthStatus();