Server Stubs PAP 14/133014/1
authorlapentafd <francesco.lapenta@est.tech>
Tue, 24 Jan 2023 15:50:27 +0000 (15:50 +0000)
committerFrancesco Davide Lapenta <francesco.lapenta@est.tech>
Wed, 25 Jan 2023 09:43:52 +0000 (09:43 +0000)
Added "stub" profile with simple endpoint implementation

Issue-ID: POLICY-4143
Change-Id: I8ad911f314e1d1428d05aa419f1322616d8ef835
Signed-off-by: lapentafd <francesco.lapenta@est.tech>
36 files changed:
main/src/main/java/org/onap/policy/pap/main/rest/HealthCheckRestControllerV1.java
main/src/main/java/org/onap/policy/pap/main/rest/PdpGroupCreateOrUpdateControllerV1.java
main/src/main/java/org/onap/policy/pap/main/rest/PdpGroupDeleteControllerV1.java
main/src/main/java/org/onap/policy/pap/main/rest/PdpGroupDeployControllerV1.java
main/src/main/java/org/onap/policy/pap/main/rest/PdpGroupHealthCheckControllerV1.java
main/src/main/java/org/onap/policy/pap/main/rest/PdpGroupQueryControllerV1.java
main/src/main/java/org/onap/policy/pap/main/rest/PdpGroupStateChangeControllerV1.java
main/src/main/java/org/onap/policy/pap/main/rest/PolicyAuditControllerV1.java
main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckControllerV1.java
main/src/main/java/org/onap/policy/pap/main/rest/PolicyStatusControllerV1.java
main/src/main/java/org/onap/policy/pap/main/rest/StatisticsRestControllerV1.java
main/src/main/java/org/onap/policy/pap/main/rest/stub/HealthCheckRestControllerV1Stub.java [new file with mode: 0644]
main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupCreateOrUpdateControllerV1Stub.java [new file with mode: 0644]
main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupDeleteControllerV1Stub.java [new file with mode: 0644]
main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupDeployControllerV1Stub.java [new file with mode: 0644]
main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupHealthCheckControllerV1Stub.java [new file with mode: 0644]
main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupQueryControllerV1Stub.java [new file with mode: 0644]
main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupStateChangeControllerV1Stub.java [new file with mode: 0644]
main/src/main/java/org/onap/policy/pap/main/rest/stub/PolicyAuditControllerV1Stub.java [new file with mode: 0644]
main/src/main/java/org/onap/policy/pap/main/rest/stub/PolicyComponentsHealthCheckControllerV1Stub.java [new file with mode: 0644]
main/src/main/java/org/onap/policy/pap/main/rest/stub/PolicyStatusControllerV1Stub.java [new file with mode: 0644]
main/src/main/java/org/onap/policy/pap/main/rest/stub/StatisticsRestControllerV1Stub.java [new file with mode: 0644]
main/src/main/java/org/onap/policy/pap/main/rest/stub/StubUtils.java [new file with mode: 0644]
main/src/main/resources/application-stub.yaml [new file with mode: 0644]
main/src/test/java/org/onap/policy/pap/main/rest/TestHealthCheckRestControllerV1.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupCreateOrUpdateControllerV1.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeleteControllerV1.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeployControllerV1.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupHealthCheckControllerV1.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupQueryControllerV1.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupStateChangeControllerV1.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyAuditControllerV1.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckControllerV1.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyStatusControllerV1.java
main/src/test/java/org/onap/policy/pap/main/rest/TestStatisticsRestControllerV1.java
main/src/test/java/org/onap/policy/pap/main/rest/e2e/End2EndBase.java

index 09aea85..8d4fd4b 100644 (file)
@@ -24,6 +24,7 @@ package org.onap.policy.pap.main.rest;
 
 import lombok.RequiredArgsConstructor;
 import org.onap.policy.common.endpoints.report.HealthCheckReport;
+import org.springframework.context.annotation.Profile;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -34,6 +35,7 @@ import org.springframework.web.bind.annotation.RestController;
  */
 @RestController
 @RequiredArgsConstructor
