From b4ab8c4ed907038a294ccad78e36d10ad6a1567b Mon Sep 17 00:00:00 2001 From: "akshay.khairnar@t-systems.com" Date: Mon, 17 Nov 2025 06:27:56 +0100 Subject: [PATCH] Upgrade Java version 17 for AAI modelloader - Upgrade java version to 17 - testcase fixes - Bump up model-loader version 1.15.0 Issue-ID: AAI-4209 Change-Id: If47f1499566d51f93435e11f5b8b7fb65979b85d Signed-off-by: akshay.khairnar@t-systems.com --- pom.xml | 18 +++++++++++------- .../org/onap/aai/modelloader/config/BeanConfig.java | 4 ++-- .../onap/aai/modelloader/config/ModelLoaderConfig.java | 5 ++--- .../modelloader/entity/catalog/VnfImageException.java | 3 ++- .../entity/model/BabelArtifactParsingException.java | 4 +++- .../aai/modelloader/entity/model/ModelArtifact.java | 4 ++-- .../modelloader/entity/model/NamedQueryArtifact.java | 2 +- .../extraction/InvalidArchiveException.java | 4 +++- .../notification/DownloadFailureException.java | 4 +++- .../notification/ProcessToscaArtifactsException.java | 4 +++- .../restclient/BabelServiceClientException.java | 4 +++- .../org/onap/aai/modelloader/util/GizmoTranslator.java | 2 +- .../aai/modelloader/BabelClientTestConfiguration.java | 4 ++-- .../DistributionClientTestConfiguration.java | 4 ++-- .../entity/catalog/TestVnfCatalogArtifactHandler.java | 6 +++--- .../entity/model/TestModelArtifactParser.java | 10 +++++----- .../entity/model/TestNamedQueryArtifactParser.java | 4 ++-- .../DistributionClientIntegrationTest.java | 4 ++-- .../aai/modelloader/restclient/TestAaiRestClient.java | 8 ++++---- .../modelloader/restclient/TestBabelServiceClient.java | 4 ++-- .../onap/aai/modelloader/util/TestGizmoTranslator.java | 4 ++-- .../aai/modelloader/util/TestJsonXmlConverter.java | 6 +++--- version.properties | 4 ++-- 23 files changed, 65 insertions(+), 51 deletions(-) diff --git a/pom.xml b/pom.xml index 518febd..96050a9 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ org.onap.aai.model-loader model-loader aai-model-loader - 1.14.3-SNAPSHOT + 1.15.0-SNAPSHOT @@ -55,6 +55,7 @@ + 17 org.onap.aai.modelloader.service.ModelLoaderApplication https://nexus.onap.org ${basedir}/target @@ -81,7 +82,7 @@ 0.75 - 0.8.5 + 0.8.13 3.2 jacoco ${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml @@ -90,11 +91,11 @@ 3.7.0.1746 3.2.0 - 3.8.1 - 11 - 11 - 11 - 11 + 3.14.1 + 17 + 17 + 17 + 17 @@ -588,6 +589,9 @@ maven-surefire-plugin 3.1.2 + + ${project.basedir}/src/test/resources + ${surefireArgLine} diff --git a/src/main/java/org/onap/aai/modelloader/config/BeanConfig.java b/src/main/java/org/onap/aai/modelloader/config/BeanConfig.java index cc6702b..a4ad48d 100644 --- a/src/main/java/org/onap/aai/modelloader/config/BeanConfig.java +++ b/src/main/java/org/onap/aai/modelloader/config/BeanConfig.java @@ -22,7 +22,7 @@ package org.onap.aai.modelloader.config; import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import java.util.Properties; import org.onap.aai.cl.api.Logger; @@ -48,7 +48,7 @@ public class BeanConfig { public Properties configProperties() throws IOException { // Load model loader system configuration logger.info(ModelLoaderMsgs.LOADING_CONFIGURATION); - InputStream configInputStream = Files.newInputStream(Paths.get(configDir, "model-loader.properties")); + InputStream configInputStream = Files.newInputStream(Path.of(configDir, "model-loader.properties")); Properties configProperties = new Properties(); configProperties.load(configInputStream); return configProperties; diff --git a/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java b/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java index b01086c..2a6c7e3 100644 --- a/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java +++ b/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java @@ -22,7 +22,6 @@ package org.onap.aai.modelloader.config; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -76,7 +75,7 @@ public class ModelLoaderConfig implements IConfiguration { protected static final String PROP_DEBUG_INGEST_SIMULATOR = PREFIX_DEBUG + "INGEST_SIMULATOR"; protected static final String FILESEP = (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator"); - private static String configHome; + private static String configHome = System.getProperty("CONFIG_HOME"); private Properties modelLoaderProperties = null; private String certLocation = "."; private final List artifactTypes = new ArrayList<>(); @@ -110,7 +109,7 @@ public class ModelLoaderConfig implements IConfiguration { } public static Path propertiesFile() { - return Paths.get(configHome, "model-loader.properties"); + return Path.of(configHome, "model-loader.properties"); } @Override diff --git a/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfImageException.java b/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfImageException.java index c116abe..7d8f6de 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfImageException.java +++ b/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfImageException.java @@ -20,6 +20,7 @@ */ package org.onap.aai.modelloader.entity.catalog; +import java.io.Serial; import java.util.Optional; /** @@ -27,7 +28,7 @@ import java.util.Optional; */ class VnfImageException extends Exception { - private static final long serialVersionUID = 1L; + @Serial private static final long serialVersionUID = 1L; private final String imageId; private final transient Optional resultCode; diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/BabelArtifactParsingException.java b/src/main/java/org/onap/aai/modelloader/entity/model/BabelArtifactParsingException.java index dfb649c..2cd8da1 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/model/BabelArtifactParsingException.java +++ b/src/main/java/org/onap/aai/modelloader/entity/model/BabelArtifactParsingException.java @@ -20,12 +20,14 @@ */ package org.onap.aai.modelloader.entity.model; +import java.io.Serial; + /** * This class represents an exception encountered when parsing an XML model Artifact. */ public class BabelArtifactParsingException extends Exception { - private static final long serialVersionUID = 1L; + @Serial private static final long serialVersionUID = 1L; /** * Constructor for an instance of this exception with just a message. diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifact.java b/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifact.java index 09c12b5..df19434 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifact.java +++ b/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifact.java @@ -258,7 +258,7 @@ public class ModelArtifact extends AbstractModelArtifact { private String getModelUrl(AaiProperties aaiProperties) { String baseURL = aaiProperties.getBaseUrl().trim(); - String subURL = String.format(aaiProperties.getModelUrl(), getModelNamespaceVersion()).trim(); + String subURL = aaiProperties.getModelUrl().formatted(getModelNamespaceVersion()).trim(); String instance = getModelInvariantId(); if (!baseURL.endsWith("/") && !subURL.startsWith("/")) { @@ -278,7 +278,7 @@ public class ModelArtifact extends AbstractModelArtifact { private String getModelVerUrl(AaiProperties aaiProperties) { String baseURL = aaiProperties.getBaseUrl().trim(); - String subURL = String.format(aaiProperties.getModelUrl(), getModelNamespaceVersion()).trim() + getModelInvariantId() + String subURL = aaiProperties.getModelUrl().formatted(getModelNamespaceVersion()).trim() + getModelInvariantId() + AAI_MODEL_VER_SUB_URL; String instance = getModelVerId(); diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifact.java b/src/main/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifact.java index b2b1e48..34187c7 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifact.java +++ b/src/main/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifact.java @@ -98,7 +98,7 @@ public class NamedQueryArtifact extends AbstractModelArtifact { private String getNamedQueryUrl(AaiProperties aaiProperties) { String baseURL = aaiProperties.getBaseUrl().trim(); - String subURL = String.format(aaiProperties.getNamedQueryUrl(), getModelNamespaceVersion()).trim(); + String subURL = aaiProperties.getNamedQueryUrl().formatted(getModelNamespaceVersion()).trim(); String instance = this.getNamedQueryUuid(); if (!baseURL.endsWith("/") && !subURL.startsWith("/")) { diff --git a/src/main/java/org/onap/aai/modelloader/extraction/InvalidArchiveException.java b/src/main/java/org/onap/aai/modelloader/extraction/InvalidArchiveException.java index 36581df..f51928f 100644 --- a/src/main/java/org/onap/aai/modelloader/extraction/InvalidArchiveException.java +++ b/src/main/java/org/onap/aai/modelloader/extraction/InvalidArchiveException.java @@ -20,12 +20,14 @@ */ package org.onap.aai.modelloader.extraction; +import java.io.Serial; + /** * This class represents an exception encountered when processing an archive in memory. */ public class InvalidArchiveException extends Exception { - private static final long serialVersionUID = 1L; + @Serial private static final long serialVersionUID = 1L; /** * Constructor for an instance of this exception with just a message. diff --git a/src/main/java/org/onap/aai/modelloader/notification/DownloadFailureException.java b/src/main/java/org/onap/aai/modelloader/notification/DownloadFailureException.java index d39330f..b0472d2 100644 --- a/src/main/java/org/onap/aai/modelloader/notification/DownloadFailureException.java +++ b/src/main/java/org/onap/aai/modelloader/notification/DownloadFailureException.java @@ -20,12 +20,14 @@ */ package org.onap.aai.modelloader.notification; +import java.io.Serial; + /** * Failure to download a distribution. */ class DownloadFailureException extends Exception { - private static final long serialVersionUID = 1L; + @Serial private static final long serialVersionUID = 1L; /** * Constructor for an instance of this exception with just a message. diff --git a/src/main/java/org/onap/aai/modelloader/notification/ProcessToscaArtifactsException.java b/src/main/java/org/onap/aai/modelloader/notification/ProcessToscaArtifactsException.java index 0d082c1..c0c70ff 100644 --- a/src/main/java/org/onap/aai/modelloader/notification/ProcessToscaArtifactsException.java +++ b/src/main/java/org/onap/aai/modelloader/notification/ProcessToscaArtifactsException.java @@ -20,9 +20,11 @@ */ package org.onap.aai.modelloader.notification; +import java.io.Serial; + public class ProcessToscaArtifactsException extends Exception { - private static final long serialVersionUID = 1L; + @Serial private static final long serialVersionUID = 1L; /** * Constructor for an instance of this exception with just a message. diff --git a/src/main/java/org/onap/aai/modelloader/restclient/BabelServiceClientException.java b/src/main/java/org/onap/aai/modelloader/restclient/BabelServiceClientException.java index 0ce8037..e1131a5 100644 --- a/src/main/java/org/onap/aai/modelloader/restclient/BabelServiceClientException.java +++ b/src/main/java/org/onap/aai/modelloader/restclient/BabelServiceClientException.java @@ -20,12 +20,14 @@ */ package org.onap.aai.modelloader.restclient; +import java.io.Serial; + public class BabelServiceClientException extends Exception { /** * Babel Service Client Exception. */ - private static final long serialVersionUID = 1L; + @Serial private static final long serialVersionUID = 1L; public BabelServiceClientException(String message) { super(message); diff --git a/src/main/java/org/onap/aai/modelloader/util/GizmoTranslator.java b/src/main/java/org/onap/aai/modelloader/util/GizmoTranslator.java index 1b03933..e9657ba 100644 --- a/src/main/java/org/onap/aai/modelloader/util/GizmoTranslator.java +++ b/src/main/java/org/onap/aai/modelloader/util/GizmoTranslator.java @@ -206,7 +206,7 @@ public class GizmoTranslator { Optional parentVersion = Optional.empty(); Node parentNode = node.getParentNode(); - while (parentNode != null && !parentVersion.isPresent()) { + while (parentNode != null && parentVersion.isEmpty()) { if (getNodeType(parentNode) == NodeType.VERTEX) { NodeList childNodes = ((Element) parentNode).getElementsByTagName("*"); parentVersion = IntStream.range(0, childNodes.getLength()) // diff --git a/src/test/java/org/onap/aai/modelloader/BabelClientTestConfiguration.java b/src/test/java/org/onap/aai/modelloader/BabelClientTestConfiguration.java index 363b92c..6233e43 100644 --- a/src/test/java/org/onap/aai/modelloader/BabelClientTestConfiguration.java +++ b/src/test/java/org/onap/aai/modelloader/BabelClientTestConfiguration.java @@ -22,7 +22,7 @@ package org.onap.aai.modelloader; import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import java.util.Properties; import org.springframework.beans.factory.annotation.Value; @@ -42,7 +42,7 @@ public class BabelClientTestConfiguration { @Bean(name = "testProperties") public Properties configProperties() throws IOException { // Load model loader system configuration - InputStream configInputStream = Files.newInputStream(Paths.get(configDir, "model-loader.properties")); + InputStream configInputStream = Files.newInputStream(Path.of(configDir, "model-loader.properties")); Properties configProperties = new Properties(); configProperties.load(configInputStream); diff --git a/src/test/java/org/onap/aai/modelloader/DistributionClientTestConfiguration.java b/src/test/java/org/onap/aai/modelloader/DistributionClientTestConfiguration.java index b716c1a..7dbd2e2 100644 --- a/src/test/java/org/onap/aai/modelloader/DistributionClientTestConfiguration.java +++ b/src/test/java/org/onap/aai/modelloader/DistributionClientTestConfiguration.java @@ -29,7 +29,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import java.util.HashMap; import java.util.Map; import java.util.Properties; @@ -62,7 +62,7 @@ public class DistributionClientTestConfiguration { @Bean(name = "testProperties") Properties configProperties() throws IOException { // Load model loader system configuration - InputStream configInputStream = Files.newInputStream(Paths.get(configDir, "model-loader.properties")); + InputStream configInputStream = Files.newInputStream(Path.of(configDir, "model-loader.properties")); Properties configProperties = new Properties(); configProperties.load(configInputStream); diff --git a/src/test/java/org/onap/aai/modelloader/entity/catalog/TestVnfCatalogArtifactHandler.java b/src/test/java/org/onap/aai/modelloader/entity/catalog/TestVnfCatalogArtifactHandler.java index 840acb0..edd9004 100644 --- a/src/test/java/org/onap/aai/modelloader/entity/catalog/TestVnfCatalogArtifactHandler.java +++ b/src/test/java/org/onap/aai/modelloader/entity/catalog/TestVnfCatalogArtifactHandler.java @@ -30,7 +30,7 @@ import static org.mockito.Mockito.when; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import java.util.ArrayList; import java.util.List; @@ -132,7 +132,7 @@ public class TestVnfCatalogArtifactHandler { */ private List createVnfCatalogArtifact() throws IOException, UnsupportedEncodingException { String examplePath = "src/test/resources/imagedataexample.json"; - byte[] encoded = Files.readAllBytes(Paths.get(examplePath)); + byte[] encoded = Files.readAllBytes(Path.of(examplePath)); List artifacts = new ArrayList(); artifacts.add(new VnfCatalogArtifact(new String(encoded, "utf-8"))); return artifacts; @@ -146,7 +146,7 @@ public class TestVnfCatalogArtifactHandler { * @throws UnsupportedEncodingException */ private List createVnfCatalogXmlArtifact() throws IOException, UnsupportedEncodingException { - byte[] encoded = Files.readAllBytes(Paths.get("src/test/resources/xmlFiles/fortigate.xml")); + byte[] encoded = Files.readAllBytes(Path.of("src/test/resources/xmlFiles/fortigate.xml")); List artifacts = new ArrayList(); artifacts.add(new VnfCatalogArtifact(ArtifactType.VNF_CATALOG_XML, new String(encoded, "utf-8"))); return artifacts; diff --git a/src/test/java/org/onap/aai/modelloader/entity/model/TestModelArtifactParser.java b/src/test/java/org/onap/aai/modelloader/entity/model/TestModelArtifactParser.java index fc0556f..da4e326 100644 --- a/src/test/java/org/onap/aai/modelloader/entity/model/TestModelArtifactParser.java +++ b/src/test/java/org/onap/aai/modelloader/entity/model/TestModelArtifactParser.java @@ -27,7 +27,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.text.IsEqualIgnoringCase.equalToIgnoringCase; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import java.util.List; import org.junit.jupiter.api.Test; @@ -43,7 +43,7 @@ public class TestModelArtifactParser { @Test public void testParseModelFileNoDeps() throws Exception { - String fileString = new String(Files.readAllBytes(Paths.get(MODEL_FILE))); + String fileString = new String(Files.readAllBytes(Path.of(MODEL_FILE))); ModelArtifactParser parser = new ModelArtifactParser(); List modelList = parser.parse(fileString, "test-artifact"); @@ -62,7 +62,7 @@ public class TestModelArtifactParser { @Test public void testParseModelFileDeps() throws Exception { - String fileString = new String(Files.readAllBytes(Paths.get(MODEL_FILE_SERVICE))); + String fileString = new String(Files.readAllBytes(Path.of(MODEL_FILE_SERVICE))); ModelArtifactParser parser = new ModelArtifactParser(); List modelList = parser.parse(fileString, "test-artifact"); @@ -83,7 +83,7 @@ public class TestModelArtifactParser { @Test public void testParseModelFileInvalidArtifact() throws Exception { - String fileString = new String(Files.readAllBytes(Paths.get(MODEL_FILE_INVALID))); + String fileString = new String(Files.readAllBytes(Path.of(MODEL_FILE_INVALID))); ModelArtifactParser parser = new ModelArtifactParser(); List modelList = parser.parse(fileString, "test-artifact"); @@ -93,7 +93,7 @@ public class TestModelArtifactParser { @Test public void testParseModelFileIncompleteArtifact() throws Exception { - String fileString = new String(Files.readAllBytes(Paths.get(MODEL_FILE_INCOMPLETE))); + String fileString = new String(Files.readAllBytes(Path.of(MODEL_FILE_INCOMPLETE))); ModelArtifactParser parser = new ModelArtifactParser(); List modelList = parser.parse(fileString, "test-artifact"); diff --git a/src/test/java/org/onap/aai/modelloader/entity/model/TestNamedQueryArtifactParser.java b/src/test/java/org/onap/aai/modelloader/entity/model/TestNamedQueryArtifactParser.java index 9ea900f..fe7538e 100644 --- a/src/test/java/org/onap/aai/modelloader/entity/model/TestNamedQueryArtifactParser.java +++ b/src/test/java/org/onap/aai/modelloader/entity/model/TestNamedQueryArtifactParser.java @@ -28,7 +28,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import java.util.List; import org.junit.jupiter.api.Test; @@ -41,7 +41,7 @@ public class TestNamedQueryArtifactParser { @Test public void testParseNamedQuery() throws Exception { try { - String fileString = new String(Files.readAllBytes(Paths.get(MODEL_FILE))); + String fileString = new String(Files.readAllBytes(Path.of(MODEL_FILE))); NamedQueryArtifactParser parser = new NamedQueryArtifactParser(); List modelList = parser.parse(fileString, "test-artifact"); diff --git a/src/test/java/org/onap/aai/modelloader/notification/DistributionClientIntegrationTest.java b/src/test/java/org/onap/aai/modelloader/notification/DistributionClientIntegrationTest.java index 916f740..9c59bba 100644 --- a/src/test/java/org/onap/aai/modelloader/notification/DistributionClientIntegrationTest.java +++ b/src/test/java/org/onap/aai/modelloader/notification/DistributionClientIntegrationTest.java @@ -25,7 +25,7 @@ import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.verify; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -77,7 +77,7 @@ public class DistributionClientIntegrationTest { void thatCallbackIsCalled() { Thread.sleep(10000); String distributionJson = "src/test/resources/messages/distribution.json"; - String message = Files.readString(Paths.get(distributionJson)); + String message = Files.readString(Path.of(distributionJson)); kafkaTemplate.send(topic, message); diff --git a/src/test/java/org/onap/aai/modelloader/restclient/TestAaiRestClient.java b/src/test/java/org/onap/aai/modelloader/restclient/TestAaiRestClient.java index 191e032..03e207b 100644 --- a/src/test/java/org/onap/aai/modelloader/restclient/TestAaiRestClient.java +++ b/src/test/java/org/onap/aai/modelloader/restclient/TestAaiRestClient.java @@ -25,7 +25,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.File; import java.io.IOException; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import java.util.stream.IntStream; import java.util.stream.Stream; @@ -113,16 +113,16 @@ public class TestAaiRestClient { } static String readFile(String path) throws IOException { - byte[] encoded = Files.readAllBytes(Paths.get(path)); + byte[] encoded = Files.readAllBytes(Path.of(path)); return new String(encoded); } private String getUrl(ModelArtifact model, AaiProperties aaiProperties) { String subUrl; if (model.getType().equals(ArtifactType.MODEL)) { - subUrl = String.format(aaiProperties.getModelUrl(), model.getModelNamespaceVersion()).trim(); + subUrl = aaiProperties.getModelUrl().formatted(model.getModelNamespaceVersion()).trim(); } else { - subUrl = String.format(aaiProperties.getNamedQueryUrl(), model.getModelNamespaceVersion()).trim(); + subUrl = aaiProperties.getNamedQueryUrl().formatted(model.getModelNamespaceVersion()).trim(); } String baseUrl = aaiProperties.getBaseUrl().trim(); diff --git a/src/test/java/org/onap/aai/modelloader/restclient/TestBabelServiceClient.java b/src/test/java/org/onap/aai/modelloader/restclient/TestBabelServiceClient.java index d82bff0..30008af 100644 --- a/src/test/java/org/onap/aai/modelloader/restclient/TestBabelServiceClient.java +++ b/src/test/java/org/onap/aai/modelloader/restclient/TestBabelServiceClient.java @@ -27,7 +27,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import java.io.IOException; import java.net.URISyntaxException; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import java.util.Base64; import java.util.List; @@ -96,6 +96,6 @@ public class TestBabelServiceClient { private byte[] readBytesFromFile(String resourceFile) throws IOException, URISyntaxException { - return Files.readAllBytes(Paths.get(ClassLoader.getSystemResource(resourceFile).toURI())); + return Files.readAllBytes(Path.of(ClassLoader.getSystemResource(resourceFile).toURI())); } } diff --git a/src/test/java/org/onap/aai/modelloader/util/TestGizmoTranslator.java b/src/test/java/org/onap/aai/modelloader/util/TestGizmoTranslator.java index c1a862a..fd02b6d 100644 --- a/src/test/java/org/onap/aai/modelloader/util/TestGizmoTranslator.java +++ b/src/test/java/org/onap/aai/modelloader/util/TestGizmoTranslator.java @@ -27,7 +27,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import java.io.IOException; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import org.junit.jupiter.api.Test; import org.onap.aai.modelloader.gizmo.GizmoBulkPayload; @@ -66,7 +66,7 @@ public class TestGizmoTranslator { } private GizmoBulkPayload createBulkRequest(String filePath) throws IOException { - final String xmlPayload = new String(Files.readAllBytes(Paths.get(filePath))); + final String xmlPayload = new String(Files.readAllBytes(Path.of(filePath))); return GizmoBulkPayload.fromJson(GizmoTranslator.translate(xmlPayload)); } diff --git a/src/test/java/org/onap/aai/modelloader/util/TestJsonXmlConverter.java b/src/test/java/org/onap/aai/modelloader/util/TestJsonXmlConverter.java index ec66a59..f6e87a2 100644 --- a/src/test/java/org/onap/aai/modelloader/util/TestJsonXmlConverter.java +++ b/src/test/java/org/onap/aai/modelloader/util/TestJsonXmlConverter.java @@ -25,7 +25,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import java.io.ByteArrayInputStream; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -51,9 +51,9 @@ public class TestJsonXmlConverter { @Test public void testConversion() throws Exception { - byte[] encoded = Files.readAllBytes(Paths.get(XML_MODEL_FILE)); + byte[] encoded = Files.readAllBytes(Path.of(XML_MODEL_FILE)); assertThat(JsonXmlConverter.isValidJson(new String(encoded)), is(false)); - encoded = Files.readAllBytes(Paths.get(JSON_MODEL_FILE)); + encoded = Files.readAllBytes(Path.of(JSON_MODEL_FILE)); String originalJson = new String(encoded); assertThat(JsonXmlConverter.isValidJson(originalJson), is(true)); diff --git a/version.properties b/version.properties index 3601758..5b2605c 100644 --- a/version.properties +++ b/version.properties @@ -24,8 +24,8 @@ # because they are used in Jenkins, whose plug-in doesn't support major=1 -minor=14 -patch=3 +minor=15 +patch=0 base_version=${major}.${minor}.${patch} -- 2.16.6