From bf37c21229e1b60937202c3962b24f14b45c96e5 Mon Sep 17 00:00:00 2001 From: Francis Toth Date: Fri, 1 May 2020 12:42:58 -0400 Subject: Refactor CsarUtil::extractVfcArtifact Signed-off-by: Francis Toth Change-Id: Ica8d17d4f3c763920f406ccb89fb3e464d05eab4 Issue-ID: SDC-2812 --- .../test/java/org/openecomp/sdc/be/tosca/CsarUtilsTest.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'catalog-be/src/test/java/org/openecomp') diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CsarUtilsTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CsarUtilsTest.java index 092dd1d2b5..3ee2b89047 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CsarUtilsTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CsarUtilsTest.java @@ -26,6 +26,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import fj.data.Either; import java.io.IOException; @@ -40,6 +41,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Optional; import java.util.Set; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; @@ -660,10 +662,14 @@ public class CsarUtilsTest extends BeConfDependentTest { map.put(path, "value".getBytes()); Entry entry = map.entrySet().iterator().next(); - ImmutablePair output = Deencapsulation.invoke(testSubject, "extractVfcArtifact", entry, new HashMap<>()); + Optional> output = + Deencapsulation.invoke(testSubject, "extractVfcArtifact", entry, new HashMap<>()); - assertNotNull(output); - assertEquals("to",output.left); + if(output.isPresent()) { + assertEquals("to", output.get().left); + } else { + fail("`output` is empty!"); + } } @Test -- cgit 1.2.3-korg