aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/main/java/org/onap/policy/pap/main/rest/stub/HealthCheckRestControllerV1Stub.java
diff options
context:
space:
mode:
authorlapentafd <francesco.lapenta@est.tech>2023-01-24 15:50:27 +0000
committerFrancesco Davide Lapenta <francesco.lapenta@est.tech>2023-01-25 09:43:52 +0000
commit179fd9a931127160fb08aca517083de59c3e0c73 (patch)
tree23606c59025b41af0008177027d02421daa16d17 /main/src/main/java/org/onap/policy/pap/main/rest/stub/HealthCheckRestControllerV1Stub.java
parent09191f108632a46862ea7c60023ea5d012a81823 (diff)
Server Stubs PAP
Added "stub" profile with simple endpoint implementation Issue-ID: POLICY-4143 Change-Id: I8ad911f314e1d1428d05aa419f1322616d8ef835 Signed-off-by: lapentafd <francesco.lapenta@est.tech>
Diffstat (limited to 'main/src/main/java/org/onap/policy/pap/main/rest/stub/HealthCheckRestControllerV1Stub.java')
-rw-r--r--main/src/main/java/org/onap/policy/pap/main/rest/stub/HealthCheckRestControllerV1Stub.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/stub/HealthCheckRestControllerV1Stub.java b/main/src/main/java/org/onap/policy/pap/main/rest/stub/HealthCheckRestControllerV1Stub.java
new file mode 100644
index 00000000..08bc645e
--- /dev/null
+++ b/main/src/main/java/org/onap/policy/pap/main/rest/stub/HealthCheckRestControllerV1Stub.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2023 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.stub;
+
+import lombok.RequiredArgsConstructor;
+import org.onap.policy.common.endpoints.report.HealthCheckReport;
+import org.onap.policy.pap.main.rest.HealthCheckRestControllerV1Api;
+import org.onap.policy.pap.main.rest.PapRestControllerV1;
+import org.springframework.context.annotation.Profile;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequiredArgsConstructor
+@Profile("stub")
+public class HealthCheckRestControllerV1Stub extends PapRestControllerV1
+ implements HealthCheckRestControllerV1Api {
+
+ private final StubUtils stubUtils;
+
+ @Override
+ public ResponseEntity<HealthCheckReport> healthcheck() {
+ return stubUtils.getStubbedResponse(HealthCheckReport.class);
+ }
+
+}