aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test
diff options
context:
space:
mode:
authorlapentafd <francesco.lapenta@est.tech>2023-01-09 15:16:54 +0000
committerlapentafd <francesco.lapenta@est.tech>2023-01-17 09:15:20 +0000
commit09191f108632a46862ea7c60023ea5d012a81823 (patch)
tree80ce5cbf4fc64e69c13b6107712298472cc10b07 /main/src/test
parent7c48007486d0d1ee47a5eea81135e49737677155 (diff)
Use generated PAP interface for Swagger
This commit removes the Swagger V2 annotations on the Rest Controllers in policy-pap. The OpeApi annotations (Swagger v3 annotations) are on a generated Java Interface. The code is changed so that the controller implements that interface. There are minimal code changes to the controller and the order of the parameters is switched in some cases. Issue-ID: POLICY-4404 Change-Id: I060709806a8e5bc04d9873c8d212a5c9fe13c4d4 Signed-off-by: lapentafd <francesco.lapenta@est.tech>
Diffstat (limited to 'main/src/test')
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java6
-rw-r--r--main/src/test/resources/application-test-e2e.yaml2
-rw-r--r--main/src/test/resources/application-test.yaml3
3 files changed, 7 insertions, 4 deletions
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 04971cce..96e36df1 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
@@ -144,10 +144,10 @@ public abstract class CommonPapRestServer {
* @throws Exception if an error occurs
*/
protected void testSwagger(final String endpoint) throws Exception {
- final Invocation.Builder invocationBuilder =
- sendFqeRequest(httpsPrefix + "v3/api-docs", true, MediaType.APPLICATION_JSON);
+ final Invocation.Builder invocationBuilder = sendFqeRequest(httpsPrefix
+ + ENDPOINT_PREFIX + "v3/api-docs", true, MediaType.APPLICATION_JSON);
final String resp = invocationBuilder.get(String.class);
- assertTrue(resp.contains(ENDPOINT_PREFIX + endpoint));
+ assertTrue(resp.contains(endpoint));
}
/**
diff --git a/main/src/test/resources/application-test-e2e.yaml b/main/src/test/resources/application-test-e2e.yaml
index 2191a116..96ed124d 100644
--- a/main/src/test/resources/application-test-e2e.yaml
+++ b/main/src/test/resources/application-test-e2e.yaml
@@ -22,6 +22,8 @@ spring:
implicit-strategy: org.onap.policy.common.spring.utils.CustomImplicitNamingStrategy
server:
port: 6969
+ servlet:
+ context-path: /policy/pap/v1
pap:
name: "PapGroupE2E"
diff --git a/main/src/test/resources/application-test.yaml b/main/src/test/resources/application-test.yaml
index 06d4c3ac..7a2e9fc9 100644
--- a/main/src/test/resources/application-test.yaml
+++ b/main/src/test/resources/application-test.yaml
@@ -23,7 +23,8 @@ spring:
server:
port: 6969
-
+ servlet:
+ context-path: /policy/pap/v1
pap:
name: "PapGroup"
aaf: false