diff options
author | subhash kumar singh <subhash.kumar.singh@huawei.com> | 2018-03-23 05:25:53 +0000 |
---|---|---|
committer | subhash kumar singh <subhash.kumar.singh@huawei.com> | 2018-03-23 05:25:53 +0000 |
commit | 673ff4a7b4f93f8a58656aa36d9798b29273bba0 (patch) | |
tree | 9b12193afdedcddb7b3674d3669495509fac3e78 /adapters/mso-vnf-adapter/src/test/java/org/openecomp | |
parent | 2eda4d03efd5a02941c4edc2996153f2bba14baa (diff) |
Improve UT for SO
Improve UT for SO.
Change-Id: Id2a862c3cc5f8d9b157c2f4c9e7f60e28f3bf18e
Issue-ID: SO-369
Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'adapters/mso-vnf-adapter/src/test/java/org/openecomp')
-rw-r--r-- | adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImplTest.java | 46 |
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();
|