Add unit tests for OrchestrationTemplateCandidateManagerImpl 52/90452/2
authorm.kowalski3 <m.kowalski3@partner.samsung.com>
Tue, 25 Jun 2019 13:38:38 +0000 (15:38 +0200)
committerOren Kleks <orenkle@amdocs.com>
Sun, 30 Jun 2019 06:07:52 +0000 (06:07 +0000)
Issue-ID: SDC-2327
Signed-off-by: Marcin Kowalski <m.kowalski3@partner.samsung.com>
Change-Id: I80b9e404a98e23e135ae12e4d24ee2c7f66fef11

openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerImplTest.java

index 8f33be1..9b0e07f 100644 (file)
@@ -6,6 +6,9 @@
  * You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
+ * ================================================================================
+ *  Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,6 +19,8 @@
 
 package org.openecomp.sdc.vendorsoftwareproduct.impl;
 
+import java.io.IOException;
+import org.apache.commons.lang3.tuple.Pair;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -52,6 +57,7 @@ import java.util.Map;
 import java.util.Optional;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
@@ -390,4 +396,20 @@ public class OrchestrationTemplateCandidateManagerImplTest {
       }
     }
   }
+
+  @Test
+  public void testUpdateFilesDataStructure() {
+    assertNotNull(candidateManager.updateFilesDataStructure(VSP_ID, VERSION01, new FilesDataStructure()));
+  }
+
+  @Test
+  public void testGet() throws IOException {
+    Optional<Pair<String, byte[]>> optionalStringPair = candidateManager.get(VSP_ID, VERSION01);
+    assertFalse(optionalStringPair.isPresent());
+  }
+
+  @Test
+  public void testGetInfo() {
+      assertNotNull(candidateManager.getInfo(VSP_ID, VERSION01));
+  }
 }
\ No newline at end of file