aboutsummaryrefslogtreecommitdiffstats
path: root/vnfapi/provider/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'vnfapi/provider/src/test')
-rw-r--r--vnfapi/provider/src/test/java/org/onap/sdnc/vnfapi/VnfInstanceTopologyOperationTest.java2
-rw-r--r--vnfapi/provider/src/test/java/org/onap/sdnc/vnfapi/VnfapiProviderTestBase.java102
2 files changed, 2 insertions, 102 deletions
diff --git a/vnfapi/provider/src/test/java/org/onap/sdnc/vnfapi/VnfInstanceTopologyOperationTest.java b/vnfapi/provider/src/test/java/org/onap/sdnc/vnfapi/VnfInstanceTopologyOperationTest.java
index 72c0c9d5..681b8d85 100644
--- a/vnfapi/provider/src/test/java/org/onap/sdnc/vnfapi/VnfInstanceTopologyOperationTest.java
+++ b/vnfapi/provider/src/test/java/org/onap/sdnc/vnfapi/VnfInstanceTopologyOperationTest.java
@@ -309,4 +309,6 @@ public class VnfInstanceTopologyOperationTest extends VnfApiProviderTest {
.setVnfModelId(PRELOAD_TYPE)
.build();
}
+
+
}
diff --git a/vnfapi/provider/src/test/java/org/onap/sdnc/vnfapi/VnfapiProviderTestBase.java b/vnfapi/provider/src/test/java/org/onap/sdnc/vnfapi/VnfapiProviderTestBase.java
index 7ce99ec6..92346047 100644
--- a/vnfapi/provider/src/test/java/org/onap/sdnc/vnfapi/VnfapiProviderTestBase.java
+++ b/vnfapi/provider/src/test/java/org/onap/sdnc/vnfapi/VnfapiProviderTestBase.java
@@ -174,108 +174,6 @@ public class VnfapiProviderTestBase {
verify(vnfapiServiceRpcRegistration, times(1)).close();
}
- @Test public void onDataTreeChanged() throws Exception {
- DataTreeModification dtm = mock(DataTreeModification.class);
- DataObjectModification dom = mock(DataObjectModification.class);
-
-
- // instance of Vnfs
- Vnfs vnfs = mock(Vnfs.class);
- doReturn(dom).when(dtm).getRootNode();
- doReturn(vnfs).when(dom).getDataAfter();
- VnfList vnfList = mock(VnfList.class);
- ServiceData serviceData = mock(ServiceData.class);
- doReturn(serviceData).when(vnfList).getServiceData();
- ServiceStatus serviceStatus = mock(ServiceStatus.class);
- doReturn("N").when(serviceStatus).getFinalIndicator();
- doReturn(ServiceStatus.RequestStatus.Synccomplete).when(serviceStatus).getRequestStatus();
- doReturn(serviceStatus).when(vnfList).getServiceStatus();
- ArrayList<VnfList> vnfListList = new ArrayList<>();
- vnfListList.add(vnfList);
- doReturn(vnfListList).when(vnfs).getVnfList();
- doReturn(readWriteTransactionInDataChanged).when(dataBroker).newWriteOnlyTransaction();
- doReturn(checkedFuture).when(readWriteTransactionInDataChanged).submit();
-
- Collection dtmList = new LinkedList<DataTreeModification>();
- dtmList.add(dtm);
-
- vnfapiProvider.onDataTreeChanged(dtmList);
-
- verify(readWriteTransactionInDataChanged, times(1)).submit();
-
- // instance of PreloadVnfs
- PreloadVnfs preloadVnfs = mock(PreloadVnfs.class);
- doReturn(preloadVnfs).when(dom).getDataAfter();
- ArrayList<VnfPreloadList> vnfPreloadLists = new ArrayList<>();
- doReturn(vnfPreloadLists).when(preloadVnfs).getVnfPreloadList();
- PreloadData preloadData = mock(PreloadData.class);
- VnfPreloadList vnfPreloadList = mock(VnfPreloadList.class);
- doReturn(preloadData).when(vnfPreloadList).getPreloadData();
- vnfPreloadLists.add(vnfPreloadList);
-
- vnfapiProvider.onDataTreeChanged(dtmList);
-
- verify(readWriteTransactionInDataChanged, times(2)).submit();
-
- // instance of PreloadVnfInstances
- PreloadVnfInstances preloadVnfInstances = mock(PreloadVnfInstances.class);
- doReturn(preloadVnfInstances).when(dom).getDataAfter();
- ArrayList<VnfInstancePreloadList> vnfInstancePreloadLists = new ArrayList<>();
- doReturn(vnfInstancePreloadLists).when(preloadVnfInstances).getVnfInstancePreloadList();
- VnfInstancePreloadList vnfInstancePreloadList = mock(VnfInstancePreloadList.class);
- VnfInstancePreloadData vnfInstancePreloadData = mock(VnfInstancePreloadData.class);
- doReturn(vnfInstancePreloadData).when(vnfInstancePreloadList).getVnfInstancePreloadData();
- vnfInstancePreloadLists.add(vnfInstancePreloadList);
-
- vnfapiProvider.onDataTreeChanged(dtmList);
-
- verify(readWriteTransactionInDataChanged, times(3)).submit();
-
- // instance of VnfInstances
- VnfInstances vnfInstances = mock(VnfInstances.class);
- doReturn(vnfInstances).when(dom).getDataAfter();
- ArrayList<VnfInstanceList> vnfInstanceLists = new ArrayList<>();
- doReturn(vnfInstanceLists).when(vnfInstances).getVnfInstanceList();
- VnfInstanceList vnfInstanceList = mock(VnfInstanceList.class);
- vnfInstanceLists.add(vnfInstanceList);
- VnfInstanceServiceData vnfInstanceServiceData = mock(VnfInstanceServiceData.class);
- doReturn(vnfInstanceServiceData).when(vnfInstanceList).getVnfInstanceServiceData();
- doReturn(serviceStatus).when(vnfInstanceList).getServiceStatus();
-
- vnfapiProvider.onDataTreeChanged(dtmList);
-
- verify(readWriteTransactionInDataChanged, times(4)).submit();
-
- // instance of PreloadVfModules
- PreloadVfModules preloadVfModules = mock(PreloadVfModules.class);
- doReturn(preloadVfModules).when(dom).getDataAfter();
- ArrayList<VfModulePreloadList> vfModulePreloadLists = new ArrayList<>();
- doReturn(vfModulePreloadLists).when(preloadVfModules).getVfModulePreloadList();
- VfModulePreloadList vfModulePreloadList = mock(VfModulePreloadList.class);
- vfModulePreloadLists.add(vfModulePreloadList);
- VfModulePreloadData vfModulePreloadData = mock(VfModulePreloadData.class);
- doReturn(vfModulePreloadData).when(vfModulePreloadList).getVfModulePreloadData();
-
- vnfapiProvider.onDataTreeChanged(dtmList);
-
- verify(readWriteTransactionInDataChanged, times(5)).submit();
-
- // instance of VfModules
- VfModules vfModules = mock(VfModules.class);
- doReturn(preloadVfModules).when(dom).getDataAfter();
- ArrayList<VfModuleList> vfModuleLists = new ArrayList<>();
- doReturn(vfModuleLists).when(vfModules).getVfModuleList();
- VfModuleList vfModuleList = mock(VfModuleList.class);
- vfModuleLists.add(vfModuleList);
- VfModuleServiceData vfModuleServiceData = mock(VfModuleServiceData.class);
- doReturn(vfModuleServiceData).when(vfModuleList).getVfModuleServiceData();
- doReturn(serviceStatus).when(vfModuleList).getServiceStatus();
-
- vnfapiProvider.onDataTreeChanged(dtmList);
-
- verify(readWriteTransactionInDataChanged, times(6)).submit();
- }
-
/**
* Test Error case:
* <p>