summaryrefslogtreecommitdiffstats
path: root/a1-policy-management/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'a1-policy-management/src/test')
-rw-r--r--a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java15
-rw-r--r--a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/RappSimulatorController.java20
2 files changed, 18 insertions, 17 deletions
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java
index 14843eb2..68255953 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java
@@ -98,7 +98,7 @@ import reactor.util.annotation.Nullable;
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@TestPropertySource(properties = { //
"server.ssl.key-store=./config/keystore.jks", //
- "app.webclient.trust-store=./config/truststore.jks" })
+ "app.webclient.trust-store=./config/truststore.jks"})
class ApplicationTest {
private static final Logger logger = LoggerFactory.getLogger(ApplicationTest.class);
@@ -213,15 +213,12 @@ class ApplicationTest {
}
@Test
- void createApiDoc() throws IOException {
- String url = "https://localhost:" + this.port + "/v2/api-docs";
+ void generateApiDoc() throws IOException {
+ String url = "https://localhost:" + this.port + "/v3/api-docs";
ResponseEntity<String> resp = restClient("", false).getForEntity(url).block();
assertThat(resp.getStatusCode()).isEqualTo(HttpStatus.OK);
JSONObject jsonObj = new JSONObject(resp.getBody());
- jsonObj.remove("host");
- assertThat(jsonObj.getJSONObject("definitions").remove("Mono«ResponseEntity«object»»")).isNotNull();
- assertThat(jsonObj.getJSONObject("definitions").remove("void")).isNotNull();
- assertThat(jsonObj.getJSONObject("definitions").remove("Mono«ResponseEntity«string»»")).isNotNull();
+ assertThat(jsonObj.remove("servers")).isNotNull();
String indented = (jsonObj).toString(4);
String docDir = "api/";
@@ -773,8 +770,8 @@ class ApplicationTest {
for (int i = 0; i < 10; ++i) {
AsyncRestClient restClient = restClient();
- ConcurrencyTestRunnable test = new ConcurrencyTestRunnable(restClient, supervision, a1ClientFactory, rics,
- policyTypes);
+ ConcurrencyTestRunnable test =
+ new ConcurrencyTestRunnable(restClient, supervision, a1ClientFactory, rics, policyTypes);
Thread thread = new Thread(test, "TestThread_" + i);
thread.start();
threads.add(thread);
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/RappSimulatorController.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/RappSimulatorController.java
index 0a679201..83a2d784 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/RappSimulatorController.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/RappSimulatorController.java
@@ -23,10 +23,12 @@ package org.onap.ccsdk.oran.a1policymanagementservice.controllers.v2;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.tags.Tag;
import java.lang.invoke.MethodHandles;
import java.util.Vector;
@@ -45,11 +47,11 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
@RestController("RappCallbacksController")
-@Api(tags = {"R-App Callbacks"})
+@Tag(name = Consts.V2_API_SERVICE_CALLBACKS_NAME)
public class RappSimulatorController {
private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
- public static final String SERVICE_CALLBACK_URL = "/r-app/pms-callback";
+ public static final String SERVICE_CALLBACK_URL = "/r-app/near-rt-ric-status";
private static Gson gson = new GsonBuilder().create();
public static class TestResults {
@@ -67,10 +69,12 @@ public class RappSimulatorController {
private static final String CALLBACK_DESCRIPTION = "The URL to this call is registerred at Service registration.";
@PostMapping(path = SERVICE_CALLBACK_URL, produces = MediaType.APPLICATION_JSON_VALUE)
- @ApiOperation(value = "Callback for Near-RT RIC status", notes = CALLBACK_DESCRIPTION)
+ @Operation(summary = "Callback for Near-RT RIC status", description = CALLBACK_DESCRIPTION)
@ApiResponses(value = { //
- @ApiResponse(code = 200, message = "OK", response = VoidResponse.class)} //
+ @ApiResponse(responseCode = "200", description = "OK",
+ content = @Content(schema = @Schema(implementation = VoidResponse.class)))} //
)
+
public ResponseEntity<Object> jobStatusCallback( //
@RequestBody ServiceCallbackInfo body) {
logger.info("R-App callback body: {}", gson.toJson(body));