From: adheli.tavares Date: Tue, 11 Feb 2025 11:16:00 +0000 (+0000) Subject: Uplift jetty to version 12.x.y X-Git-Tag: 4.1.1~3 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=d1c9516f818ed2cf10987674e626d2de8fb15453;p=policy%2Fmodels.git Uplift jetty to version 12.x.y Issue-ID: POLICY-5254 Change-Id: Ie7bbba094068a5398493d8151174a780aac2afc5 Signed-off-by: adheli.tavares --- diff --git a/models-interactions/model-impl/rest/pom.xml b/models-interactions/model-impl/rest/pom.xml index 33919d781..b57328079 100644 --- a/models-interactions/model-impl/rest/pom.xml +++ b/models-interactions/model-impl/rest/pom.xml @@ -71,6 +71,16 @@ org.apache.commons commons-lang3 + + org.eclipse.jetty + jetty-server + runtime + + + org.eclipse.jetty + jetty-security + runtime + org.glassfish.jersey.inject jersey-hk2 diff --git a/models-interactions/model-simulators/pom.xml b/models-interactions/model-simulators/pom.xml index 2105d54f8..6dc0407d8 100644 --- a/models-interactions/model-simulators/pom.xml +++ b/models-interactions/model-simulators/pom.xml @@ -3,7 +3,7 @@ ONAP ================================================================================ Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. - Modifications Copyright (C) 2019, 2023-2024 Nordix Foundation. + Modifications Copyright (C) 2019, 2023-2025 Nordix Foundation. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ 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========================================================= --> @@ -63,6 +65,12 @@ org.onap.policy.models.policy-models-interactions.model-impl cds ${project.version} + + + junit + junit + + org.onap.policy.models.policy-models-interactions.model-impl @@ -116,27 +124,11 @@ ${policy.common.version} test - - org.onap.aai.schema-service - aai-schema - - - org.onap.ccsdk.cds.blueprintsprocessor.modules - blueprint-proto - com.google.code.gson gson provided - - com.google.protobuf - protobuf-java-util - - - com.google.protobuf - protobuf-java - commons-io commons-io @@ -150,8 +142,8 @@ commons-lang3 - org.eclipse.jetty.toolchain - jetty-jakarta-servlet-api + jakarta.servlet + jakarta.servlet-api org.mockito diff --git a/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/Util.java b/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/Util.java index 37c1b0c2c..0dd9a09dd 100644 --- a/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/Util.java +++ b/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/Util.java @@ -3,7 +3,7 @@ * simulators * ================================================================================ * Copyright (C) 2017-2019, 2021 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019, 2023-2024 Nordix Foundation. + * Modifications Copyright (C) 2019, 2023-2025 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ * 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========================================================= */ @@ -43,7 +45,6 @@ public final class Util { public static final int SDNCSIM_SERVER_PORT = 6670; public static final int CDSSIM_SERVER_PORT = 6671; - private static final String CANNOT_PROCESS_PARAMETERS = "cannot parse parameters "; private static final String CANNOT_CONNECT = "cannot connect to port "; public static final String LOCALHOST = "localhost"; diff --git a/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/CdsSimulatorTest.java b/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/CdsSimulatorTest.java index 178ee8f98..9c0ec532e 100644 --- a/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/CdsSimulatorTest.java +++ b/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/CdsSimulatorTest.java @@ -17,6 +17,8 @@ * 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========================================================= */ @@ -38,6 +40,7 @@ import java.util.concurrent.TimeUnit; import org.apache.commons.io.IOUtils; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc; import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceStub; @@ -59,23 +62,26 @@ class CdsSimulatorTest { * wait for the prior server to shut down. */ @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { int port = NetworkUtil.allocPort(); sim = new CdsSimulator(Util.LOCALHOST, port); sim.start(); + assertTrue(NetworkUtil.isTcpPortOpen(Util.LOCALHOST, port, 200, 250L)); } @AfterEach - public void tearDown() { + void tearDown() { sim.stop(); } @Test + @Order(1) void test() throws Exception { - String reqstr = IOUtils.toString(Objects.requireNonNull(getClass().getResource("cds/cds.request.json")), + String requestStr = IOUtils.toString( + Objects.requireNonNull(getClass().getResource("cds/cds.request.json")), StandardCharsets.UTF_8); Builder builder = ExecutionServiceInput.newBuilder(); - JsonFormat.parser().ignoringUnknownFields().merge(reqstr, builder); + JsonFormat.parser().ignoringUnknownFields().merge(requestStr, builder); ExecutionServiceInput request = builder.build(); ManagedChannel channel = NettyChannelBuilder.forAddress(Util.LOCALHOST, sim.getPort()).usePlaintext().build(); @@ -126,6 +132,7 @@ class CdsSimulatorTest { } @Test + @Order(2) void testGetResponse() throws IOException, CoderException { CdsSimulator cdsSimulator = new CdsSimulator(Util.LOCALHOST, sim.getPort()); String reqstr = ResourceUtils.getResourceAsString(