aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/test')
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/rest/TestHealthCheckRestControllerV1.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/TestHealthCheckRestControllerV1.java b/main/src/test/java/org/onap/policy/pap/main/rest/TestHealthCheckRestControllerV1.java
index bc97c634..359f9cb8 100644
--- a/main/src/test/java/org/onap/policy/pap/main/rest/TestHealthCheckRestControllerV1.java
+++ b/main/src/test/java/org/onap/policy/pap/main/rest/TestHealthCheckRestControllerV1.java
@@ -22,6 +22,7 @@
package org.onap.policy.pap.main.rest;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
@@ -64,7 +65,9 @@ public class TestHealthCheckRestControllerV1 extends CommonPapRestServer {
markActivatorDead();
final Invocation.Builder invocationBuilder = sendRequest(HEALTHCHECK_ENDPOINT);
- final HealthCheckReport report = invocationBuilder.get(HealthCheckReport.class);
+ var response = invocationBuilder.get();
+ var report = response.readEntity(HealthCheckReport.class);
+ assertThat(response.getStatus()).isEqualTo(503);
validateHealthCheckReport(NAME, SELF, false, 503, NOT_ALIVE, report);
}
@@ -72,7 +75,9 @@ public class TestHealthCheckRestControllerV1 extends CommonPapRestServer {
public void testHealthCheckDbConnectionFailure() throws Exception {
when(policyStatusProvider.getPolicyStatus()).thenThrow(PfModelRuntimeException.class);
final Invocation.Builder invocationBuilder = sendRequest(HEALTHCHECK_ENDPOINT);
- final HealthCheckReport report = invocationBuilder.get(HealthCheckReport.class);
+ var response = invocationBuilder.get();
+ var report = response.readEntity(HealthCheckReport.class);
+ assertThat(response.getStatus()).isEqualTo(503);
validateHealthCheckReport(NAME, SELF, false, 503, NOT_ALIVE, report);
}