summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/test/java
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-09-17 11:14:35 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2018-09-17 12:01:30 -0400
commit08c27a288e961c1ffd4151384ef0f609bb855e10 (patch)
tree5a139d4624226dcf543e14afeef284dec352be70 /bpmn/so-bpmn-tasks/src/test/java
parent184e1ed3e83effc39b6f7f92c9f4b9d874c4cfe7 (diff)
more stability fixes
Remove conditional to not check VNF topology add empty string verification for serviceName field Add junits for CNRCR and NtwkAdptr changes. Add search in new CollNtwkResCust tbl to get NtwkResource. - Updated test data files to include 'pre-load' flag in both VfModuleOperation and NetworkOperation json test data files. - MSO to not to send <preload>boolean</from-preload> to SDNC in network-topology-opertion and vf-module-topology-operation. Updated GeneralTopologyObjectMapper to set 'from-preload' to null so that elements with Nulls are not sent to SDNC. Updated buildNetworkInformation() and buildVfModuleInformation() methods. update flow stats to not cause bpmn flow to crash Fix headers so SDNC does not return XML Add implementation of deleteVolumeGroupResponse parsing; fix JUnits that worked by accident. Change-Id: Ia96d552d731e112505fcf739029a6fd4d0134546 Issue-ID: SO-1061 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/test/java')
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImplTest.java48
1 files changed, 43 insertions, 5 deletions
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImplTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImplTest.java
index 24a99c97f4..2a8046b1be 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImplTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImplTest.java
@@ -46,8 +46,9 @@ public class VnfAdapterImplTest extends BaseTaskTest {
private static final String VNF_ADAPTER_REST_DELETE_RESPONSE = FileUtil.readResourceFile("__files/VfModularity/VNFAdapterRestDeleteResponse.xml");
private static final String VNF_ADAPTER_REST_CREATE_RESPONSE = FileUtil.readResourceFile("__files/VfModularity/VNFAdapterRestCreateCallback.xml");
private static final String VNF_ADAPTER_VOLUME_CREATE_RESPONSE = FileUtil.readResourceFile("__files/VfModularity/CreateVfModuleVolumeCallbackResponse.xml");
+ private static final String VNF_ADAPTER_VOLUME_DELETE_RESPONSE = FileUtil.readResourceFile("__files/VfModularity/DeleteVfModuleVolumeCallbackResponse.xml");
private static final String TEST_VFMODULE_HEATSTACK_ID = "slowburn";
- private static final String TEST_VOLUME_HEATSTACK_ID = "testHeatStackId1";
+ private static final String TEST_VOLUME_HEATSTACK_ID = "testHeatStackId1";
@Before
public void before() {
@@ -56,6 +57,7 @@ public class VnfAdapterImplTest extends BaseTaskTest {
vfModule = setVfModule();
volumeGroup = setVolumeGroup();
vfModule.setHeatStackId(null);
+ volumeGroup.setHeatStackId(null);
}
@Test
@@ -98,13 +100,14 @@ public class VnfAdapterImplTest extends BaseTaskTest {
@Test
public void postProcessVnfAdapter_DeleteResponseTest() {
+ vfModule.setHeatStackId(TEST_VFMODULE_HEATSTACK_ID);
execution.setVariable("vnfAdapterRestV1Response", VNF_ADAPTER_REST_DELETE_RESPONSE);
vnfAdapterImpl.postProcessVnfAdapter(execution);
assertNull(vfModule.getHeatStackId());
}
@Test
- public void postProcessVnfAdapter_ResponseNullTest() {
+ public void postProcessVnfAdapter_ResponseNullTest() {
execution.setVariable("vnfAdapterRestV1Response", null);
vnfAdapterImpl.postProcessVnfAdapter(execution);
assertNull(vfModule.getHeatStackId());
@@ -119,9 +122,10 @@ public class VnfAdapterImplTest extends BaseTaskTest {
@Test
public void postProcessVnfAdapter_DeleteResponseTest_VfModuleDeletedFalse() {
+ vfModule.setHeatStackId(TEST_VFMODULE_HEATSTACK_ID);
execution.setVariable("vnfAdapterRestV1Response", "<deleteVfModuleResponse><vfModuleDeleted>false</vfModuleDeleted></deleteVfModuleResponse>");
vnfAdapterImpl.postProcessVnfAdapter(execution);
- assertNull(vfModule.getHeatStackId());
+ assertEquals(TEST_VFMODULE_HEATSTACK_ID, vfModule.getHeatStackId());
}
@Test
@@ -133,9 +137,10 @@ public class VnfAdapterImplTest extends BaseTaskTest {
@Test
public void postProcessVnfAdapter_DeleteResponseTest_EmptyVfModuleDeletedTag() {
+ vfModule.setHeatStackId(TEST_VFMODULE_HEATSTACK_ID);
execution.setVariable("vnfAdapterRestV1Response", "<deleteVfModuleResponse></deleteVfModuleResponse>");
vnfAdapterImpl.postProcessVnfAdapter(execution);
- assertNull(vfModule.getHeatStackId());
+ assertEquals(TEST_VFMODULE_HEATSTACK_ID, vfModule.getHeatStackId());
}
@Test
@@ -157,10 +162,43 @@ public class VnfAdapterImplTest extends BaseTaskTest {
expectedException.expect(BpmnError.class);
execution.setVariable("vnfAdapterRestV1Response", "<createVolumeGroupResponse></createVolumeGroupResponse>");
vnfAdapterImpl.postProcessVnfAdapter(execution);
+ assertNull(volumeGroup.getHeatStackId());
}
+
+ @Test
+ public void postProcessVnfAdapter_DeleteResponseTest_DeleteVolumeGroup() {
+ volumeGroup.setHeatStackId(TEST_VOLUME_HEATSTACK_ID);
+ execution.setVariable("vnfAdapterRestV1Response", VNF_ADAPTER_VOLUME_DELETE_RESPONSE);
+ vnfAdapterImpl.postProcessVnfAdapter(execution);
+ assertNull(volumeGroup.getHeatStackId());
+ }
+
+
+ @Test
+ public void postProcessVnfAdapter_DeleteResponseTest_VolumeGroupDeletedFalse() {
+ volumeGroup.setHeatStackId(TEST_VOLUME_HEATSTACK_ID);
+ execution.setVariable("vnfAdapterRestV1Response", "<deleteVolumeGroupResponse><volumeGroupDeleted>false</volumeGroupDeleted></deleteVolumeGroupResponse>");
+ vnfAdapterImpl.postProcessVnfAdapter(execution);
+ assertEquals(TEST_VOLUME_HEATSTACK_ID, volumeGroup.getHeatStackId());
+ }
+
+ @Test
+ public void postProcessVnfAdapter_DeleteResponseTest_EmptyDeleteVolumeGroupResponseTag() {
+ expectedException.expect(BpmnError.class);
+ execution.setVariable("vnfAdapterRestV1Response", "<volumeGroupDeleted></volumeGroupDeleted>");
+ vnfAdapterImpl.postProcessVnfAdapter(execution);
+ }
+
+ @Test
+ public void postProcessVnfAdapter_DeleteResponseTest_EmptyVolumeGroupDeletedTag() {
+ volumeGroup.setHeatStackId(TEST_VOLUME_HEATSTACK_ID);
+ execution.setVariable("vnfAdapterRestV1Response", "<deleteVolumeGroupResponse></deleteVolumeGroupResponse>");
+ vnfAdapterImpl.postProcessVnfAdapter(execution);
+ assertEquals(TEST_VOLUME_HEATSTACK_ID, volumeGroup.getHeatStackId());
+ }
@Test
- public void postProcessVnfAdapterExceptionTest() {
+ public void postProcessVnfAdapterExceptionTest() {
execution.setVariable("vnfAdapterRestV1Response", VNF_ADAPTER_REST_CREATE_RESPONSE);
expectedException.expect(BpmnError.class);
lookupKeyMap.clear();