Merge "Migrate to springboot 3"
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": "<h1>API documentation<\/h1><h2>General<\/h2><p> 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. <br /><br />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><h2>APIs provided by the service<\/h2><h4>A1-EI<\/h4><p> 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><h4>Data producer API<\/h4><p> 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:<ul><li>Registry of supported information types and which parameters needed to setup a subscription.<\/li><li>Registry of existing data producers.<\/li><li>Callback API provided by producers to setup subscriptions.<\/li><\/ul><\/p><h4>Data consumer API<\/h4><p> 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 consumers and provides support for:<ul><li>Querying of available types of data to consume.<\/li><li>Management of data subscription jobs<\/li><li>Optional callback API provided by consumers to get notification on added and removed information types.<\/li><\/ul><\/p><h4>Service status<\/h4><p> This API provides a means to monitor the health of this service.<\/p>",
diff --git a/api/ics-api.yaml b/api/ics-api.yaml
index dad91b5..e7a0629 100644
--- a/api/ics-api.yaml
+++ b/api/ics-api.yaml
@@ -24,7 +24,7 @@
added and removed information types.</li></ul></p><h4>Service status</h4><p> This
API provides a means to monitor the health of this service.</p>
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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,32 +541,12 @@
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
- parameters:
- - name: name
- in: path
- required: true
- style: simple
- explode: false
- schema:
- type: string
- responses:
- 200:
- description: OK
- content:
- '*/*':
- schema:
- type: object
- post:
- tags:
- - Actuator
- summary: Actuator web endpoint 'loggers-name'
operationId: loggers-name
parameters:
- name: name
@@ -533,6 +560,45 @@
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_2
+ parameters:
+ - name: name
+ in: path
+ required: true
+ style: simple
+ explode: false
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: string
+ enum:
+ - TRACE
+ - DEBUG
+ - INFO
+ - WARN
+ - ERROR
+ - FATAL
+ - OFF
+ responses:
+ 200:
+ description: OK
+ content:
'*/*':
schema:
type: object
@@ -671,7 +737,13 @@
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 @@
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 @@
200:
description: OK
content:
- '*/*':
+ text/plain;charset=UTF-8:
schema:
type: object
/data-consumer/v1/info-jobs/{infoJobId}:
@@ -1170,7 +1248,13 @@
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 @@
200:
description: OK
content:
- '*/*':
+ application/octet-stream:
schema:
type: object
components:
@@ -1303,8 +1387,6 @@
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 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
- <version>2.7.6</version>
+ <version>3.0.2</version>
<relativePath />
</parent>
<groupId>org.o-ran-sc.nonrtric.plt</groupId>
@@ -46,10 +46,8 @@
</repository>
</repositories>
<properties>
- <java.version>11</java.version>
- <springfox.version>3.0.0</springfox.version>
+ <java.version>17</java.version>
<gson.version>2.9.0</gson.version>
- <swagger.version>2.1.13</swagger.version>
<json.version>20211205</json.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<formatter-maven-plugin.version>2.12.2</formatter-maven-plugin.version>
@@ -57,11 +55,22 @@
<swagger-codegen-maven-plugin.version>3.0.11</swagger-codegen-maven-plugin.version>
<docker-maven-plugin>0.30.0</docker-maven-plugin>
<sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
- <jacoco-maven-plugin.version>0.8.5</jacoco-maven-plugin.version>
+ <jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
+ <springdoc.version>2.0.2</springdoc.version>
<exec.skip>true</exec.skip>
</properties>
<dependencies>
<dependency>
+ <groupId>org.springdoc</groupId>
+ <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
+ <version>${springdoc.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springdoc</groupId>
+ <artifactId>springdoc-openapi-ui</artifactId>
+ <version>${springdoc.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
@@ -78,16 +87,6 @@
<artifactId>spring-webflux</artifactId>
</dependency>
<dependency>
- <groupId>io.swagger.core.v3</groupId>
- <artifactId>swagger-jaxrs2</artifactId>
- <version>${swagger.version}</version>
- </dependency>
- <dependency>
- <groupId>io.swagger.core.v3</groupId>
- <artifactId>swagger-jaxrs2-servlet-initializer</artifactId>
- <version>${swagger.version}</version>
- </dependency>
- <dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
@@ -113,17 +112,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
- <!--REQUIRED TO GENERATE DOCUMENTATION -->
- <dependency>
- <groupId>io.springfox</groupId>
- <artifactId>springfox-swagger2</artifactId>
- <version>${springfox.version}</version>
- </dependency>
- <dependency>
- <groupId>io.springfox</groupId>
- <artifactId>springfox-swagger-ui</artifactId>
- <version>${springfox.version}</version>
- </dependency>
<!-- For development help -->
<dependency>
<groupId>org.springframework.boot</groupId>
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 @@
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.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 @@
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 @@
@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);