diff options
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/test/java')
3 files changed, 17 insertions, 9 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/appc/payload/PayloadClientTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/appc/payload/PayloadClientTest.java index 8d681d721c..80b978e4fd 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/appc/payload/PayloadClientTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/appc/payload/PayloadClientTest.java @@ -31,10 +31,10 @@ public class PayloadClientTest { @Test public void upgradeFormatTest() throws Exception { - String payloadResult = "{\"configuration-parameters\":{\"vnf_name\":\"vnfName1\",\"existing-software-version\":\"existingVersion\",\"new-software-version\":\"newVersion\"}}"; + String payloadResult = "{\"configuration-parameters\":{\"vnf_name\":\"vnfName1\",\"existing_software_version\":\"existingVersion\",\"new_software_version\":\"newVersion\"}}"; JSONObject jsonObject = new JSONObject(); - jsonObject.put("existing-software-version", "existingVersion"); - jsonObject.put("new-software-version", "newVersion"); + jsonObject.put("existing_software_version", "existingVersion"); + jsonObject.put("new_software_version", "newVersion"); Optional<String> payload = Optional.of(jsonObject.toString()); Optional<String> payloadClient = PayloadClient.upgradeFormat(payload, "vnfName1"); assertEquals(payloadResult, payloadClient.get()); @@ -51,7 +51,7 @@ public class PayloadClientTest { public void quiesceTrafficFormatTest() throws Exception { String payloadResult = "{\"configuration-parameters\":{\"vnf_name\":\"vnfName1\",\"operations_timeout\":\"operationTimeout\"}}"; JSONObject jsonObject = new JSONObject(); - jsonObject.put("operations-timeout", "operationTimeout"); + jsonObject.put("operations_timeout", "operationTimeout"); Optional<String> payload = Optional.of(jsonObject.toString()); Optional<String> payloadClient = PayloadClient.quiesceTrafficFormat(payload, "vnfName1"); assertEquals(payloadResult, payloadClient.get()); @@ -78,4 +78,4 @@ public class PayloadClientTest { assertEquals(payloadResult, payloadClient.get()); } -}
\ No newline at end of file +} diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java index 355dc15bbf..daa63044e4 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java @@ -1459,14 +1459,20 @@ public class BBInputSetupTest { new AAICommonObjectMapperProvider().getMapper().writeValueAsString(aaiCollection))); Collection collection = new Collection(); + ModelInfoCollection modelInfoCollection = new ModelInfoCollection(); List<InstanceGroup> instanceGroupsList = new ArrayList<>(); InstanceGroup instanceGroup = new InstanceGroup(); instanceGroupsList.add(instanceGroup); - + NetworkCollectionResourceCustomization networkCollectionCust = Mockito.mock(NetworkCollectionResourceCustomization.class); + CollectionResource collectionResource = new CollectionResource(); doReturn(collection).when(bbInputSetupMapperLayer) .mapAAICollectionIntoCollection(isA(org.onap.aai.domain.yang.Collection.class)); doReturn(instanceGroup).when(SPY_bbInputSetup).mapInstanceGroup(isA(AAIResultWrapper.class)); doReturn(instanceGroupsList).when(SPY_bbInputSetup).mapInstanceGroups(any()); + doReturn(networkCollectionCust).when(SPY_bbInputSetupUtils).getCatalogNetworkCollectionResourceCustByID(aaiCollection.getCollectionCustomizationId()); + doReturn(collectionResource).when(networkCollectionCust).getCollectionResource(); + doReturn(modelInfoCollection).when(bbInputSetupMapperLayer).mapCatalogCollectionToCollection(networkCollectionCust, collectionResource); + SPY_bbInputSetup.mapCollection(collections, serviceInstance); assertEquals(collection, serviceInstance.getCollection()); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java index d576242318..db0f408010 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java @@ -736,7 +736,7 @@ public class BBInputSetupUtilsTest { volumeGroup.setVolumeGroupName("name123"); expected.get().getVolumeGroup().add(volumeGroup); doReturn(expected).when(MOCK_aaiResourcesClient).get(eq(VolumeGroups.class), any(AAIResourceUri.class)); - Optional<VolumeGroup> actual = this.bbInputSetupUtils.getRelatedVolumeGroupByNameFromVfModule("id123", "name123"); + Optional<VolumeGroup> actual = this.bbInputSetupUtils.getRelatedVolumeGroupByNameFromVfModule("id123", "id123", "name123"); assertEquals(actual.get().getVolumeGroupId(), expected.get().getVolumeGroup().get(0).getVolumeGroupId()); } @@ -745,6 +745,7 @@ public class BBInputSetupUtilsTest { expectedException.expect(Exception.class); String vnfId = "vnfId"; + String volumeGroupId = "volumeGroupId"; String volumeGroupName = "volumeGroupName"; VolumeGroup volumeGroup = new VolumeGroup(); @@ -757,17 +758,18 @@ public class BBInputSetupUtilsTest { doReturn(expectedVolumeGroup).when(MOCK_aaiResourcesClient).get(eq(VolumeGroups.class), any(AAIResourceUri.class)); - bbInputSetupUtils.getRelatedVolumeGroupByNameFromVfModule(vnfId, volumeGroupName); + bbInputSetupUtils.getRelatedVolumeGroupByNameFromVfModule(vnfId, volumeGroupId, volumeGroupName); } @Test public void getRelatedVolumeGroupByNameFromVfModuleNotFoundTest() throws Exception { String vnfId = "vnfId"; + String volumeGroupId = "volumeGroupId"; String volumeGroupName = "volumeGroupName"; doReturn(Optional.empty()).when(MOCK_aaiResourcesClient).get(eq(VolumeGroups.class), any(AAIResourceUri.class)); - Optional<VolumeGroup> actualVolumeGroup = bbInputSetupUtils.getRelatedVolumeGroupByNameFromVfModule(vnfId, volumeGroupName); + Optional<VolumeGroup> actualVolumeGroup = bbInputSetupUtils.getRelatedVolumeGroupByNameFromVfModule(vnfId, volumeGroupId, volumeGroupName); assertEquals(actualVolumeGroup, Optional.empty()); } |