diff options
-rw-r--r-- | vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vtp/VTPScenarioResourceTest.java | 36 |
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 |