From: Abhai Singh Date: Thu, 11 Jan 2018 11:26:57 +0000 (+0530) Subject: Fix ToscaFileOutputServiceCsarImplTest X-Git-Tag: v1.2.0~440 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F53%2F27953%2F2;p=sdc.git Fix ToscaFileOutputServiceCsarImplTest Above mentioned test class has tests with shared state and can fail unexpectedly during parallel execution. Change-Id: I97772caaba60afca15f62166ba3b1c1d939bcc14 Issue-ID: SDC-904 Signed-off-by: Abhai Singh --- diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImplTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImplTest.java index 66dda12b4b..0910684f3a 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImplTest.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImplTest.java @@ -41,11 +41,10 @@ import java.util.zip.ZipFile; public class ToscaFileOutputServiceCsarImplTest { - private final ToscaFileOutputServiceCsarImpl toscaFileOutputServiceCSARImpl = - new ToscaFileOutputServiceCsarImpl(); - @Test public void testCreationMetaFile() { + ToscaFileOutputServiceCsarImpl toscaFileOutputServiceCSARImpl = + new ToscaFileOutputServiceCsarImpl(); String createdMeta = toscaFileOutputServiceCSARImpl.createMetaFile("entryFile.yaml"); String expectedMeta = "TOSCA-Meta-File-Version: 1.0\n" + @@ -57,6 +56,8 @@ public class ToscaFileOutputServiceCsarImplTest { @Test public void testCSARFileCreationWithExternalArtifacts() throws IOException { + ToscaFileOutputServiceCsarImpl toscaFileOutputServiceCSARImpl = + new ToscaFileOutputServiceCsarImpl(); ServiceTemplate mainServiceTemplate = new ServiceTemplate(); Map metadata1 = new HashMap<>(); metadata1.put("Template_author", "OPENECOMP"); @@ -133,6 +134,8 @@ public class ToscaFileOutputServiceCsarImplTest { @Test public void testCSARFileCreation_noArtifacts() throws IOException { + ToscaFileOutputServiceCsarImpl toscaFileOutputServiceCSARImpl = + new ToscaFileOutputServiceCsarImpl(); ServiceTemplate serviceTemplate = new ServiceTemplate(); Map metadata = new HashMap<>(); metadata.put("Template_author", "OPENECOMP");