Align dependencies with CPS/NCMP 40/134240/5
authorToineSiebelink <toine.siebelink@est.tech>
Wed, 19 Apr 2023 15:52:14 +0000 (16:52 +0100)
committerToineSiebelink <toine.siebelink@est.tech>
Thu, 20 Apr 2023 11:05:18 +0000 (12:05 +0100)
- Updated several generic dependecies
- Changed OpenAPI to use core.v3 version
- Order of parameters in generated controlelr code changed
- Some maven plugins can uses 'latest' version (affected OpenApi code gen)
- set some lib versions for csit test
- removed spotbug exclusion file (it alwasy used CPS version of this file anyway)
- removed @Valid annotaions in affect file (as agrred long time back)

Issue-ID: CPS-1627

Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
Change-Id: Ib355382df68ed440618737067590631c7c3a1c8b

csit/pylibs.txt
pom.xml
src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java
src/main/resources/spotbugs-exclude.xml [deleted file]

index d6250db..9fee634 100644 (file)
@@ -5,8 +5,8 @@ netifaces
 pyhocon
 requests
 robotframework-httplibrary
-robotframework-requests
-robotframework-selenium2library
+robotframework-requests==0.9.3
+robotframework-selenium2library==3.0.0
 robotframework-extendedselenium2library
 robotframework-sshlibrary
 scapy
diff --git a/pom.xml b/pom.xml
index cb3947f..7a37f76 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -45,7 +45,6 @@
         <jacoco.minimum.coverage>0.98</jacoco.minimum.coverage>
         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <httpclient.version>4.5.13</httpclient.version>
     </properties>
     <dependencyManagement>
         <dependencies>
                 <version>2.8.9</version>
             </dependency>
             <dependency>
-                <groupId>io.swagger</groupId>
+                <groupId>io.swagger.core.v3</groupId>
                 <artifactId>swagger-annotations</artifactId>
-                <version>1.6.2</version>
+                <version>2.1.4</version>
             </dependency>
             <dependency>
                 <groupId>net.logstash.logback</groupId>
                 <artifactId>logstash-logback-encoder</artifactId>
                 <version>7.0.1</version>
             </dependency>
+            <dependency>
+                <groupId>org.apache.httpcomponents</groupId>
+                <artifactId>httpclient</artifactId>
+                <version>4.5.13</version>
+            </dependency>
             <dependency>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-dependencies</artifactId>
-                <version>2.6.4</version>
+                <version>2.7.6</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
             <dependency>
                 <groupId>org.springdoc</groupId>
                 <artifactId>springdoc-openapi-ui</artifactId>
-                <version>1.5.9</version>
+                <version>1.6.6</version>
             </dependency>
             <dependency>
                 <groupId>org.springframework.cloud</groupId>
                 <artifactId>spring-cloud-dependencies</artifactId>
-                <version>2021.0.1</version>
+                <version>2021.0.3</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
             <dependency>
                 <groupId>org.testcontainers</groupId>
                 <artifactId>testcontainers-bom</artifactId>
-                <version>1.15.3</version>
+                <version>1.17.3</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
             <artifactId>micrometer-registry-prometheus</artifactId>
         </dependency>
         <dependency>
-            <groupId>io.swagger</groupId>
+            <groupId>io.swagger.core.v3</groupId>
             <artifactId>swagger-annotations</artifactId>
         </dependency>
         <dependency>
         <dependency>
             <groupId>org.apache.httpcomponents</groupId>
             <artifactId>httpclient</artifactId>
-            <version>${httpclient.version}</version>
         </dependency>
         <dependency>
             <groupId>org.codehaus.groovy</groupId>
             <plugin>
                 <groupId>io.swagger.codegen.v3</groupId>
                 <artifactId>swagger-codegen-maven-plugin</artifactId>
-                <version>3.0.18</version>
                 <executions>
                     <execution>
                         <goals>
             <plugin>
                 <groupId>org.jacoco</groupId>
                 <artifactId>jacoco-maven-plugin</artifactId>
-                <version>0.8.5</version>
                 <configuration>
                     <excludes>
                         <exclude>org/onap/cps/ncmp/dmi/model/*</exclude>
                 <plugin>
                     <groupId>com.google.cloud.tools</groupId>
                     <artifactId>jib-maven-plugin</artifactId>
-                    <version>3.1.4</version>
                     <configuration>
                         <container>
                             <mainClass>${app}</mainClass>
index f952e22..e7ce052 100644 (file)
@@ -28,7 +28,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import javax.validation.Valid;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.onap.cps.ncmp.dmi.model.CmHandles;
@@ -74,7 +73,7 @@ public class DmiRestController implements DmiPluginApi, DmiPluginInternalApi {
 
     @Override
     public ResponseEntity<ModuleSet> getModuleReferences(final String cmHandle,
-                                                         final @Valid ModuleReferencesRequest body) {
+                                                         final ModuleReferencesRequest body) {
         // For onap-dmi-plugin we don't need cmHandleProperties, so DataAccessReadRequest is not used.
         final ModuleSet moduleSet = dmiService.getModulesForCmHandle(cmHandle);
         return ResponseEntity.ok(moduleSet);
@@ -82,8 +81,8 @@ public class DmiRestController implements DmiPluginApi, DmiPluginInternalApi {
 
     @Override
     public ResponseEntity<YangResources> retrieveModuleResources(
-        final @Valid ModuleResourcesReadRequest moduleResourcesReadRequest,
-        final String cmHandle) {
+        final String cmHandle,
+        final ModuleResourcesReadRequest moduleResourcesReadRequest) {
         final List<ModuleReference> moduleReferences = convertRestObjectToJavaApiObject(moduleResourcesReadRequest);
         final YangResources yangResources = dmiService.getModuleResources(cmHandle, moduleReferences);
         return new ResponseEntity<>(yangResources, HttpStatus.OK);
@@ -95,7 +94,7 @@ public class DmiRestController implements DmiPluginApi, DmiPluginInternalApi {
      * @param cmHandles list of cm-handles
      * @return (@ code ResponseEntity) response entity
      */
