From 4e3e0c14f614f9d3486b90b235a778e583cd763b Mon Sep 17 00:00:00 2001 From: egernug Date: Tue, 31 Oct 2023 16:05:35 +0000 Subject: TBDMT Package Upgrades - Java 17 - Springboot 3.1.2 - Fixed code where needed because of dependency updates Issue-ID: CPS-1911 Signed-off-by: egernug Change-Id: Ie0c474c720e408a9b325cec6c4a11f259b3d4102 --- cps-tbdmt-dependencies/pom.xml | 57 +++++++--------- cps-tbdmt-parent/pom.xml | 27 +++----- cps-tbdmt-rest/pom.xml | 52 ++++---------- .../tbdmt/exception/TemplateExceptionHandler.java | 38 ++++++----- .../onap/cps/tbdmt/rest/ExecutionController.java | 39 +++++------ .../onap/cps/tbdmt/rest/TemplateController.java | 35 +++++----- cps-tbdmt-service/pom.xml | 79 ++++++++-------------- .../org/onap/cps/tbdmt/model/TemplateRequest.java | 35 +++++----- 8 files changed, 149 insertions(+), 213 deletions(-) diff --git a/cps-tbdmt-dependencies/pom.xml b/cps-tbdmt-dependencies/pom.xml index 3591911..6edd5f9 100644 --- a/cps-tbdmt-dependencies/pom.xml +++ b/cps-tbdmt-dependencies/pom.xml @@ -29,12 +29,12 @@ This artifact contains dependencyManagement declarations of upstream versions. - 1.0.0 - 1.0.1.Final - 2.5.6 - 1.18.16 + 3.3.5 + 1.0.2.Final + 2.7.1 + 1.18.24 https://nexus.onap.org - 0.8.13 + 0.9.1 42.5.1 /content/repositories/releases/ /content/repositories/snapshots/ @@ -56,6 +56,20 @@ + + org.springframework.boot + spring-boot-dependencies + 3.1.2 + pom + import + + + org.springframework.cloud + spring-cloud-dependencies + 2022.0.3 + pom + import + org.onap.cps cps-dependencies @@ -80,6 +94,11 @@ gson 2.8.9 + + org.apache.httpcomponents.client5 + httpclient5 + 5.2.1 + org.postgresql postgresql @@ -99,24 +118,6 @@ com.hubspot.jinjava jinjava ${jinjava.version} - - - com.fasterxml.jackson.core - jackson-annotations - - - com.fasterxml.jackson.core - jackson-databind - - - com.fasterxml.jackson.core - jackson-core - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - - com.openpojo @@ -124,16 +125,6 @@ ${openpojo.version} test - - org.apache.logging.log4j - log4j-api - 2.16.0 - - - org.apache.logging.log4j - log4j-to-slf4j - 2.16.0 - diff --git a/cps-tbdmt-parent/pom.xml b/cps-tbdmt-parent/pom.xml index 2466a81..4944083 100644 --- a/cps-tbdmt-parent/pom.xml +++ b/cps-tbdmt-parent/pom.xml @@ -19,17 +19,17 @@ org.onap.cps.tbdmt.Application nexus3.onap.org:10001/ nexus3.onap.org:10003/ - ${docker.repository.pull}onap/integration-java11:8.0.0 + ${docker.repository.pull}onap/integration-java17:12.0.0 ${docker.repository.push}onap/cps-tbdmt yyyyMMdd'T'HHmmss'Z' - 1.0.0 - 11 - 0.9 + 3.3.5 + 17 + 0.90 https://nexus.onap.org 3.2.0 UTF-8 /content/repositories/releases/ - 4.1.3 + 4.4.2 2.3.3.RELEASE 1.8.0-beta4 1.5.0 @@ -270,6 +270,7 @@ org.apache.maven.plugins maven-surefire-plugin + 3.0.0-M5 ${surefireArgLine} @@ -294,6 +295,7 @@ org.jacoco jacoco-maven-plugin + 0.8.10 default-prepare-agent @@ -322,24 +324,12 @@ - - report - - report-aggregate - - verify - - - **/code-coverage/jacoco-ut.exec - - - com.google.cloud.tools jib-maven-plugin - 3.0.0 + 3.3.2 ${app} @@ -379,6 +369,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin + 3.9.1.2184 diff --git a/cps-tbdmt-rest/pom.xml b/cps-tbdmt-rest/pom.xml index 8327d33..5ffcc84 100644 --- a/cps-tbdmt-rest/pom.xml +++ b/cps-tbdmt-rest/pom.xml @@ -29,15 +29,12 @@ cps-tbdmt-rest - - 11.0.12 - - ${project.groupId} cps-tbdmt-service + org.springframework.boot spring-boot-starter-web @@ -50,51 +47,28 @@ org.springframework.boot - spring-boot-starter-jetty - 2.5.5 - - - org.eclipse.jetty - jetty-io - - - org.eclipse.jetty - jetty-servlets - - - org.eclipse.jetty - jetty-http - - - org.glassfish - jakarta.el - - + spring-boot-starter-validation - org.eclipse.jetty - jetty-io - ${jetty.version} - - - org.eclipse.jetty - jetty-servlets - ${jetty.version} - - - org.eclipse.jetty - jetty-http - ${jetty.version} + org.springframework.boot + spring-boot-starter-jetty + - junit - junit + org.junit.vintage + junit-vintage-engine test org.springframework.boot spring-boot-starter-test test + + + org.junit.jupiter + junit-jupiter + + diff --git a/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/exception/TemplateExceptionHandler.java b/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/exception/TemplateExceptionHandler.java index fa6fa28..d20e9f3 100644 --- a/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/exception/TemplateExceptionHandler.java +++ b/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/exception/TemplateExceptionHandler.java @@ -1,21 +1,22 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - * ================================================================================ - * Copyright (C) 2021 Wipro Limited. - * ================================================================================ - * 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 +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Wipro Limited. + * Modifications 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 + * 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. - * ============LICENSE_END========================================================= + * 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.cps.tbdmt.exception; @@ -25,6 +26,7 @@ import java.util.List; import org.onap.cps.tbdmt.model.ErrorResponse; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; +import org.springframework.http.HttpStatusCode; import org.springframework.http.ResponseEntity; import org.springframework.validation.ObjectError; import org.springframework.web.bind.MethodArgumentNotValidException; @@ -70,8 +72,8 @@ public class TemplateExceptionHandler extends ResponseEntityExceptionHandler { @Override protected ResponseEntity handleMethodArgumentNotValid( - final MethodArgumentNotValidException methodArgumentNotValidException, final HttpHeaders httpHeaders, - final HttpStatus httpStatus, final WebRequest webRequest) { + final MethodArgumentNotValidException methodArgumentNotValidException, final HttpHeaders httpHeaders, + final HttpStatusCode httpStatus, final WebRequest webRequest) { final List details = new ArrayList<>(); for (final ObjectError objectError : methodArgumentNotValidException.getBindingResult().getAllErrors()) { details.add(objectError.getDefaultMessage()); diff --git a/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/rest/ExecutionController.java b/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/rest/ExecutionController.java index b7dc4f6..2d717ae 100644 --- a/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/rest/ExecutionController.java +++ b/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/rest/ExecutionController.java @@ -1,26 +1,27 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - * ================================================================================ - * Copyright (C) 2021 Wipro Limited. - * ================================================================================ - * 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 +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Wipro Limited. + * Modifications 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 + * 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. - * ============LICENSE_END========================================================= + * 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.cps.tbdmt.rest; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.onap.cps.tbdmt.model.ExecutionRequest; import org.onap.cps.tbdmt.service.ExecutionBusinessLogic; import org.springframework.beans.factory.annotation.Autowired; @@ -47,8 +48,8 @@ public class ExecutionController { */ @PostMapping(path = "/execute/{model}/{templateId}") public ResponseEntity executeTemplate(@Valid @PathVariable final String model, - @Valid @PathVariable final String templateId, - @Valid @RequestBody final ExecutionRequest executionRequest) { + @Valid @PathVariable final String templateId, + @Valid @RequestBody final ExecutionRequest executionRequest) { final String result = executionBusinessLogic.executeTemplate(model, templateId, executionRequest); return new ResponseEntity<>(result, HttpStatus.OK); } diff --git a/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/rest/TemplateController.java b/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/rest/TemplateController.java index a17130f..cdb5f9c 100644 --- a/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/rest/TemplateController.java +++ b/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/rest/TemplateController.java @@ -1,27 +1,28 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - * ================================================================================ - * Copyright (C) 2021 Wipro Limited. - * ================================================================================ - * 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 +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Wipro Limited. + * Modifications 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 + * 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. - * ============LICENSE_END========================================================= + * 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.cps.tbdmt.rest; +import jakarta.validation.Valid; import java.util.Collection; -import javax.validation.Valid; import org.onap.cps.tbdmt.exception.TemplateNotFoundException; import org.onap.cps.tbdmt.model.Template; import org.onap.cps.tbdmt.model.TemplateKey; diff --git a/cps-tbdmt-service/pom.xml b/cps-tbdmt-service/pom.xml index 485940a..ab2b183 100644 --- a/cps-tbdmt-service/pom.xml +++ b/cps-tbdmt-service/pom.xml @@ -37,54 +37,29 @@ jar - 5.3.24 yyyyMMdd'T'HHmmss - org.springframework - spring-beans - ${spring.version} + javax.persistence + javax.persistence-api - org.springframework - spring-web - ${spring.version} - - - org.springframework - spring-webmvc - ${spring.version} - - - org.springframework - spring-core - ${spring.version} + org.springframework.boot + spring-boot-starter-web - org.springframework - spring-expression - ${spring.version} - - - org.springframework - spring-tx - ${spring.version} + org.springframework.boot + spring-boot-starter-validation - org.springframework.data - spring-data-commons + org.springframework.boot + spring-boot-starter-data-jpa org.postgresql postgresql - 42.3.6 - - - org.springframework.boot - spring-boot-starter-data-jpa - 2.5.0 org.projectlombok @@ -94,44 +69,44 @@ com.hubspot.jinjava jinjava - - org.springframework.boot - spring-boot-starter-json - - - org.springframework.boot - spring-boot-starter-validation - 2.5.2 - - - org.glassfish - jakarta.el - - - com.google.code.gson gson + + jakarta.validation + jakarta.validation-api + org.apache.httpcomponents httpclient - + com.openpojo openpojo test - junit - junit + org.apache.httpcomponents.client5 + httpclient5 + test + + + org.junit.vintage + junit-vintage-engine test org.springframework.boot spring-boot-starter-test test + + + org.junit.jupiter + junit-jupiter + + - + \ No newline at end of file diff --git a/cps-tbdmt-service/src/main/java/org/onap/cps/tbdmt/model/TemplateRequest.java b/cps-tbdmt-service/src/main/java/org/onap/cps/tbdmt/model/TemplateRequest.java index b7873cf..6151e1a 100644 --- a/cps-tbdmt-service/src/main/java/org/onap/cps/tbdmt/model/TemplateRequest.java +++ b/cps-tbdmt-service/src/main/java/org/onap/cps/tbdmt/model/TemplateRequest.java @@ -1,27 +1,28 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - * ================================================================================ - * Copyright (C) 2021 Wipro Limited. - * ================================================================================ - * 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 +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Wipro Limited. + * Modifications 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 + * 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. - * ============LICENSE_END========================================================= + * 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.cps.tbdmt.model; +import jakarta.validation.constraints.NotEmpty; import java.io.Serializable; -import javax.validation.constraints.NotEmpty; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; -- cgit 1.2.3-korg