summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2018-03-23 07:15:53 +0000
committerGerrit Code Review <gerrit@onap.org>2018-03-23 07:15:53 +0000
commit5bb0230052d1b9676d107b511f6c32c2d6241591 (patch)
treef7fde61b8de137ba6b2fdbd819e5822e44b76269
parent921872636e3b3dfd4294cb99a6cc519d5e6dbab2 (diff)
parent673ff4a7b4f93f8a58656aa36d9798b29273bba0 (diff)
Merge "Improve UT for SO"
-rw-r--r--adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImplTest.java46
1 files changed, 45 insertions, 1 deletions
diff --git a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImplTest.java b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImplTest.java
index d1c090dc9e..cf7e26c7b1 100644
--- a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImplTest.java
+++ b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImplTest.java
@@ -23,6 +23,8 @@ package org.openecomp.mso.adapters.vnf;
import java.util.HashMap;
import java.util.Map;
import javax.xml.ws.Holder;
+
+import org.junit.Assert;
import org.junit.Test;
import org.openecomp.mso.adapters.vnf.MsoVnfAdapterImpl;
import org.openecomp.mso.entity.MsoRequest;
@@ -30,7 +32,49 @@ import org.openecomp.mso.openstack.beans.VnfRollback;
public class MsoVnfAdapterImplTest {
- @Test
+ MsoVnfAdapter msoVnfAdapter = new MsoVnfAdapterImpl();
+
+ @Test
+ public void updateVnf() throws Exception {
+ MsoRequest msoRequest = new MsoRequest();
+ msoRequest.setRequestId("12345");
+ msoRequest.setServiceInstanceId("12345");
+
+ msoVnfAdapter.updateVnf("cloudsite", "tenantid", "vfw", "v1", "test",
+ "update", "heatid", new HashMap<>(), msoRequest, new Holder<>(), new Holder<>());
+ Assert.assertTrue(true);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void queryVnfNullPoinerExceptionTest() throws Exception {
+ MsoRequest msoRequest = new MsoRequest();
+ msoRequest.setRequestId("12345");
+ msoRequest.setServiceInstanceId("12345");
+
+ msoVnfAdapter.queryVnf("cloudSiteId",
+ "tenantId",
+ "vnfName",
+ msoRequest,
+ new Holder<>(),
+ new Holder<>(),
+ new Holder<>(),
+ new Holder<>());
+ Assert.assertFalse(true);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void rollbackVnfCloudSiteInfoNotAvail() throws Exception {
+ VnfRollback rollback = new VnfRollback();
+ rollback.setVnfId("vnfid");
+ rollback.setVfModuleStackId("stackid");
+ rollback.setCloudSiteId("11234");
+ rollback.setTenantId("234");
+
+ msoVnfAdapter.rollbackVnf(rollback);
+ Assert.assertFalse(true);
+ }
+
+ @Test
public void healthCheckVNFTest() {
MsoVnfAdapterImpl instance = new MsoVnfAdapterImpl();
instance.healthCheck();