Uplift jetty to version 12.x.y 01/140301/4
authoradheli.tavares <adheli.tavares@est.tech>
Tue, 11 Feb 2025 11:16:00 +0000 (11:16 +0000)
committeradheli.tavares <adheli.tavares@est.tech>
Wed, 26 Feb 2025 15:24:21 +0000 (15:24 +0000)
Issue-ID: POLICY-5254
Change-Id: Ie7bbba094068a5398493d8151174a780aac2afc5
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
models-interactions/model-impl/rest/pom.xml
models-interactions/model-simulators/pom.xml
models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/Util.java
models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/CdsSimulatorTest.java

index 33919d7..b573280 100644 (file)
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-server</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-security</artifactId>
+            <scope>runtime</scope>
+        </dependency>
         <dependency>
             <groupId>org.glassfish.jersey.inject</groupId>
             <artifactId>jersey-hk2</artifactId>
index 2105d54..6dc0407 100644 (file)
@@ -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=========================================================
   -->
 
             <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
             <artifactId>cds</artifactId>
             <version>${project.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>junit</groupId>
+                    <artifactId>junit</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
             <version>${policy.common.version}</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.onap.aai.schema-service</groupId>
-            <artifactId>aai-schema</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
-            <artifactId>blueprint-proto</artifactId>
-        </dependency>
         <dependency>
             <groupId>com.google.code.gson</groupId>
             <artifactId>gson</artifactId>
             <scope>provided</scope>
         </dependency>
-        <dependency>
-            <groupId>com.google.protobuf</groupId>
-            <artifactId>protobuf-java-util</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.google.protobuf</groupId>
-            <artifactId>protobuf-java</artifactId>
-        </dependency>
         <dependency>
             <groupId>commons-io</groupId>
             <artifactId>commons-io</artifactId>
             <artifactId>commons-lang3</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.eclipse.jetty.toolchain</groupId>
-            <artifactId>jetty-jakarta-servlet-api</artifactId>
+            <groupId>jakarta.servlet</groupId>
+            <artifactId>jakarta.servlet-api</artifactId>
         </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
index 37c1b0c..0dd9a09 100644 (file)
@@ -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";
 
index 178ee8f..9c0ec53 100644 (file)
@@ -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(