Fix ToscaFileOutputServiceCsarImplTest 53/27953/2
authorAbhai Singh <Abhai.Singh@amdocs.com>
Thu, 11 Jan 2018 11:26:57 +0000 (16:56 +0530)
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>
Thu, 11 Jan 2018 12:21:29 +0000 (12:21 +0000)
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 <Abhai.Singh@amdocs.com>
openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImplTest.java

index 66dda12..0910684 100644 (file)
@@ -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<String, String> 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<String, String> metadata = new HashMap<>();
     metadata.put("Template_author", "OPENECOMP");