X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=main%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fmain%2Frest%2FTestHealthCheckRestControllerV1.java;h=c1058a781b4786b2658a5437b8cff5bae52fe953;hb=42c18ef1c6506e63151b55a96d90362da9fbda63;hp=e5823bc3ac1ee0f1a1b78ffb6138bf9f130c5352;hpb=eb4cf2ad5d004cbfda90a752d10fbc6e91ef8fb4;p=policy%2Fpap.git 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 e5823bc3..c1058a78 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 @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2019, 2022 Nordix Foundation. + * Copyright (C) 2019, 2022-2023 Nordix Foundation. * Modifications Copyright (C) 2019 AT&T Intellectual Property. * Modifications Copyright (C) 2022 Bell Canada. All rights reserved. * ================================================================================ @@ -23,12 +23,12 @@ package org.onap.policy.pap.main.rest; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.when; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.SyncInvoker; -import org.junit.Test; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.client.SyncInvoker; +import org.junit.jupiter.api.Test; import org.onap.policy.common.endpoints.report.HealthCheckReport; import org.onap.policy.models.base.PfModelRuntimeException; import org.springframework.boot.test.mock.mockito.MockBean; @@ -39,8 +39,8 @@ import org.springframework.test.context.ActiveProfiles; * * @author Ram Krishna Verma (ram.krishna.verma@est.tech) */ -@ActiveProfiles({ "test", "default" }) -public class TestHealthCheckRestControllerV1 extends CommonPapRestServer { +@ActiveProfiles({"test", "default"}) +class TestHealthCheckRestControllerV1 extends CommonPapRestServer { private static final String HEALTHCHECK_ENDPOINT = "healthcheck"; @@ -48,12 +48,12 @@ public class TestHealthCheckRestControllerV1 extends CommonPapRestServer { private PolicyStatusProvider policyStatusProvider; @Test - public void testSwagger() throws Exception { + void testSwagger() throws Exception { super.testSwagger(HEALTHCHECK_ENDPOINT); } @Test - public void testHealthCheckSuccess() throws Exception { + void testHealthCheckSuccess() throws Exception { final Invocation.Builder invocationBuilder = sendRequest(HEALTHCHECK_ENDPOINT); final HealthCheckReport report = invocationBuilder.get(HealthCheckReport.class); validateHealthCheckReport(true, 200, ALIVE, report); @@ -63,7 +63,7 @@ public class TestHealthCheckRestControllerV1 extends CommonPapRestServer { } @Test - public void testHealthCheckActivatorFailure() throws Exception { + void testHealthCheckActivatorFailure() throws Exception { markActivatorDead(); @@ -75,7 +75,7 @@ public class TestHealthCheckRestControllerV1 extends CommonPapRestServer { } @Test - public void testHealthCheckDbConnectionFailure() throws Exception { + void testHealthCheckDbConnectionFailure() throws Exception { when(policyStatusProvider.getPolicyStatus()).thenThrow(PfModelRuntimeException.class); final Invocation.Builder invocationBuilder = sendRequest(HEALTHCHECK_ENDPOINT); var response = invocationBuilder.get();