From b53f17e933de95d6a397313ad04f1c67b18a27da Mon Sep 17 00:00:00 2001 From: Hengye Date: Wed, 27 Nov 2019 13:43:42 +0800 Subject: consolidate Policy Health Check into PAP Issue-ID: POLICY-1689 Change-Id: I3b84094e217c8cda115efdbf3444e92f08013a7c Signed-off-by: Hengye --- .../policy/pap/main/rest/CommonPapRestServer.java | 2 +- ...estPolicyComponentsHealthCheckControllerV1.java | 38 ++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckControllerV1.java (limited to 'main/src/test/java') diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java b/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java index 8660d005..3823365b 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java @@ -72,7 +72,7 @@ public class CommonPapRestServer { public static final String NOT_ALIVE = "not alive"; public static final String ALIVE = "alive"; - public static final String SELF = "self"; + public static final String SELF = NetworkUtil.getHostname(); public static final String NAME = "Policy PAP"; public static final String ENDPOINT_PREFIX = "policy/pap/v1/"; diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckControllerV1.java b/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckControllerV1.java new file mode 100644 index 00000000..f73178b7 --- /dev/null +++ b/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckControllerV1.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.pap.main.rest; + +import org.junit.Test; + +/** + * Class to perform unit test of {@link PolicyComponentsHealthCheckControllerV1}. + * + * @author Yehui Wang (yehui.wang@est.tech) + */ +public class TestPolicyComponentsHealthCheckControllerV1 extends CommonPapRestServer { + + private static final String ENDPOINT = "components/healthcheck"; + + @Test + public void testSwagger() throws Exception { + super.testSwagger(ENDPOINT); + } +} -- cgit 1.2.3-korg