-    public ResponseEntity<String> registerCmHandles(final @Valid CmHandles cmHandles) {
+    public ResponseEntity<String> registerCmHandles(final CmHandles cmHandles) {
         final List<String> cmHandlesList = cmHandles.getCmHandles();
         if (cmHandlesList.isEmpty()) {
             return new ResponseEntity<>("Need at least one cmHandle to process.", HttpStatus.BAD_REQUEST);
@@ -110,20 +109,20 @@ public class DmiRestController implements DmiPluginApi, DmiPluginInternalApi {
      * supports both read and write operation whereas passthrough operational does not support write operations.
      *
      * @param resourceIdentifier    resource identifier to fetch data
-     * @param datastoreName       name of the datastore
+     * @param datastoreName         name of the datastore
      * @param cmHandle              cm handle identifier
-     * @param dataAccessRequest     data Access Request
      * @param optionsParamInQuery   options query parameter
      * @param topicParamInQuery     topic name for (triggering) async responses
+     * @param dataAccessRequest     data Access Request
      * @return {@code ResponseEntity} response entity
      */
     @Override
     public ResponseEntity<Object> dataAccessPassthrough(final String resourceIdentifier,
                                                         final String datastoreName,
                                                         final String cmHandle,
-                                                        final DataAccessRequest dataAccessRequest,
                                                         final String optionsParamInQuery,
-                                                        final String topicParamInQuery) {
+                                                        final String topicParamInQuery,
+                                                        final DataAccessRequest dataAccessRequest) {
         if (DatastoreType.PASSTHROUGH_OPERATIONAL == DatastoreType.fromDatastoreName(datastoreName)) {
             return dataAccessPassthroughOperational(resourceIdentifier, cmHandle, dataAccessRequest,
                     optionsParamInQuery, topicParamInQuery);
@@ -188,7 +187,7 @@ public class DmiRestController implements DmiPluginApi, DmiPluginInternalApi {
             dataAccessRequest.getDataType(), dataAccessRequest.getData());
     }
 
-    private boolean isReadOperation(final @Valid DataAccessRequest dataAccessRequest) {
+    private boolean isReadOperation(final DataAccessRequest dataAccessRequest) {
         return dataAccessRequest.getOperation() == null
             || dataAccessRequest.getOperation().equals(DataAccessRequest.OperationEnum.READ);
     }
diff --git a/src/main/resources/spotbugs-exclude.xml b/src/main/resources/spotbugs-exclude.xml
deleted file mode 100644 (file)
index e8a1f6e..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<!--
-  ============LICENSE_START=======================================================
-  Copyright (C) 2021 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
-
-  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=========================================================
--->
-
-<FindBugsFilter>
-  <Match>
-    <!-- Ignore generated code -->
-    <Source name="~.*generated-sources.*.java"/>
-  </Match>
-  <Match>
-    <Or>
-      <!-- Anonymous inner classes are very common. -->
-      <Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON" />
-
-      <!-- We use static slf4j Logger (this rule is from KengoTODA/findbugs-slf4j jp.skypencil.findbugs.slf4:bug-pattern) -->
-      <Bug pattern="SLF4J_LOGGER_SHOULD_BE_NON_STATIC" />
-
-      <!-- Guava 25.1+ uses the Checker Framework's @Nullable which SpotBugs doesn't handle correctly, even though it's
-           supposed to; see https://github.com/spotbugs/spotbugs/issues/743 -->
-      <Bug pattern="NP_NONNULL_PARAM_VIOLATION" />
-      <Bug pattern="NP_NULL_PARAM_DEREF" />
-      <Bug pattern="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE" />
-      <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" />
-
-      <!-- https://stackoverflow.com/a/34674776. Doesn't detect Lombok All Args Constructor variables being used with map get key and value, which can lead to spotbugs being detected
-      on used fields -->
-      <Bug pattern="URF_UNREAD_FIELD"/>
-
-      <!-- https://github.com/spotbugs/spotbugs/issues/511. Strict reading of Object.equals() contract means that
-           evenever equals() behaviour is defined, all implementations need to adhere to it. The only reason
-           to override the method (assuming correct API design, of course) is to provide a more efficient
-           implementation. This rule would be forcing a @SuppressFBWarnings on perfectly compliant classes. -->
-      <Bug pattern="EQ_DOESNT_OVERRIDE_EQUALS"/>
-
-      <!-- https://github.com/spotbugs/spotbugs/issues/756. spotbugs does not grok Java 11's try-with-resources -->
-      <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
-    </Or>
-  </Match>
-
-</FindBugsFilter>