From 44fe7892a32d85597fd0906127395483e393e62a Mon Sep 17 00:00:00 2001
From: PatrikBuhr
Date: Fri, 3 Feb 2023 11:28:59 +0100
Subject: [PATCH] Migrate to springboot 3
Java 17 is needed
Signed-off-by: PatrikBuhr
Issue-ID: NONRTRIC-841
Change-Id: I942a5756052b1724803c2c9309511f51a1cf9660
---
Dockerfile | 2 +-
api/ics-api.json | 110 +++++++++++++++----
api/ics-api.yaml | 120 +++++++++++++++++----
pom.xml | 40 +++----
src/main/java/org/oransc/ics/SwaggerConfig.java | 2 +-
src/test/java/org/oransc/ics/ApplicationTest.java | 3 +-
.../org/oransc/ics/MockInformationService.java | 4 +-
7 files changed, 209 insertions(+), 72 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index cc8813e..79c6380 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -17,7 +17,7 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
#
-FROM openjdk:11-jre-slim
+FROM openjdk:17-jdk-slim
ARG JAR
diff --git a/api/ics-api.json b/api/ics-api.json
index 722097b..db6d45e 100644
--- a/api/ics-api.json
+++ b/api/ics-api.json
@@ -32,7 +32,6 @@
"description": "Information for an EI type",
"type": "object"
},
- "MonoResponseEntityObject": {"type": "object"},
"authorization_result": {
"description": "Result of authorization",
"type": "object",
@@ -389,10 +388,15 @@
}},
"/actuator/threaddump": {"get": {
"summary": "Actuator web endpoint 'threaddump'",
- "operationId": "threaddump_2",
+ "operationId": "threaddump",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "text/plain;charset=UTF-8": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"tags": ["Actuator"]
}},
@@ -588,7 +592,11 @@
"operationId": "loggers",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"tags": ["Actuator"]
}},
@@ -597,7 +605,11 @@
"operationId": "health-path",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"tags": ["Actuator"]
}},
@@ -632,7 +644,11 @@
"operationId": "shutdown",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"tags": ["Actuator"]
}},
@@ -641,7 +657,11 @@
"operationId": "metrics-requiredMetricName",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"parameters": [{
"schema": {"type": "string"},
@@ -656,13 +676,29 @@
"operationId": "links",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {
- "additionalProperties": {
- "additionalProperties": {"$ref": "#/components/schemas/Link"},
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {
+ "additionalProperties": {
+ "additionalProperties": {"$ref": "#/components/schemas/Link"},
+ "type": "object"
+ },
"type": "object"
- },
- "type": "object"
- }}}
+ }},
+ "application/json": {"schema": {
+ "additionalProperties": {
+ "additionalProperties": {"$ref": "#/components/schemas/Link"},
+ "type": "object"
+ },
+ "type": "object"
+ }},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {
+ "additionalProperties": {
+ "additionalProperties": {"$ref": "#/components/schemas/Link"},
+ "type": "object"
+ },
+ "type": "object"
+ }}
+ }
}},
"tags": ["Actuator"]
}},
@@ -708,7 +744,7 @@
"operationId": "deleteJobsForOwner",
"responses": {"204": {
"description": "No Content",
- "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MonoResponseEntityObject"}}}
+ "content": {"application/json": {"schema": {"type": "object"}}}
}},
"parameters": [{
"schema": {"type": "string"},
@@ -723,7 +759,19 @@
"/actuator/loggers/{name}": {
"post": {
"summary": "Actuator web endpoint 'loggers-name'",
- "operationId": "loggers-name",
+ "requestBody": {"content": {"application/json": {"schema": {
+ "type": "string",
+ "enum": [
+ "TRACE",
+ "DEBUG",
+ "INFO",
+ "WARN",
+ "ERROR",
+ "FATAL",
+ "OFF"
+ ]
+ }}}},
+ "operationId": "loggers-name_2",
"responses": {"200": {
"description": "OK",
"content": {"*/*": {"schema": {"type": "object"}}}
@@ -738,10 +786,14 @@
},
"get": {
"summary": "Actuator web endpoint 'loggers-name'",
- "operationId": "loggers-name_2",
+ "operationId": "loggers-name",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"parameters": [{
"schema": {"type": "string"},
@@ -850,7 +902,11 @@
"operationId": "metrics",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"tags": ["Actuator"]
}},
@@ -879,7 +935,11 @@
"operationId": "info",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"tags": ["Actuator"]
}},
@@ -1096,7 +1156,7 @@
"operationId": "logfile",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {"text/plain;charset=UTF-8": {"schema": {"type": "object"}}}
}},
"tags": ["Actuator"]
}},
@@ -1231,7 +1291,11 @@
"operationId": "health",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"tags": ["Actuator"]
}},
@@ -1314,14 +1378,14 @@
"operationId": "heapdump",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {"application/octet-stream": {"schema": {"type": "object"}}}
}},
"tags": ["Actuator"]
}}
},
"info": {
"license": {
- "name": "Copyright (C) 2020-2022 Nordix Foundation. Licensed under the Apache License.",
+ "name": "Copyright (C) 2020-2023 Nordix Foundation. Licensed under the Apache License.",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
},
"description": "API documentation<\/h1>General<\/h2>
The service is mainly a broker between data producers and data consumers. A data producer has the ability to produce one or several types of data (Information Type). One type of data can be produced by zero to many producers.
A data consumer can have several active data subscriptions (Information Job). One Information Job consists of the type of data to produce and additional parameters for filtering of the data. These parameters are different for different data types.<\/p>
APIs provided by the service<\/h2>A1-EI<\/h4>
This API is between Near-RT RIC and the Non-RT RIC. The Near-RT RIC is a data consumer, which creates Information Jobs to subscribe for data. In this context, the information is referred to as 'Enrichment Information', EI.<\/p>
Data producer API<\/h4>
This API is provided by the Non-RT RIC platform and is intended to be part of the O-RAN R1 interface. The API is for use by different kinds of data producers and provides support for:
Service status
This
API provides a means to monitor the health of this service.
license:
- name: Copyright (C) 2020-2022 Nordix Foundation. Licensed under the Apache License.
+ name: Copyright (C) 2020-2023 Nordix Foundation. Licensed under the Apache License.
url: http://www.apache.org/licenses/LICENSE-2.0
version: "1.0"
servers:
@@ -73,12 +73,21 @@ paths:
tags:
- Actuator
summary: Actuator web endpoint 'threaddump'
- operationId: threaddump_2
+ operationId: threaddump
responses:
200:
description: OK
content:
- '*/*':
+ text/plain;charset=UTF-8:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
/A1-EI/v1/eitypes/{eiTypeId}:
@@ -330,7 +339,13 @@ paths:
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
/actuator/health/**:
@@ -343,7 +358,13 @@ paths:
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
/data-consumer/v1/info-types:
@@ -393,7 +414,13 @@ paths:
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
/actuator/metrics/{requiredMetricName}:
@@ -414,7 +441,13 @@ paths:
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
/actuator:
@@ -427,7 +460,21 @@ paths:
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ additionalProperties:
+ type: object
+ additionalProperties:
+ $ref: '#/components/schemas/Link'
+ application/json:
+ schema:
+ type: object
+ additionalProperties:
+ type: object
+ additionalProperties:
+ $ref: '#/components/schemas/Link'
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
additionalProperties:
@@ -494,13 +541,13 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/MonoResponseEntityObject'
+ type: object
/actuator/loggers/{name}:
get:
tags:
- Actuator
summary: Actuator web endpoint 'loggers-name'
- operationId: loggers-name_2
+ operationId: loggers-name
parameters:
- name: name
in: path
@@ -513,14 +560,20 @@ paths:
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
post:
tags:
- Actuator
summary: Actuator web endpoint 'loggers-name'
- operationId: loggers-name
+ operationId: loggers-name_2
parameters:
- name: name
in: path
@@ -529,6 +582,19 @@ paths:
explode: false
schema:
type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: string
+ enum:
+ - TRACE
+ - DEBUG
+ - INFO
+ - WARN
+ - ERROR
+ - FATAL
+ - OFF
responses:
200:
description: OK
@@ -671,7 +737,13 @@ paths:
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
/example-dataconsumer/info-jobs/{infoJobId}/status:
@@ -713,7 +785,13 @@ paths:
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
/A1-EI/v1/eitypes:
@@ -994,7 +1072,7 @@ paths:
200:
description: OK
content:
- '*/*':
+ text/plain;charset=UTF-8:
schema:
type: object
/data-consumer/v1/info-jobs/{infoJobId}:
@@ -1170,7 +1248,13 @@ paths:
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
/A1-EI/v1/eijobs:
@@ -1272,7 +1356,7 @@ paths:
200:
description: OK
content:
- '*/*':
+ application/octet-stream:
schema:
type: object
components:
@@ -1303,8 +1387,6 @@ components:
EiTypeObject:
type: object
description: Information for an EI type
- MonoResponseEntityObject:
- type: object
authorization_result:
required:
- result
diff --git a/pom.xml b/pom.xml
index 1e7b43a..f7daeee 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.7.6
+ 3.0.2
org.o-ran-sc.nonrtric.plt
@@ -46,10 +46,8 @@
- 11
- 3.0.0
+ 17
2.9.0
- 2.1.13
20211205
3.8.0
2.12.2
@@ -57,10 +55,21 @@
3.0.11
0.30.0
3.7.0.1746
- 0.8.5
+ 0.8.8
+ 2.0.2
true
+
+ org.springdoc
+ springdoc-openapi-starter-webmvc-ui
+ ${springdoc.version}
+
+
+ org.springdoc
+ springdoc-openapi-ui
+ ${springdoc.version}
+
org.springframework.boot
spring-boot-starter-web
@@ -77,16 +86,6 @@
org.springframework
spring-webflux
-
- io.swagger.core.v3
- swagger-jaxrs2
- ${swagger.version}
-
-
- io.swagger.core.v3
- swagger-jaxrs2-servlet-initializer
- ${swagger.version}
-
com.google.code.gson
gson
@@ -113,17 +112,6 @@
org.springframework.boot
spring-boot-starter-actuator
-
-
- io.springfox
- springfox-swagger2
- ${springfox.version}
-
-
- io.springfox
- springfox-swagger-ui
- ${springfox.version}
-
org.springframework.boot
diff --git a/src/main/java/org/oransc/ics/SwaggerConfig.java b/src/main/java/org/oransc/ics/SwaggerConfig.java
index 30c0d4a..08f3bec 100644
--- a/src/main/java/org/oransc/ics/SwaggerConfig.java
+++ b/src/main/java/org/oransc/ics/SwaggerConfig.java
@@ -36,7 +36,7 @@ import io.swagger.v3.oas.annotations.info.License;
version = "1.0", //
description = SwaggerConfig.DESCRIPTION, //
license = @License(
- name = "Copyright (C) 2020-2022 Nordix Foundation. Licensed under the Apache License.",
+ name = "Copyright (C) 2020-2023 Nordix Foundation. Licensed under the Apache License.",
url = "http://www.apache.org/licenses/LICENSE-2.0")))
public class SwaggerConfig {
private SwaggerConfig() {
diff --git a/src/test/java/org/oransc/ics/ApplicationTest.java b/src/test/java/org/oransc/ics/ApplicationTest.java
index d3814b5..8ddba05 100644
--- a/src/test/java/org/oransc/ics/ApplicationTest.java
+++ b/src/test/java/org/oransc/ics/ApplicationTest.java
@@ -96,6 +96,7 @@ import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpStatus;
+import org.springframework.http.HttpStatusCode;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.TestPropertySource;
@@ -1419,7 +1420,7 @@ class ApplicationTest {
return this.infoJobs.getJob(jobId);
}
- private HttpStatus putInfoType(String infoTypeId)
+ private HttpStatusCode putInfoType(String infoTypeId)
throws JsonMappingException, JsonProcessingException, ServiceException {
String url = ProducerConsts.API_ROOT + "/info-types/" + infoTypeId;
String body = gson.toJson(ProducerInfoTypeRegistrationInfo(infoTypeId));
diff --git a/src/test/java/org/oransc/ics/MockInformationService.java b/src/test/java/org/oransc/ics/MockInformationService.java
index 7d09a6a..caff3e2 100644
--- a/src/test/java/org/oransc/ics/MockInformationService.java
+++ b/src/test/java/org/oransc/ics/MockInformationService.java
@@ -32,7 +32,9 @@ import org.springframework.test.context.TestPropertySource;
@TestPropertySource(
properties = { //
"server.ssl.key-store=./config/keystore.jks", //
- "app.webclient.trust-store=./config/truststore.jks", "app.vardata-directory=./target"})
+ "app.webclient.trust-store=./config/truststore.jks", //
+ "app.vardata-directory=./target" //
+ })
@SuppressWarnings("squid:S3577") // Not containing any tests since it is a mock.
class MockInformationService {
private static final Logger logger = LoggerFactory.getLogger(ApplicationTest.class);
--
2.16.6