aboutsummaryrefslogtreecommitdiffstats
path: root/vnfmarket-be/vnf-sdk-marketplace/src/test
diff options
context:
space:
mode:
authorCooper.Wu <wutuo@chinamobile.com>2020-09-08 22:02:27 +0800
committerCooper.Wu <wutuo@chinamobile.com>2020-09-08 22:02:38 +0800
commit4bd84e3d7f303934e3035fffb4e7ff07da79acb0 (patch)
tree6df6b6835b7e993158faffb028886efb2ca60b4f /vnfmarket-be/vnf-sdk-marketplace/src/test
parent78014264d1c30dbadd9e463555d3ae664e562bc6 (diff)
Add UT for VNFSDK-613
Issue-ID: VNFSDK-613 Change-Id: Ie78001256efa304621043f485d7d31aa442297de Signed-off-by: Cooper.Wu <wutuo@chinamobile.com>
Diffstat (limited to 'vnfmarket-be/vnf-sdk-marketplace/src/test')
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/VTPScenarioResourceTest.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/VTPScenarioResourceTest.java b/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/VTPScenarioResourceTest.java
index f0f0cce8..55457795 100644
--- a/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/VTPScenarioResourceTest.java
+++ b/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/VTPScenarioResourceTest.java
@@ -17,6 +17,8 @@ package org.onap.vtp;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
+import org.glassfish.jersey.media.multipart.ContentDisposition;
+import org.glassfish.jersey.media.multipart.FormDataBodyPart;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -37,6 +39,12 @@ public class VTPScenarioResourceTest {
VTPScenarioResource vtpScenarioResource;
+ @Mock
+ FormDataBodyPart formDataBodyPart;
+ @Mock
+ ContentDisposition contentDisposition;
+
+
@Before
public void setUp() throws Exception {
@@ -85,4 +93,32 @@ public class VTPScenarioResourceTest {
{
vtpScenarioResource.getTestcaseHandler("open-cli","testsuit","testcase");
}
+
+ @Test(expected = NullPointerException.class)
+ public void testStorageScenarios() throws Exception
+ {
+ List<FormDataBodyPart> bodyParts = new ArrayList<>();
+ formDataBodyPart.setName("abc");
+ formDataBodyPart.setValue("123");
+ formDataBodyPart.setContentDisposition(contentDisposition);
+ bodyParts.add(formDataBodyPart);
+ vtpScenarioResource.storageScenarios(bodyParts);
+ }
+
+ @Test
+ public void testDeleteScenario() throws Exception
+ {
+ vtpScenarioResource.deleteScenario("demo-registry.yaml");
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testStorageTestcases() throws Exception
+ {
+ List<FormDataBodyPart> bodyParts = new ArrayList<>();
+ formDataBodyPart.setName("abc");
+ formDataBodyPart.setValue("123");
+ formDataBodyPart.setContentDisposition(contentDisposition);
+ bodyParts.add(formDataBodyPart);
+ vtpScenarioResource.storageTestcases(bodyParts);
+ }
} \ No newline at end of file