+@Profile("default")
 public class HealthCheckRestControllerV1  extends PapRestControllerV1 implements HealthCheckRestControllerV1Api {
 
     private final HealthCheckProvider provider;
index 8d8e35c..b03006a 100644 (file)
@@ -30,6 +30,7 @@ import org.onap.policy.models.pap.concepts.PdpGroupUpdateResponse;
 import org.onap.policy.models.pdp.concepts.PdpGroups;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.context.annotation.Profile;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -38,6 +39,7 @@ import org.springframework.web.bind.annotation.RestController;
  */
 @RestController
 @RequiredArgsConstructor
+@Profile("default")
 public class PdpGroupCreateOrUpdateControllerV1 extends PapRestControllerV1
     implements PdpGroupCreateOrUpdateControllerV1Api {
 
index f6cec4e..8188e8b 100644 (file)
@@ -38,6 +38,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifierO
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Profile;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -46,6 +47,7 @@ import org.springframework.web.bind.annotation.RestController;
  */
 @RestController
 @RequiredArgsConstructor
+@Profile("default")
 public class PdpGroupDeleteControllerV1 extends PapRestControllerV1
     implements PdpGroupDeleteControllerV1Api {
 
index 62d0f36..2610170 100644 (file)
@@ -38,6 +38,7 @@ import org.onap.policy.models.pdp.concepts.PdpPolicyStatus;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Profile;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -46,6 +47,7 @@ import org.springframework.web.bind.annotation.RestController;
  */
 @RestController
 @RequiredArgsConstructor
+@Profile("default")
 public class PdpGroupDeployControllerV1 extends PapRestControllerV1 implements PdpGroupDeployControllerV1Api {
     public static final String POLICY_STATUS_URI = "/policy/pap/v1/policies/status";
 
index 0b08fa2..0f1ed2a 100644 (file)
@@ -29,6 +29,7 @@ import org.onap.policy.models.base.PfModelException;
 import org.onap.policy.models.pdp.concepts.Pdps;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.context.annotation.Profile;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.RestController;
@@ -41,6 +42,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 @RestController
 @RequiredArgsConstructor
+@Profile("default")
 public class PdpGroupHealthCheckControllerV1 extends PapRestControllerV1
     implements PdpGroupHealthCheckControllerV1Api {
 
index dccd5fb..8d5496a 100644 (file)
@@ -29,6 +29,7 @@ import org.onap.policy.models.pdp.concepts.PdpGroups;
 import org.onap.policy.pap.main.service.PdpGroupService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.context.annotation.Profile;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.RestController;
@@ -40,6 +41,7 @@ import org.springframework.web.bind.annotation.RestController;
  */
 @RestController
 @RequiredArgsConstructor
+@Profile("default")
 public class PdpGroupQueryControllerV1 extends PapRestControllerV1 implements PdpGroupQueryControllerV1Api {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(PdpGroupQueryControllerV1.class);
index c67807c..11917e4 100644 (file)
@@ -30,6 +30,7 @@ import org.onap.policy.models.pap.concepts.PdpGroupStateChangeResponse;
 import org.onap.policy.models.pdp.enums.PdpState;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.context.annotation.Profile;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.RestController;
@@ -41,6 +42,7 @@ import org.springframework.web.bind.annotation.RestController;
  */
 @RestController
 @RequiredArgsConstructor
+@Profile("default")
 public class PdpGroupStateChangeControllerV1 extends PapRestControllerV1 implements PdpGroupStateChangeControllerV1Api {
 
     private static final Logger logger = LoggerFactory.getLogger(PdpGroupHealthCheckControllerV1.class);
index 81681ff..d360cb5 100644 (file)
@@ -27,6 +27,7 @@ import lombok.RequiredArgsConstructor;
 import org.onap.policy.models.base.PfModelException;
 import org.onap.policy.models.pap.concepts.PolicyAudit;
 import org.onap.policy.pap.main.service.PolicyAuditService;
+import org.springframework.context.annotation.Profile;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.RestController;
@@ -37,6 +38,7 @@ import org.springframework.web.bind.annotation.RestController;
  */
 @RestController
 @RequiredArgsConstructor
+@Profile("default")
 public class PolicyAuditControllerV1 extends PapRestControllerV1 implements PolicyAuditControllerV1Api {
 
     public static final String NO_AUDIT_RECORD_FOUND = "No records found matching the input parameters";
index 2500c44..34cde0d 100644 (file)
@@ -26,6 +26,7 @@ import java.util.Map;
 import java.util.UUID;
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.lang3.tuple.Pair;
+import org.springframework.context.annotation.Profile;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.RestController;
@@ -38,6 +39,7 @@ import org.springframework.web.bind.annotation.RestController;
  */
 @RestController
 @RequiredArgsConstructor
+@Profile("default")
 public class PolicyComponentsHealthCheckControllerV1 extends PapRestControllerV1
     implements PolicyComponentsHealthCheckControllerV1Api {
 
index e177214..dfa4ae9 100644 (file)
@@ -32,6 +32,7 @@ import org.onap.policy.models.pdp.concepts.PdpPolicyStatus;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifierOptVersion;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.context.annotation.Profile;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.RestController;
@@ -42,6 +43,7 @@ import org.springframework.web.bind.annotation.RestController;
  */
 @RestController
 @RequiredArgsConstructor
+@Profile("default")
 public class PolicyStatusControllerV1 extends PapRestControllerV1 implements PolicyStatusControllerV1Api {
     private static final String EMPTY_REGEX_ERROR_MESSAGE = "An empty string passed as a regex is not allowed";
     private static final String EMPTY_REGEX_WARNING = ". Empty string passed as Regex.";
index 03ac3ba..2af6e73 100644 (file)
@@ -29,6 +29,7 @@ import java.util.UUID;
 import lombok.RequiredArgsConstructor;
 import org.onap.policy.models.pdp.concepts.PdpStatistics;
 import org.onap.policy.pap.main.service.PdpStatisticsService;
+import org.springframework.context.annotation.Profile;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -39,6 +40,7 @@ import org.springframework.web.bind.annotation.RestController;
  */
 @RestController
 @RequiredArgsConstructor
+@Profile("default")
 public class StatisticsRestControllerV1 extends PapRestControllerV1
     implements StatisticsRestControllerV1Api {
 
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 (file)
index 0000000..08bc645
--- /dev/null
@@ -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);
+    }
+
+}
diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupCreateOrUpdateControllerV1Stub.java b/main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupCreateOrUpdateControllerV1Stub.java
new file mode 100644 (file)
index 0000000..81ab636
--- /dev/null
@@ -0,0 +1,48 @@
+/*-
+ * ============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 java.util.UUID;
+import javax.validation.Valid;
+import lombok.RequiredArgsConstructor;
+import org.onap.policy.models.pap.concepts.PdpGroupUpdateResponse;
+import org.onap.policy.models.pdp.concepts.PdpGroups;
+import org.onap.policy.pap.main.rest.PapRestControllerV1;
+import org.onap.policy.pap.main.rest.PdpGroupCreateOrUpdateControllerV1Api;
+import org.springframework.context.annotation.Profile;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequiredArgsConstructor
+@Profile("stub")
+public class PdpGroupCreateOrUpdateControllerV1Stub extends PapRestControllerV1
+    implements PdpGroupCreateOrUpdateControllerV1Api {
+
+    private final StubUtils stubUtils;
+
+    @Override
+    public ResponseEntity<PdpGroupUpdateResponse> createOrUpdateGroups(
+            UUID requestId, @Valid PdpGroups body) {
+        return stubUtils.getStubbedResponse(PdpGroupUpdateResponse.class);
+    }
+
+}
diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupDeleteControllerV1Stub.java b/main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupDeleteControllerV1Stub.java
new file mode 100644 (file)
index 0000000..9f46430
--- /dev/null
@@ -0,0 +1,59 @@
+/*-
+ * ============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 java.util.UUID;
+import lombok.RequiredArgsConstructor;
+import org.onap.policy.models.pap.concepts.PdpGroupDeleteResponse;
+import org.onap.policy.models.pap.concepts.PdpGroupDeployResponse;
+import org.onap.policy.pap.main.rest.PapRestControllerV1;
+import org.onap.policy.pap.main.rest.PdpGroupDeleteControllerV1Api;
+import org.springframework.context.annotation.Profile;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequiredArgsConstructor
+@Profile("stub")
+public class PdpGroupDeleteControllerV1Stub extends PapRestControllerV1
+    implements PdpGroupDeleteControllerV1Api {
+
+    private final StubUtils stubUtils;
+
+    @Override
+    public ResponseEntity<PdpGroupDeleteResponse> deleteGroup(
+            String name, UUID requestId) {
+        return stubUtils.getStubbedResponse(PdpGroupDeleteResponse.class);
+    }
+
+    @Override
+    public ResponseEntity<PdpGroupDeployResponse> deletePolicy(
+            String name, UUID requestId) {
+        return stubUtils.getStubbedResponse(PdpGroupDeployResponse.class);
+    }
+
+    @Override
+    public ResponseEntity<PdpGroupDeployResponse> deletePolicyVersion(
+            String name, String version, UUID requestId) {
+        return stubUtils.getStubbedResponse(PdpGroupDeployResponse.class);
+    }
+
+}
diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupDeployControllerV1Stub.java b/main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupDeployControllerV1Stub.java
new file mode 100644 (file)
index 0000000..f9ed98e
--- /dev/null
@@ -0,0 +1,55 @@
+/*-
+ * ============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 java.util.UUID;
+import javax.validation.Valid;
+import lombok.RequiredArgsConstructor;
+import org.onap.policy.models.pap.concepts.PdpDeployPolicies;
+import org.onap.policy.models.pap.concepts.PdpGroupDeployResponse;
+import org.onap.policy.models.pdp.concepts.DeploymentGroups;
+import org.onap.policy.pap.main.rest.PapRestControllerV1;
+import org.onap.policy.pap.main.rest.PdpGroupDeployControllerV1Api;
+import org.springframework.context.annotation.Profile;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequiredArgsConstructor
+@Profile("stub")
+public class PdpGroupDeployControllerV1Stub extends PapRestControllerV1
+    implements PdpGroupDeployControllerV1Api {
+
+    private final StubUtils stubUtils;
+
+    @Override
+    public ResponseEntity<PdpGroupDeployResponse> deployPolicies(
+            UUID requestId, @Valid PdpDeployPolicies body) {
+        return stubUtils.getStubbedResponse(PdpGroupDeployResponse.class);
+    }
+
+    @Override
+    public ResponseEntity<PdpGroupDeployResponse> updateGroupPolicies(
+            UUID requestId, @Valid DeploymentGroups body) {
+        return stubUtils.getStubbedResponse(PdpGroupDeployResponse.class);
+    }
+
+}
diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupHealthCheckControllerV1Stub.java b/main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupHealthCheckControllerV1Stub.java
new file mode 100644 (file)
index 0000000..a65f02b
--- /dev/null
@@ -0,0 +1,45 @@
+/*-
+ * ============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 java.util.UUID;
+import lombok.RequiredArgsConstructor;
+import org.onap.policy.models.pdp.concepts.Pdps;
+import org.onap.policy.pap.main.rest.PapRestControllerV1;
+import org.onap.policy.pap.main.rest.PdpGroupHealthCheckControllerV1Api;
+import org.springframework.context.annotation.Profile;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequiredArgsConstructor
+@Profile("stub")
+public class PdpGroupHealthCheckControllerV1Stub extends PapRestControllerV1
+    implements PdpGroupHealthCheckControllerV1Api {
+
+    private final StubUtils stubUtils;
+
+    @Override
+    public ResponseEntity<Pdps> pdpGroupHealthCheck(UUID requestId) {
+        return stubUtils.getStubbedResponse(Pdps.class);
+    }
+
+}
diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupQueryControllerV1Stub.java b/main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupQueryControllerV1Stub.java
new file mode 100644 (file)
index 0000000..12e44ac
--- /dev/null
@@ -0,0 +1,45 @@
+/*-
+ * ============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 java.util.UUID;
+import lombok.RequiredArgsConstructor;
+import org.onap.policy.models.pdp.concepts.PdpGroups;
+import org.onap.policy.pap.main.rest.PapRestControllerV1;
+import org.onap.policy.pap.main.rest.PdpGroupQueryControllerV1Api;
+import org.springframework.context.annotation.Profile;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequiredArgsConstructor
+@Profile("stub")
+public class PdpGroupQueryControllerV1Stub extends PapRestControllerV1
+    implements PdpGroupQueryControllerV1Api {
+
+    private final StubUtils stubUtils;
+
+    @Override
+    public ResponseEntity<PdpGroups> queryGroupDetails(UUID requestId) {
+        return stubUtils.getStubbedResponse(PdpGroups.class);
+    }
+
+}
diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupStateChangeControllerV1Stub.java b/main/src/main/java/org/onap/policy/pap/main/rest/stub/PdpGroupStateChangeControllerV1Stub.java
new file mode 100644 (file)
index 0000000..dc4f236
--- /dev/null
@@ -0,0 +1,49 @@
+/*-
+ * ============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 java.util.UUID;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import lombok.RequiredArgsConstructor;
+import org.onap.policy.models.pap.concepts.PdpGroupStateChangeResponse;
+import org.onap.policy.models.pdp.enums.PdpState;
+import org.onap.policy.pap.main.rest.PapRestControllerV1;
+import org.onap.policy.pap.main.rest.PdpGroupStateChangeControllerV1Api;
+import org.springframework.context.annotation.Profile;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequiredArgsConstructor
+@Profile("stub")
+public class PdpGroupStateChangeControllerV1Stub extends PapRestControllerV1
+    implements PdpGroupStateChangeControllerV1Api {
+
+    private final StubUtils stubUtils;
+
+    @Override
+    public ResponseEntity<PdpGroupStateChangeResponse> changeGroupState(
+            String name, @NotNull @Valid PdpState state, UUID requestId) {
+        return stubUtils.getStubbedResponse(PdpGroupStateChangeResponse.class);
+    }
+
+}
diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/stub/PolicyAuditControllerV1Stub.java b/main/src/main/java/org/onap/policy/pap/main/rest/stub/PolicyAuditControllerV1Stub.java
new file mode 100644 (file)
index 0000000..b9f2c4e
--- /dev/null
@@ -0,0 +1,86 @@
+/*-
+ * ============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 java.util.List;
+import java.util.UUID;
+import javax.validation.Valid;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import lombok.RequiredArgsConstructor;
+import org.onap.policy.models.pap.concepts.PolicyAudit;
+import org.onap.policy.pap.main.rest.PapRestControllerV1;
+import org.onap.policy.pap.main.rest.PolicyAuditControllerV1Api;
+import org.springframework.context.annotation.Profile;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequiredArgsConstructor
+@Profile("stub")
+public class PolicyAuditControllerV1Stub extends PapRestControllerV1
+    implements PolicyAuditControllerV1Api {
+
+    private final StubUtils stubUtils;
+
+    @Override
+    public ResponseEntity<List<PolicyAudit>> getAllAuditRecords(
+            UUID requestId,
+            @Min(1) @Max(100) @Valid Integer recordCount,
+            @Valid Long startTime,
+            @Valid Long endTime) {
+        return stubUtils.getStubbedResponseList(PolicyAudit.class);
+    }
+
+    @Override
+    public ResponseEntity<Object> getAuditRecordsByGroup(
+            String pdpGroupName,
+            UUID requestId,
+            @Min(1) @Max(100) @Valid Integer recordCount,
+            @Valid Long startTime,
+            @Valid Long endTime) {
+        return stubUtils.getStubbedResponse(Object.class);
+    }
+
+    @Override
+    public ResponseEntity<Object> getAuditRecordsOfPolicy(
+            String policyName,
+            String policyVersion,
+            UUID requestId,
+            @Min(1) @Max(100) @Valid Integer recordCount,
+            @Valid Long startTime,
+            @Valid Long endTime) {
+        return stubUtils.getStubbedResponse(Object.class);
+    }
+
+    @Override
+    public ResponseEntity<Object> getAuditRecordsOfPolicyinPdpGroup(
+            String pdpGroupName,
+            String policyName,
+            String policyVersion,
+            UUID requestId,
+            @Min(1) @Max(100) @Valid Integer recordCount,
+            @Valid Long startTime,
+            @Valid Long endTime) {
+        return stubUtils.getStubbedResponse(Object.class);
+    }
+
+}
\ No newline at end of file
diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/stub/PolicyComponentsHealthCheckControllerV1Stub.java b/main/src/main/java/org/onap/policy/pap/main/rest/stub/PolicyComponentsHealthCheckControllerV1Stub.java
new file mode 100644 (file)
index 0000000..16773fa
--- /dev/null
@@ -0,0 +1,45 @@
+/*-
+ * ============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 java.util.Map;
+import java.util.UUID;
+import lombok.RequiredArgsConstructor;
+import org.onap.policy.pap.main.rest.PapRestControllerV1;
+import org.onap.policy.pap.main.rest.PolicyComponentsHealthCheckControllerV1Api;
+import org.springframework.context.annotation.Profile;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequiredArgsConstructor
+@Profile("stub")
+public class PolicyComponentsHealthCheckControllerV1Stub extends PapRestControllerV1
+    implements PolicyComponentsHealthCheckControllerV1Api {
+
+    private final StubUtils stubsUtils;
+
+    @Override
+    public ResponseEntity<Map<String, Object>> policyComponentsHealthCheck(UUID requestId) {
+        return stubsUtils.getStubbedResponseMap();
+    }
+
+}
diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/stub/PolicyStatusControllerV1Stub.java b/main/src/main/java/org/onap/policy/pap/main/rest/stub/PolicyStatusControllerV1Stub.java
new file mode 100644 (file)
index 0000000..323320a
--- /dev/null
@@ -0,0 +1,79 @@
+/*-
+ * ============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 java.util.UUID;
+import javax.validation.Valid;
+import lombok.RequiredArgsConstructor;
+import org.onap.policy.pap.main.rest.PapRestControllerV1;
+import org.onap.policy.pap.main.rest.PolicyStatusControllerV1Api;
+import org.springframework.context.annotation.Profile;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequiredArgsConstructor
+@Profile("stub")
+public class PolicyStatusControllerV1Stub extends PapRestControllerV1
+    implements PolicyStatusControllerV1Api {
+
+    private final StubUtils stubUtils;
+
+    @Override
+    public ResponseEntity<Object> getStatusOfAllPolicies(UUID requestId) {
+        return stubUtils.getStubbedResponse(Object.class);
+    }
+
+    @Override
+    public ResponseEntity<Object> getStatusOfPolicies(
+            String pdpGroupName, String policyName, UUID requestId) {
+        return stubUtils.getStubbedResponse(Object.class);
+    }
+
+    @Override
+    public ResponseEntity<Object> getStatusOfPoliciesByGroup(
+            String pdpGroupName, UUID requestId, @Valid String regex) {
+        return stubUtils.getStubbedResponse(Object.class);
+    }
+
+    @Override
+    public ResponseEntity<Object> getStatusOfPolicy(
+            String pdpGroupName, String policyName, String policyVersion, UUID requestId) {
+        return stubUtils.getStubbedResponse(Object.class);
+    }
+
+    @Override
+    public ResponseEntity<Object> queryAllDeployedPolicies(UUID requestId, @Valid String regex) {
+        return stubUtils.getStubbedResponse(Object.class);
+    }
+
+    @Override
+    public ResponseEntity<Object> queryDeployedPolicies(String name, UUID requestId) {
+        return stubUtils.getStubbedResponse(Object.class);
+    }
+
+    @Override
+    public ResponseEntity<Object> queryDeployedPolicy(
+            String name, String version, UUID requestId) {
+        return stubUtils.getStubbedResponse(Object.class);
+    }
+
+}
diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/stub/StatisticsRestControllerV1Stub.java b/main/src/main/java/org/onap/policy/pap/main/rest/stub/StatisticsRestControllerV1Stub.java
new file mode 100644 (file)
index 0000000..663f1ac
--- /dev/null
@@ -0,0 +1,88 @@
+/*-
+ * ============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 java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import javax.validation.Valid;
+import lombok.RequiredArgsConstructor;
+import org.onap.policy.models.pdp.concepts.PdpStatistics;
+import org.onap.policy.pap.main.rest.PapRestControllerV1;
+import org.onap.policy.pap.main.rest.StatisticsReport;
+import org.onap.policy.pap.main.rest.StatisticsRestControllerV1Api;
+import org.springframework.context.annotation.Profile;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequiredArgsConstructor
+@Profile("stub")
+public class StatisticsRestControllerV1Stub extends PapRestControllerV1
+    implements StatisticsRestControllerV1Api {
+
+    private final StubUtils stubUtils;
+
+    @Override
+    public ResponseEntity<Map<String, Map<String, List<PdpStatistics>>>> pdpGroupStatistics(
+        String group,
+        UUID requestId,
+        @Valid Integer recordCount,
+        @Valid Long startTime,
+        @Valid Long endTime) {
+        return stubUtils.getStubbedResponseStatistics();
+    }
+
+    @Override
+    public ResponseEntity<Map<String, Map<String, List<PdpStatistics>>>> pdpInstanceStatistics(
+        String group,
+        String type,
+        String pdp,
+        UUID requestId,
+        @Valid Integer recordCount,
+        @Valid Long startTime,
+        @Valid Long endTime) {
+        return stubUtils.getStubbedResponseStatistics();
+    }
+
+    @Override
+    public ResponseEntity<Map<String, Map<String, List<PdpStatistics>>>> pdpStatistics(
+        UUID requestId, @Valid Integer recordCount, @Valid Long startTime, @Valid Long endTime) {
+        return stubUtils.getStubbedResponseStatistics();
+    }
+
+    @Override
+    public ResponseEntity<Map<String, Map<String, List<PdpStatistics>>>> pdpSubGroupStatistics(
+        String group,
+        String type,
+        UUID requestId,
+        @Valid Integer recordCount,
+        @Valid Long startTime,
+        @Valid Long endTime) {
+        return stubUtils.getStubbedResponseStatistics();
+    }
+
+    @Override
+    public ResponseEntity<StatisticsReport> statistics(UUID requestId) {
+        return stubUtils.getStubbedResponse(StatisticsReport.class);
+    }
+
+}
diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/stub/StubUtils.java b/main/src/main/java/org/onap/policy/pap/main/rest/stub/StubUtils.java
new file mode 100644 (file)
index 0000000..d2ab15f
--- /dev/null
@@ -0,0 +1,112 @@
+/*-
+ * ============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 com.google.gson.Gson;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.servlet.http.HttpServletRequest;
+import lombok.RequiredArgsConstructor;
+import org.onap.policy.models.pdp.concepts.PdpStatistics;
+import org.onap.policy.pap.main.rest.PapRestControllerV1;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.annotation.Profile;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@RequiredArgsConstructor
+@Service
+@Profile("stub")
+class StubUtils {
+    private static final Logger log = LoggerFactory.getLogger(StubUtils.class);
+    private final HttpServletRequest request;
+    private static final String ACCEPT = "Accept";
+    private static final String PAP_DB =
+            "/PapDb.json";
+    private static final Gson JSON_TRANSLATOR = new Gson();
+
+    <T> ResponseEntity<T> getStubbedResponse(Class<T> clazz) {
+        var accept = request.getHeader(ACCEPT);
+        if (accept != null && accept.contains("application/json")) {
+            final var resource = new ClassPathResource(PAP_DB);
+            try (var inputStream = resource.getInputStream()) {
+                final var string = new String(inputStream.readAllBytes(), StandardCharsets.UTF_8);
+                var targetObject = JSON_TRANSLATOR.fromJson(string, clazz);
+                return new ResponseEntity<>(targetObject, HttpStatus.OK);
+            } catch (IOException e) {
+                log.error("Couldn't serialize response for content type application/json", e);
+                return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
+            }
+        }
+        return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+    }
+
+    <T> ResponseEntity<List<T>> getStubbedResponseList(Class<T> clazz) {
+        var accept = request.getHeader(ACCEPT);
+        if (accept != null && accept.contains("application/json")) {
+            final var resource = new ClassPathResource(PAP_DB);
+            try (var inputStream = resource.getInputStream()) {
+                final var string = new String(inputStream.readAllBytes(), StandardCharsets.UTF_8);
+                var targetObject = Arrays.asList(JSON_TRANSLATOR.fromJson(string, clazz));
+                return new ResponseEntity<>(targetObject, HttpStatus.OK);
+            } catch (IOException e) {
+                log.error("Couldn't serialize response for content type application/json", e);
+                return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
+            }
+        }
+        return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+    }
+
+    ResponseEntity<Map<String, Object>> getStubbedResponseMap() {
+        var accept = request.getHeader(ACCEPT);
+        if (accept != null && accept.contains("application/json")) {
+            final var resource = new ClassPathResource(PAP_DB);
+            try (var inputStream = resource.getInputStream()) {
+                Map<String, Object> map = new HashMap<>();
+                final var string = new String(inputStream.readAllBytes(), StandardCharsets.UTF_8);
+                map.put(PapRestControllerV1.API_VERSION_NAME,
+                        JSON_TRANSLATOR.fromJson(string, Object.class));
+                return new ResponseEntity<>(map, HttpStatus.OK);
+            } catch (IOException e) {
+                log.error("Couldn't serialize response for content type application/json", e);
+                return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
+            }
+        }
+        return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+    }
+
+    ResponseEntity<Map<String, Map<String, List<PdpStatistics>>>> getStubbedResponseStatistics() {
+        var accept = request.getHeader(ACCEPT);
+        if (accept != null && accept.contains("application/json")) {
+            Map<String, Map<String, List<PdpStatistics>>> map = new HashMap<>();
+            return new ResponseEntity<>(map, HttpStatus.OK);
+        }
+        return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+    }
+
+}
diff --git a/main/src/main/resources/application-stub.yaml b/main/src/main/resources/application-stub.yaml
new file mode 100644 (file)
index 0000000..b509fd6
--- /dev/null
@@ -0,0 +1,3 @@
+spring:
+    application:
+        name: "policy-api-stub"
\ No newline at end of file
index 14fa42d..e5823bc 100644 (file)
@@ -39,7 +39,7 @@ import org.springframework.test.context.ActiveProfiles;
  *
  * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
  */
-@ActiveProfiles("test")
+@ActiveProfiles({ "test", "default" })
 public class TestHealthCheckRestControllerV1 extends CommonPapRestServer {
 
     private static final String HEALTHCHECK_ENDPOINT = "healthcheck";
index 6649dc7..c5442fa 100644 (file)
@@ -38,7 +38,7 @@ import org.springframework.test.context.ActiveProfiles;
 /**
  * Note: this tests failure cases; success cases are tested by tests in the "e2e" package.
  */
-@ActiveProfiles("test")
+@ActiveProfiles({ "test", "default" })
 public class TestPdpGroupCreateOrUpdateControllerV1 extends CommonPapRestServer {
 
     private static final String CREATEORUPDATE_GROUPS_ENDPOINT = "pdps/groups/batch";
index 033461f..21640bf 100644 (file)
@@ -33,7 +33,7 @@ import org.springframework.test.context.ActiveProfiles;
 /**
  * Note: this tests failure cases; success cases are tested by tests in the "e2e" package.
  */
-@ActiveProfiles("test")
+@ActiveProfiles({ "test", "default" })
 public class TestPdpGroupDeleteControllerV1 extends CommonPapRestServer {
 
     private static final String GROUP_NOT_FOUND = "group not found";
index 5d48ecc..61d204c 100644 (file)
@@ -42,7 +42,7 @@ import org.springframework.test.context.ActiveProfiles;
 /**
  * Note: this tests failure cases; success cases are tested by tests in the "e2e" package.
  */
-@ActiveProfiles("test")
+@ActiveProfiles({ "test", "default" })
 public class TestPdpGroupDeployControllerV1 extends CommonPapRestServer {
 
     private static final String DEPLOY_GROUP_ENDPOINT = "pdps/deployments/batch";
index f149d3e..f935f92 100644 (file)
@@ -35,7 +35,7 @@ import org.springframework.test.context.ActiveProfiles;
  *
  * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
  */
-@ActiveProfiles("test")
+@ActiveProfiles({ "test", "default" })
 public class TestPdpGroupHealthCheckControllerV1 extends CommonPapRestServer {
 
     private static final String ENDPOINT = "pdps/healthcheck";
index 255718b..30cd594 100644 (file)
@@ -35,7 +35,7 @@ import org.springframework.test.context.ActiveProfiles;
  *
  * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
  */
-@ActiveProfiles("test")
+@ActiveProfiles({ "test", "default" })
 public class TestPdpGroupQueryControllerV1 extends CommonPapRestServer {
 
     private static final String GROUP_ENDPOINT = "pdps";
index 6762c49..a92731a 100644 (file)
@@ -35,7 +35,7 @@ import org.springframework.test.context.ActiveProfiles;
  *
  * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
  */
-@ActiveProfiles("test")
+@ActiveProfiles({ "test", "default" })
 public class TestPdpGroupStateChangeControllerV1 extends CommonPapRestServer {
 
     private static final String GROUP_ENDPOINT = "pdps/groups";
index 23fa803..3764e21 100644 (file)
@@ -29,7 +29,7 @@ import org.springframework.test.context.ActiveProfiles;
 /**
  * Note: this tests failure cases; success cases are tested by tests in the "e2e" package.
  */
-@ActiveProfiles("test")
+@ActiveProfiles({ "test", "default" })
 public class TestPolicyAuditControllerV1 extends CommonPapRestServer {
 
     private static final String POLICY_AUDIT_ENDPOINT = "policies/audit";
index 9eec5e1..ff91ebe 100644 (file)
@@ -42,7 +42,7 @@ import org.springframework.test.context.ActiveProfiles;
  *
  * @author Yehui Wang (yehui.wang@est.tech)
  */
-@ActiveProfiles("test")
+@ActiveProfiles({ "test", "default" })
 public class TestPolicyComponentsHealthCheckControllerV1 extends CommonPapRestServer {
 
     private static final String ENDPOINT = "components/healthcheck";
index 907e6c5..41cfd39 100644 (file)
@@ -34,7 +34,7 @@ import org.springframework.test.context.ActiveProfiles;
 /**
  * Note: this tests failure cases; success cases are tested by tests in the "e2e" package.
  */
-@ActiveProfiles("test")
+@ActiveProfiles({ "test", "default" })
 public class TestPolicyStatusControllerV1 extends CommonPapRestServer {
 
     private static final String POLICY_STATUS_ENDPOINT = "policies/deployed";
index e19bdb8..423c1d3 100644 (file)
@@ -34,7 +34,7 @@ import org.springframework.test.context.ActiveProfiles;
  *
  * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
  */
-@ActiveProfiles("test")
+@ActiveProfiles({ "test", "default" })
 public class TestStatisticsRestControllerV1 extends CommonPapRestServer {
 
     private static final String STATISTICS_ENDPOINT = "statistics";
index 48bc1e0..fd74caa 100644 (file)
@@ -59,7 +59,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.test.context.ActiveProfiles;
 import org.yaml.snakeyaml.Yaml;
 
-@ActiveProfiles("test-e2e")
+@ActiveProfiles({ "test-e2e", "default" })
 public abstract class End2EndBase extends CommonPapRestServer {
     private static final Logger logger = LoggerFactory.getLogger(End2EndBase.class);