From 92e7d1e2e1c7652975ecad1683a180230f6722ac Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Tue, 24 Jun 2025 13:29:47 +0200 Subject: [PATCH] Upgrade spring-boot to 2.4 - upgrade spring-boot (2.3.12 -> 2.4.13) - upgrade spring-cloud (Hoxton.SR12 -> 2020.0.6) - add dependencyManagement for grpc since it is not managed by spring-cloud anymore - remove tomcat-catalina from common - adjust url paths in test classes since spring's UriComponentsBuilder got stricter with the paths Issue-ID: SO-4184 Signed-off-by: Fiete Ostkamp Change-Id: I0f913791f621e68d5eeba797a77ec1fa89c658c0 --- .../catalogdb/catalogrest/CatalogDBRestTest.java | 30 ++++++++-------- .../client/test/rest/ASDCRestInterfaceTest.java | 34 ++++++++---------- bpmn/so-bpmn-infrastructure-flows/pom.xml | 1 + common/pom.xml | 5 ++- .../HttpHeaderForwarderHandlerInterceptor.java | 12 +++---- .../java/org/onap/so/spring/GracefulShutdown.java | 41 ---------------------- .../org/onap/so/spring/GracefulShutdownBeans.java | 20 ----------- .../onap/so/apihandlerinfra/TasksHandlerTest.java | 6 ++-- .../WorkflowSpecificationsHandlerTest.java | 2 +- pom.xml | 16 +++++---- 10 files changed, 53 insertions(+), 114 deletions(-) delete mode 100644 common/src/main/java/org/onap/so/spring/GracefulShutdown.java delete mode 100644 common/src/main/java/org/onap/so/spring/GracefulShutdownBeans.java diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java index 74ea27cc06..dcb0d5bf22 100644 --- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java +++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java @@ -8,9 +8,9 @@ * 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 - * + * * 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. @@ -49,22 +49,22 @@ import com.fasterxml.jackson.databind.ObjectMapper; public class CatalogDBRestTest extends CatalogDbAdapterBaseTest { - private static final String ECOMP_MSO_CATALOG_V2_VF_MODULES = "ecomp/mso/catalog/v2/vfModules"; + private static final String ECOMP_MSO_CATALOG_V2_VF_MODULES = "/ecomp/mso/catalog/v2/vfModules"; - private static final String SERVICE_RECIPE = "serviceRecipe"; + private static final String SERVICE_RECIPE = "/serviceRecipe"; private static final String ECOMP_MSO_CATALOG_V2_SERVICE_ALLOTTED_RESOURCES = - "ecomp/mso/catalog/v2/serviceAllottedResources"; + "/ecomp/mso/catalog/v2/serviceAllottedResources"; - private static final String ECOMP_MSO_CATALOG_V2_RESOURCE_RECEIPE = "ecomp/mso/catalog/v2/resourceRecipe"; + private static final String ECOMP_MSO_CATALOG_V2_RESOURCE_RECEIPE = "/ecomp/mso/catalog/v2/resourceRecipe"; - private static final String ECOMP_MSO_CATALOG_V2_SERVICE_NETWORKS = "ecomp/mso/catalog/v2/serviceNetworks"; + private static final String ECOMP_MSO_CATALOG_V2_SERVICE_NETWORKS = "/ecomp/mso/catalog/v2/serviceNetworks"; - private static final String ECOMP_MSO_CATALOG_V2_SERVICE_VNFS = "ecomp/mso/catalog/v2/serviceVnfs"; + private static final String ECOMP_MSO_CATALOG_V2_SERVICE_VNFS = "/ecomp/mso/catalog/v2/serviceVnfs"; - private static final String ECOMP_MSO_CATALOG_V2_SERVICE_RESOURCES = "ecomp/mso/catalog/v2/serviceResources"; + private static final String ECOMP_MSO_CATALOG_V2_SERVICE_RESOURCES = "/ecomp/mso/catalog/v2/serviceResources"; - private static final String ECOMP_MSO_CATALOG_PROCESSING_FLAGS = "ecomp/mso/catalog/v2/processingFlags"; + private static final String ECOMP_MSO_CATALOG_PROCESSING_FLAGS = "/ecomp/mso/catalog/v2/processingFlags"; TestRestTemplate restTemplate = new TestRestTemplate("test", "test"); @@ -235,7 +235,7 @@ public class CatalogDBRestTest extends CatalogDbAdapterBaseTest { "{\r\n\"modelInfo\": {\r\n\"modelName\": \"vSAMP10a\",\r\n\"modelUuid\": \"ff2ae348-214a-11e7-93ae-92361f002671\",\r\n\"modelInvariantUuid\": \"2fff5b20-214b-11e7-93ae-92361f002671\",\r\n\"modelVersion\": \"1.0\",\r\n\"modelCustomizationUuid\": \"68dc9a92-214c-11e7-93ae-92361f002671\",\r\n\"modelInstanceName\": \"vSAMP10a 1\"\r\n},\r\n\"toscaNodeType\": \"VF\",\r\n\"nfFunction\": \"vSAMP\",\r\n\"nfType\": \"vSAMP\",\r\n\"nfRole\": \"vSAMP\",\r\n\"nfNamingCode\": \"vSAMP\",\r\n\"multiStageDesign\": null,\r\n\"vfModules\": [\r\n{\r\n\"modelInfo\": {\r\n\"modelName\": \"vSAMP10aDEV::base::module-0\",\r\n\"modelUuid\": \"20c4431c-246d-11e7-93ae-92361f002671\",\r\n\"modelInvariantUuid\": \"78ca26d0-246d-11e7-93ae-92361f002671\",\r\n\"modelVersion\": \"2\",\r\n\"modelCustomizationUuid\": \"cb82ffd8-252a-11e7-93ae-92361f002671\"\r\n},\r\n\"isBase\": true,\r\n\"vfModuleLabel\": \"base\",\r\n\"initialCount\": 1,\r\n\"hasVolumeGroup\": false\r\n},\r\n{\r\n\"modelInfo\": {\r\n\"modelName\": \"vSAMP10aDEV::PCM::module-1\",\r\n\"modelUuid\": \"066de97e-253e-11e7-93ae-92361f002671\",\r\n\"modelInvariantUuid\": \"64efd51a-2544-11e7-93ae-92361f002671\",\r\n\"modelVersion\": \"2\",\r\n\"modelCustomizationUuid\": \"b4ea86b4-253f-11e7-93ae-92361f002671\"\r\n},\r\n\"isBase\": false,\r\n\"vfModuleLabel\": \"PCM\",\r\n\"initialCount\": 0,\r\n\"hasVolumeGroup\": false\r\n}\r\n]\r\n}"; UriComponentsBuilder builder = UriComponentsBuilder .fromHttpUrl( - createURLWithPort("ecomp/mso/catalog/v2/vnfResources/68dc9a92-214c-11e7-93ae-92361f002671")) + createURLWithPort("/ecomp/mso/catalog/v2/vnfResources/68dc9a92-214c-11e7-93ae-92361f002671")) .queryParam("filter", "resourceInput"); ResponseEntity response = @@ -253,7 +253,7 @@ public class CatalogDBRestTest extends CatalogDbAdapterBaseTest { headers.set("Accept", MediaType.APPLICATION_JSON); UriComponentsBuilder builder = UriComponentsBuilder - .fromHttpUrl(createURLWithPort("ecomp/mso/catalog/v2/vnfResources/68dc-11e7-93ae-92361f002671")); + .fromHttpUrl(createURLWithPort("/ecomp/mso/catalog/v2/vnfResources/68dc-11e7-93ae-92361f002671")); ResponseEntity response = restTemplate.exchange(builder.toUriString(), HttpMethod.GET, entity, String.class); @@ -440,7 +440,7 @@ public class CatalogDBRestTest extends CatalogDbAdapterBaseTest { String expectedResponse = "{\r\n\"modelInfo\": {\r\n\"modelName\": \"CONTRAIL30_GNDIRECT\",\r\n\"modelUuid\": \"10b36f65-f4e6-4be6-ae49-9596dc1c47fc\",\r\n\"modelInvariantUuid\": \"ce4ff476-9641-4e60-b4d5-b4abbec1271d\",\r\n\"modelVersion\": \"1.0\",\r\n\"modelCustomizationUuid\": \"3bdbb104-476c-483e-9f8b-c095b3d308ac\",\r\n\"modelInstanceName\": \"CONTRAIL30_GNDIRECT 9\"\r\n},\r\n\"toscaNodeType\": \"\",\r\n\"networkType\": \"\",\r\n\"networkTechnology\": \"\",\r\n\"networkRole\": \"\",\r\n\"networkScope\": \"\"\r\n}"; UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl( - createURLWithPort("ecomp/mso/catalog/v2/networkResources/3bdbb104-476c-483e-9f8b-c095b3d308ac")); + createURLWithPort("/ecomp/mso/catalog/v2/networkResources/3bdbb104-476c-483e-9f8b-c095b3d308ac")); ResponseEntity response = restTemplate.exchange(builder.toUriString(), HttpMethod.GET, entity, String.class); @@ -457,7 +457,7 @@ public class CatalogDBRestTest extends CatalogDbAdapterBaseTest { headers.set("Accept", MediaType.APPLICATION_JSON); UriComponentsBuilder builder = UriComponentsBuilder - .fromHttpUrl(createURLWithPort("ecomp/mso/catalog/v2/networkResources/3bdbb104-4asdf")); + .fromHttpUrl(createURLWithPort("/ecomp/mso/catalog/v2/networkResources/3bdbb104-4asdf")); ResponseEntity response = restTemplate.exchange(builder.toUriString(), HttpMethod.GET, entity, String.class); @@ -622,7 +622,7 @@ public class CatalogDBRestTest extends CatalogDbAdapterBaseTest { "{\r\n\"modelInfo\": {\r\n\"modelName\": \"Tunnel_Xconn\",\r\n\"modelUuid\": \"f6b7d4c6-e8a4-46e2-81bc-31cad5072842\",\r\n\"modelInvariantUuid\": \"b7a1b78e-6b6b-4b36-9698-8c9530da14af\",\r\n\"modelVersion\": \"1.0\",\r\n\"modelCustomizationUuid\": \"367a8ba9-057a-4506-b106-fbae818597c6\",\r\n\"modelInstanceName\": \"Sec_Tunnel_Xconn 11\"\r\n},\r\n\"toscaNodeType\": \"\",\r\n\"allottedResourceType\": \"\",\r\n\"allottedResourceRole\": null,\r\n\"providingServiceModelName\": null,\r\n\"providingServiceModelInvariantUuid\": null,\r\n\"providingServiceModelUuid\": null,\r\n\"nfFunction\": null,\r\n\"nfType\": null,\r\n\"nfRole\": null,\r\n\"nfNamingCode\": null\r\n}"; UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl( - createURLWithPort("ecomp/mso/catalog/v2/allottedResources/367a8ba9-057a-4506-b106-fbae818597c6")); + createURLWithPort("/ecomp/mso/catalog/v2/allottedResources/367a8ba9-057a-4506-b106-fbae818597c6")); ResponseEntity response = diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java index 4170ad05aa..a8ac673d71 100644 --- a/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java +++ b/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java @@ -7,9 +7,9 @@ * 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 - * + * * 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. @@ -43,20 +43,15 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; -import org.mockito.ArgumentMatchers; -import org.mockito.Mockito; import org.mockito.Spy; import org.onap.so.asdc.BaseTest; import org.onap.so.asdc.client.test.emulators.DistributionClientEmulator; import org.onap.so.asdc.client.test.emulators.NotificationDataImpl; import org.onap.so.db.catalog.beans.AllottedResource; import org.onap.so.db.catalog.beans.AllottedResourceCustomization; -import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization; import org.onap.so.db.catalog.beans.NetworkResource; -import org.onap.so.db.catalog.beans.NetworkResourceCustomization; import org.onap.so.db.catalog.beans.Service; import org.onap.so.db.catalog.beans.ToscaCsar; -import org.onap.so.db.catalog.beans.VnfResource; import org.onap.so.db.catalog.beans.VnfResourceCustomization; import org.onap.so.db.catalog.beans.Workflow; import org.onap.so.db.catalog.data.repository.AllottedResourceCustomizationRepository; @@ -65,7 +60,6 @@ import org.onap.so.db.catalog.data.repository.NetworkResourceRepository; import org.onap.so.db.catalog.data.repository.ServiceRepository; import org.onap.so.db.catalog.data.repository.ToscaCsarRepository; import org.onap.so.db.catalog.data.repository.VnfCustomizationRepository; -import org.onap.so.db.catalog.data.repository.VnfResourceRepository; import org.onap.so.db.catalog.data.repository.WorkflowRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.web.client.TestRestTemplate; @@ -143,7 +137,7 @@ public class ASDCRestInterfaceTest extends BaseTest { headers.add("resource-location", "src/test/resources/resource-examples/allottedresource/"); HttpEntity entity = new HttpEntity(request, headers); - ResponseEntity response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"), + ResponseEntity response = restTemplate.exchange(createURLWithPort("/test/treatNotification/v1"), HttpMethod.POST, entity, String.class); assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); @@ -195,7 +189,7 @@ public class ASDCRestInterfaceTest extends BaseTest { headers.add("resource-location", "src/test/resources/resource-examples/vFW/"); HttpEntity entity = new HttpEntity(request, headers); - ResponseEntity response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"), + ResponseEntity response = restTemplate.exchange(createURLWithPort("/test/treatNotification/v1"), HttpMethod.POST, entity, String.class); assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); @@ -239,7 +233,7 @@ public class ASDCRestInterfaceTest extends BaseTest { headers.add("resource-location", "src/test/resources/resource-examples/WorkflowBpmn/"); HttpEntity entity = new HttpEntity(request, headers); - ResponseEntity response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"), + ResponseEntity response = restTemplate.exchange(createURLWithPort("/test/treatNotification/v1"), HttpMethod.POST, entity, String.class); assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); @@ -289,7 +283,7 @@ public class ASDCRestInterfaceTest extends BaseTest { headers.add("resource-location", resourceLocation); HttpEntity entity = new HttpEntity(request, headers); - ResponseEntity response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"), + ResponseEntity response = restTemplate.exchange(createURLWithPort("/test/treatNotification/v1"), HttpMethod.POST, entity, String.class); assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); @@ -333,7 +327,7 @@ public class ASDCRestInterfaceTest extends BaseTest { NotificationDataImpl.class); headers.add("resource-location", resourceLocation); HttpEntity entity = new HttpEntity(request, headers); - ResponseEntity response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"), + ResponseEntity response = restTemplate.exchange(createURLWithPort("/test/treatNotification/v1"), HttpMethod.POST, entity, String.class); assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); @@ -360,13 +354,13 @@ public class ASDCRestInterfaceTest extends BaseTest { request = mapper.readValue(new File(resourceLocation + "nsst-notification.json"), NotificationDataImpl.class); entity = new HttpEntity(request, headers); - response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"), HttpMethod.POST, entity, + response = restTemplate.exchange(createURLWithPort("/test/treatNotification/v1"), HttpMethod.POST, entity, String.class); assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); request = mapper.readValue(new File(resourceLocation + "nst-notification.json"), NotificationDataImpl.class); entity = new HttpEntity(request, headers); - response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"), HttpMethod.POST, entity, + response = restTemplate.exchange(createURLWithPort("/test/treatNotification/v1"), HttpMethod.POST, entity, String.class); assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); @@ -394,7 +388,7 @@ public class ASDCRestInterfaceTest extends BaseTest { NotificationDataImpl.class); headers.add("resource-location", resourceLocation); HttpEntity entity = new HttpEntity(request, headers); - ResponseEntity response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"), + ResponseEntity response = restTemplate.exchange(createURLWithPort("/test/treatNotification/v1"), HttpMethod.POST, entity, String.class); assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); @@ -418,7 +412,7 @@ public class ASDCRestInterfaceTest extends BaseTest { new File(resourceLocation + "demo-vcpe-rescust-notification.json"), NotificationDataImpl.class); headers.add("resource-location", resourceLocation); HttpEntity entity = new HttpEntity(request, headers); - ResponseEntity response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"), + ResponseEntity response = restTemplate.exchange(createURLWithPort("/test/treatNotification/v1"), HttpMethod.POST, entity, String.class); assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); @@ -440,7 +434,7 @@ public class ASDCRestInterfaceTest extends BaseTest { new File(resourceLocation + "service-ubuntu16test-notification.json"), NotificationDataImpl.class); headers.add("resource-location", resourceLocation); HttpEntity entity = new HttpEntity(request, headers); - ResponseEntity response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"), + ResponseEntity response = restTemplate.exchange(createURLWithPort("/test/treatNotification/v1"), HttpMethod.POST, entity, String.class); assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); Optional service = serviceRepo.findById("ed0391da-b963-4c45-bf3a-b49cc7a94fab"); @@ -462,7 +456,7 @@ public class ASDCRestInterfaceTest extends BaseTest { new File(resourceLocation + "service-BasicCnf-notification.json"), NotificationDataImpl.class); headers.add("resource-location", resourceLocation); HttpEntity entity = new HttpEntity(request, headers); - ResponseEntity response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"), + ResponseEntity response = restTemplate.exchange(createURLWithPort("/test/treatNotification/v1"), HttpMethod.POST, entity, String.class); assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); Optional service = serviceRepo.findById("31e0cd50-0a84-42b4-a7a8-dd5d82e6907d"); @@ -483,7 +477,7 @@ public class ASDCRestInterfaceTest extends BaseTest { new File(resourceLocation + "service-BasicNetwork-notification.json"), NotificationDataImpl.class); headers.add("resource-location", resourceLocation); HttpEntity entity = new HttpEntity(request, headers); - ResponseEntity response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"), + ResponseEntity response = restTemplate.exchange(createURLWithPort("/test/treatNotification/v1"), HttpMethod.POST, entity, String.class); assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); Optional service = serviceRepo.findById("9ff42123-ff24-41dc-9f41-a956c9328699"); diff --git a/bpmn/so-bpmn-infrastructure-flows/pom.xml b/bpmn/so-bpmn-infrastructure-flows/pom.xml index 9c3875d8c8..d49e8abb62 100644 --- a/bpmn/so-bpmn-infrastructure-flows/pom.xml +++ b/bpmn/so-bpmn-infrastructure-flows/pom.xml @@ -247,6 +247,7 @@ io.grpc grpc-testing + ${grpc.version} test diff --git a/common/pom.xml b/common/pom.xml index c955437970..4622cc7362 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -162,6 +162,7 @@ io.grpc grpc-protobuf + ${grpc.version} com.google.code.findbugs @@ -172,10 +173,12 @@ io.grpc grpc-netty + ${grpc.version} io.grpc grpc-testing + ${grpc.version} test @@ -340,7 +343,7 @@ maven-surefire-plugin - 2.20 + 3.1.2 DEBUG diff --git a/common/src/main/java/org/onap/so/security/HttpHeaderForwarderHandlerInterceptor.java b/common/src/main/java/org/onap/so/security/HttpHeaderForwarderHandlerInterceptor.java index da01e5e1cf..70feb56881 100644 --- a/common/src/main/java/org/onap/so/security/HttpHeaderForwarderHandlerInterceptor.java +++ b/common/src/main/java/org/onap/so/security/HttpHeaderForwarderHandlerInterceptor.java @@ -5,15 +5,15 @@ * 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 - * + * * 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========================================================= */ @@ -27,8 +27,8 @@ import java.util.function.Function; import java.util.stream.Collectors; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import com.google.common.collect.ImmutableSet; /** @@ -36,7 +36,7 @@ import com.google.common.collect.ImmutableSet; * */ -public class HttpHeaderForwarderHandlerInterceptor extends HandlerInterceptorAdapter { +public class HttpHeaderForwarderHandlerInterceptor implements HandlerInterceptor { private static final ThreadLocal>> HEADERS_THREAD_LOCAL = new ThreadLocal<>(); @@ -52,7 +52,7 @@ public class HttpHeaderForwarderHandlerInterceptor extends HandlerInterceptorAda .collect(Collectors.toMap(Function.identity(), h -> Collections.list(request.getHeaders(h)))); HEADERS_THREAD_LOCAL.set(headerMap); - return super.preHandle(request, response, handler); + return true; } @Override diff --git a/common/src/main/java/org/onap/so/spring/GracefulShutdown.java b/common/src/main/java/org/onap/so/spring/GracefulShutdown.java deleted file mode 100644 index 60f5b076cd..0000000000 --- a/common/src/main/java/org/onap/so/spring/GracefulShutdown.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.onap.so.spring; - -import java.util.concurrent.Executor; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import org.apache.catalina.connector.Connector; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer; -import org.springframework.context.event.ContextClosedEvent; -import org.springframework.context.event.EventListener; - -public class GracefulShutdown implements TomcatConnectorCustomizer { - - private static final Logger logger = LoggerFactory.getLogger(GracefulShutdown.class); - - private volatile Connector connector; - - @Override - public void customize(Connector connector) { - this.connector = connector; - } - - @EventListener - public void handleClosedEvent(ContextClosedEvent event) { - this.connector.pause(); - Executor executor = this.connector.getProtocolHandler().getExecutor(); - if (executor instanceof ThreadPoolExecutor) { - try { - ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executor; - threadPoolExecutor.shutdown(); - if (!threadPoolExecutor.awaitTermination(30, TimeUnit.SECONDS)) { - logger.warn("Tomcat thread pool did not shut down gracefully within " - + "30 seconds. Proceeding with forceful shutdown"); - } - } catch (InterruptedException ex) { - Thread.currentThread().interrupt(); - } - } - } -} diff --git a/common/src/main/java/org/onap/so/spring/GracefulShutdownBeans.java b/common/src/main/java/org/onap/so/spring/GracefulShutdownBeans.java deleted file mode 100644 index 219c82fb19..0000000000 --- a/common/src/main/java/org/onap/so/spring/GracefulShutdownBeans.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.onap.so.spring; - -import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; -import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory; -import org.springframework.context.annotation.Bean; - -public class GracefulShutdownBeans { - - @Bean - public GracefulShutdown gracefulShutdown() { - return new GracefulShutdown(); - } - - @Bean - public ConfigurableServletWebServerFactory webServerFactory(final GracefulShutdown gracefulShutdown) { - TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(); - factory.addConnectorCustomizers(gracefulShutdown); - return factory; - } -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/TasksHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/TasksHandlerTest.java index 77d6f68de9..14d03f60bd 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/TasksHandlerTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/TasksHandlerTest.java @@ -7,9 +7,9 @@ * 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 - * + * * 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. @@ -51,7 +51,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; public class TasksHandlerTest extends BaseTest { - private final String basePath = "onap/so/infra/tasks/v1"; + private final String basePath = "/onap/so/infra/tasks/v1"; @Test public void getTasksTestByOriginalRequestId() diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandlerTest.java index 1fa71cefc2..29b75ac96d 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandlerTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandlerTest.java @@ -64,7 +64,7 @@ public class WorkflowSpecificationsHandlerTest extends BaseTest { @Value("${wiremock.server.port}") private String wiremockPort; - private final String basePath = "onap/so/infra/workflowSpecifications"; + private final String basePath = "/onap/so/infra/workflowSpecifications"; @Test public void queryWorkflowSpecificationsByVnfModelUUID_Test_Success() diff --git a/pom.xml b/pom.xml index 3bf10c0379..93fde1a219 100644 --- a/pom.xml +++ b/pom.xml @@ -66,8 +66,8 @@ content/sites/site/org/onap/so/${project.version}/ 3.4.1 2.1 - 2.3.12.RELEASE - Hoxton.SR12 + 2.4.13 + 2020.0.6 false true 0.33.0 @@ -76,6 +76,7 @@ 1.9.0-SNAPSHOT 1.6.9 2.14.3 + 1.25.0 @@ -981,11 +982,6 @@ shedlock-provider-jdbc-template 4.0.0 - - org.flywaydb - flyway-core - 6.5.7 - org.json json @@ -1125,6 +1121,12 @@ pom import + + io.grpc + grpc-bom + ${grpc.version} + pom + -- 2.16.6