From 0b4016fbde53d49f9511a4253e22285681840572 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Wed, 16 Nov 2022 15:03:38 +0000 Subject: Replace deprecated methods in model-loader - junit's assertThat was deprecated in favour of hamcrest - apache-commons now requires a Charset argument Issue-ID: AAI-3604 Signed-off-by: Fiete Ostkamp Change-Id: I10bf46922e44b3a3adcc14eab6486401a5cf14e1 --- src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java | 2 +- .../java/org/onap/aai/modelloader/extraction/VnfCatalogExtractor.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/java') 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 77693bc..a49288d 100644 --- a/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java +++ b/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java @@ -28,10 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Properties; + import org.apache.commons.lang3.StringUtils; import org.eclipse.jetty.util.security.Password; import org.onap.sdc.api.consumer.IConfiguration; -import org.springframework.core.env.Environment; /** * Properties for the Model Loader diff --git a/src/main/java/org/onap/aai/modelloader/extraction/VnfCatalogExtractor.java b/src/main/java/org/onap/aai/modelloader/extraction/VnfCatalogExtractor.java index 0e27d57..3dbdfcc 100644 --- a/src/main/java/org/onap/aai/modelloader/extraction/VnfCatalogExtractor.java +++ b/src/main/java/org/onap/aai/modelloader/extraction/VnfCatalogExtractor.java @@ -21,10 +21,12 @@ package org.onap.aai.modelloader.extraction; import java.io.IOException; +import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import java.util.regex.Pattern; + import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipFile; import org.apache.commons.compress.utils.SeekableInMemoryByteChannel; @@ -75,7 +77,7 @@ public class VnfCatalogExtractor { ZipArchiveEntry entry = enumeration.nextElement(); if (fileShouldBeExtracted(entry)) { vnfcFiles.add(new VnfCatalogArtifact(ArtifactType.VNF_CATALOG_XML, - IOUtils.toString(zipFile.getInputStream(entry)))); + IOUtils.toString(zipFile.getInputStream(entry), Charset.defaultCharset()))); } } } catch (IOException e) { -- cgit 1.2.3-korg