Update plugins and other dependencies to compile with more modern Java 66/142766/1 master
authorToineSiebelink <toine.siebelink@est.tech>
Mon, 15 Dec 2025 08:43:30 +0000 (08:43 +0000)
committerToineSiebelink <toine.siebelink@est.tech>
Mon, 15 Dec 2025 09:21:26 +0000 (09:21 +0000)
- Update Maven compile plugin
- Update Lombok
- Update SpotBug
- Fix SpotBug warning in SdncOperations

Issue-ID: CPS-3093
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
Change-Id: I609dad2b1626f8cb67b642a54b6aabc7569ca344

dmi-service/pom.xml
dmi-service/src/main/java/org/onap/cps/ncmp/dmi/service/operation/SdncOperations.java
pom.xml

index 15e8dc5..9627b99 100644 (file)
@@ -47,7 +47,7 @@
         <openapi.generator.maven.plugin.version>7.12.0</openapi.generator.maven.plugin.version>
         <sonar.version>4.0.0.4121</sonar.version>
         <spring.boot.maven.plugin.version>3.5.6</spring.boot.maven.plugin.version>
-        <spotbugs.maven.plugin.version>4.7.3.0</spotbugs.maven.plugin.version>
+        <spotbugs.maven.plugin.version>4.8.6.4</spotbugs.maven.plugin.version>
         <maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
 
         <!-- Code Coverage Configuration -->
             <dependency>
                 <groupId>org.projectlombok</groupId>
                 <artifactId>lombok</artifactId>
-                <version>1.18.24</version>
+                <version>1.18.32</version>
             </dependency>
             <dependency>
                 <groupId>${cps.groupId}</groupId>
         </snapshotRepository>
     </distributionManagement>
 
-</project>
\ No newline at end of file
+</project>
index 45b7bb8..71e7953 100644 (file)
@@ -67,7 +67,7 @@ public class SdncOperations {
     private static final int QUERY_PARAM_NAME_INDEX = 0;
 
     private static final EnumMap<OperationEnum, HttpMethod> operationToHttpMethodMap =
-            new EnumMap<>(OperationEnum.class);
+        new EnumMap<>(OperationEnum.class);
 
     static {
         operationToHttpMethodMap.put(OperationEnum.READ, HttpMethod.GET);
@@ -79,8 +79,6 @@ public class SdncOperations {
 
     private final SdncProperties sdncProperties;
     private final SdncRestconfClient sdncRestconfClient;
-    private final String topologyUrlData;
-    private final String topologyUrlOperational;
 
     private final Configuration jsonPathConfiguration = Configuration.builder()
         .mappingProvider(new JacksonMappingProvider())
@@ -88,7 +86,7 @@ public class SdncOperations {
         .build();
 
     /**
-     * Constructor for {@code SdncOperations}. This method also manipulates url properties.
+     * Constructor for {@code SdncOperations}.
      *
      * @param sdncProperties     {@code SdncProperties}
      * @param sdncRestconfClient {@code SdncRestconfClient}
@@ -96,12 +94,10 @@ public class SdncOperations {
     public SdncOperations(final SdncProperties sdncProperties, final SdncRestconfClient sdncRestconfClient) {
         this.sdncProperties = sdncProperties;
         this.sdncRestconfClient = sdncRestconfClient;
-        topologyUrlOperational = getTopologyUrlOperational();
-        topologyUrlData = getTopologyUrlData();
     }
 
     /**
-     * This method fetches list of modules usind sdnc client.
+     * This method fetches list of modules using sdnc client.
      *
      * @param nodeId node id for node
      * @return a collection of module schemas
@@ -202,7 +198,7 @@ public class SdncOperations {
     }
 
     private String prepareGetOperationSchemaUrl(final String nodeId) {
-        return UriComponentsBuilder.fromUriString(topologyUrlOperational)
+        return UriComponentsBuilder.fromUriString(getTopologyUrl(TOPOLOGY_URL_TEMPLATE_OPERATIONAL))
                 .pathSegment("node={nodeId}")
                 .pathSegment("yang-ext:mount")
                 .path(GET_SCHEMA_SOURCES_URL)
@@ -225,43 +221,30 @@ public class SdncOperations {
     }
 
     private String addQuery(final String url, final MultiValueMap<String, String> queryMap) {
-
-        return UriComponentsBuilder
-                       .fromUriString(url)
-                       .queryParams(queryMap)
-                       .buildAndExpand().toUriString();
+        return UriComponentsBuilder.fromUriString(url).queryParams(queryMap).buildAndExpand().toUriString();
     }
 
     private String addTopologyDataUrlwithNode(final String nodeId) {
-        return UriComponentsBuilder
-                       .fromUriString(topologyUrlData)
-                       .pathSegment("node={nodeId}")
-                       .pathSegment("yang-ext:mount")
-                       .buildAndExpand(nodeId).toUriString();
+        return UriComponentsBuilder.fromUriString(getTopologyUrl(TOPOLOGY_URL_TEMPLATE_DATA))
+                                   .pathSegment("node={nodeId}")
+                                   .pathSegment("yang-ext:mount")
+                                   .buildAndExpand(nodeId).toUriString();
     }
 
     private List<ModuleSchema> convertToModuleSchemas(final String modulesListAsJson) {
         try {
             return JsonPath.using(jsonPathConfiguration).parse(modulesListAsJson).read(
-                PATH_TO_MODULE_SCHEMAS, new TypeRef<>() {
-                });
+                PATH_TO_MODULE_SCHEMAS, new TypeRef<>() {});
         } catch (final JsonPathException jsonPathException) {
             throw new SdncException("SDNC Response processing failed",
                 "SDNC response is not in the expected format.", jsonPathException);
         }
     }
 
-    private String getTopologyUrlData() {
-        return UriComponentsBuilder.fromUriString(TOPOLOGY_URL_TEMPLATE_DATA)
-                .path("topology={topologyId}")
-                .buildAndExpand(this.sdncProperties.getTopologyId()).toUriString();
-    }
-
-    private String getTopologyUrlOperational() {
-        return UriComponentsBuilder.fromUriString(
-                        TOPOLOGY_URL_TEMPLATE_OPERATIONAL)
-                .path("topology={topologyId}")
-                .buildAndExpand(this.sdncProperties.getTopologyId()).toUriString();
+    private String getTopologyUrl(final String uriTemplate) {
+        return UriComponentsBuilder.fromUriString(uriTemplate)
+                                   .path("topology={topologyId}")
+                                   .buildAndExpand(sdncProperties.getTopologyId()).toUriString();
     }
 
     private Map<String, String> extractQueryParams(final String optionsParamInQuery,
diff --git a/pom.xml b/pom.xml
index b200124..b0397b0 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -58,7 +58,7 @@
         <!-- Code Quality and Dependency Management -->
         <checkstyle.config.location>${project.basedir}</checkstyle.config.location>
         <maven.checkstyle.plugin.version>3.3.1</maven.checkstyle.plugin.version>
-        <maven.compiler.plugin.version>3.13.0</maven.compiler.plugin.version>
+        <maven.compiler.plugin.version>3.14.1</maven.compiler.plugin.version>
         <maven.compiler.source>17</maven.compiler.source>
         <maven.compiler.target>17</maven.compiler.target>
         <maven.dependency.plugin.version>3.7.1</maven.dependency.plugin.version>