aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-infrastructure-common/src
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src')
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateNetworkInstance.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy1
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVnfInfra.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy1
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy1
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1.groovy4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareServiceInstanceData.groovy270
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy23
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy6
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy6
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy11
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy28
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy9
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy1
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollback.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModule.groovy16
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstance.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java112
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java34
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIResource.java22
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java208
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAICreateResources.java166
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIDeleteServiceInstance.java36
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIServiceInstance.java155
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGenerator.java21
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/PnfNotificationEvent.java42
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java90
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegate.java5
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java22
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/GeneratePnfUuidDelegate.java3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java25
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java10
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareCdsCallDelegate.java78
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigAssignDelegate.java73
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigDeployDelegate.java110
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationId.java5
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java33
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/management/PnfManagementImpl.java4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/properties/BPMNProperties.java16
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NSResourceInputParameter.java2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsOperationKey.java3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/VimLocation.java2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java1443
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java94
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java27
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java21
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java38
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java9
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/GenericResourceApi.java10
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtil.java3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java400
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilder.java35
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilder.java28
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkInputParametersEntity.java5
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RequestInformationEntity.java4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationInputEntity.java4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationOutputEntity.java4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcServiceTopologyOperationInputEntity.java7
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceInputParametersEntity.java5
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstanceTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfraTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareServiceInstanceDataTest.groovy301
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy5
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollbackTest.groovy6
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstanceTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnfTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2Test.groovy110
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModulesTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy2305
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModuleTest.groovy4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModulesTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1Test.groovy21
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy24
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy18
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy24
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy18
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy18
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy18
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllBPMNTestSuites.java6
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllTasksTestsTestSuite.java8
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllTestsTestSuite.java13
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/BeansTest.java51
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/WebSecurityConfigImpl.java31
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResourcesTest.java301
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstanceTest.java87
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstanceTest.java7
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGeneratorTest.java43
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscriptionTest.java6
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegateTest.java11
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegateTest.java139
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegateTest.java1
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelationTest.java1
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/GeneratePnfUuidDelegateTest.java1
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClientTest.java21
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java1
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementTestImpl.java4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigAssignDelegateTest.java130
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigDeployDelegateTest.java183
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationIdTest.java13
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java87
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/vfcmodel/VfcModelPojoTest.java19
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactoryTest.java157
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtilTest.java7
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java222
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilderTest.java67
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilderTest.java67
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ClientEntityPojoTest.java68
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/queryAAIVpnBindingTestResponseWithRoutes.json903
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV2/vnfAdapterDeleteRequest.xml1
140 files changed, 5503 insertions, 3925 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateNetworkInstance.groovy
index 19fe018e13..d588da38b0 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateNetworkInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateNetworkInstance.groovy
@@ -416,7 +416,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
} catch (Exception ex) {
String errorException = " Bpmn error encountered in CreateNetworkInstance flow. FalloutHandlerRequest, buildErrorResponse()"
- logger.debug("Exception error in CreateNetworkInstance flow, buildErrorResponse(): " + ex.getMessage())
+ logger.debug("Exception error in CreateNetworkInstance flow, buildErrorResponse(): {}", ex.getMessage(), ex)
falloutHandlerRequest =
"""<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
xmlns:ns="http://org.onap/so/request/types/v1"
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
index bb2116acb9..65fa0511ac 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
@@ -441,7 +441,6 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
}
String sndcTopologyCreateRequesAsString = utils.formatXml(sdncTopologyCreateRequest)
- utils.logAudit(sndcTopologyCreateRequesAsString)
execution.setVariable("sdncAdapterWorkflowRequest", sndcTopologyCreateRequesAsString)
logger.debug("sdncAdapterWorkflowRequest - " + "\n" + sndcTopologyCreateRequesAsString)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy
index 712512fdc9..fa9fe62df4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy
@@ -268,7 +268,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
*/
public void validateWorkflowResponse(DelegateExecution execution, String responseVar,
String responseCodeVar, String errorResponseVar) {
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, responseVar, responseCodeVar, errorResponseVar)
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVnfInfra.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVnfInfra.groovy
index c0e8d5a6ba..e941d50155 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVnfInfra.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVnfInfra.groovy
@@ -349,7 +349,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
logger.debug("workflowException: " + workflowException)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
logger.debug("SDNCResponse: " + response)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
index ccdb5d77cd..4233147f83 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
@@ -328,7 +328,6 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
}
String sdncTopologyDeleteRequesAsString = utils.formatXml(sdncTopologyDeleteRequest)
- utils.logAudit(sdncTopologyDeleteRequesAsString)
execution.setVariable("sdncAdapterWorkflowRequest", sdncTopologyDeleteRequesAsString)
logger.info("sdncAdapterWorkflowRequest - " + "\n" + sdncTopologyDeleteRequesAsString)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
index 0dc86632e2..20134a77a9 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
@@ -354,7 +354,6 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
}
String sdncTopologyDeleteRequesAsString = utils.formatXml(sdncTopologyDeleteRequest)
- utils.logAudit(sdncTopologyDeleteRequesAsString)
execution.setVariable("sdncAdapterWorkflowRequest", sdncTopologyDeleteRequesAsString)
logger.info("sdncAdapterWorkflowRequest - " + "\n" + sdncTopologyDeleteRequesAsString)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1.groovy
index ccd9f9bd02..cf53aff878 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1.groovy
@@ -68,6 +68,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
execution.setVariable('DELVfModVol_vnfType', null)
execution.setVariable('DELVfModVol_serviceId', null)
execution.setVariable('DELVfModVol_cloudRegion', null)
+ execution.setVariable('DELVfModVol_cloudOwner', null)
execution.setVariable('DELVfModVol_tenantId', null)
execution.setVariable('DELVfModVol_volumeParams', null)
execution.setVariable('DELVfModVol_volumeGroupHeatStackId', null)
@@ -141,6 +142,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
execution.setVariable('DELVfModVol_volumeOutputs', utils.getNodeXml(request, 'volume-outputs', false))
execution.setVariable('DELVfModVol_volumeParams', utils.getNodeXml(request, 'volume-params'))
execution.setVariable('DELVfModVol_cloudRegion', utils.getNodeText(request, 'aic-cloud-region'))
+ execution.setVariable('DELVfModVol_cloudOwner', utils.getNodeText(request, 'cloud-owner'))
setBasicDBAuthHeader(execution, isDebugLogEnabled)
@@ -308,6 +310,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
public void prepareVnfAdapterDeleteRequest(DelegateExecution execution, isDebugLogEnabled) {
def cloudRegion = execution.getVariable('DELVfModVol_cloudRegion')
+ def cloudOwner = execution.getVariable('DELVfModVol_cloudOwner')
def tenantId = execution.getVariable('DELVfModVol_tenantId')
def volumeGroupId = execution.getVariable('DELVfModVol_volumeGroupId')
def volumeGroupHeatStackId = execution.getVariable('DELVfModVol_volumeGroupHeatStackId')
@@ -324,6 +327,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
String vnfAdapterRestRequest = """
<deleteVolumeGroupRequest>
<cloudSiteId>${MsoUtils.xmlEscape(cloudRegion)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<volumeGroupId>${MsoUtils.xmlEscape(volumeGroupId)}</volumeGroupId>
<volumeGroupStackId>${MsoUtils.xmlEscape(volumeGroupHeatStackId)}</volumeGroupStackId>
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareServiceInstanceData.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareServiceInstanceData.groovy
new file mode 100644
index 0000000000..a1f68f9b06
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareServiceInstanceData.groovy
@@ -0,0 +1,270 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.scripts
+
+import org.camunda.bpm.engine.delegate.DelegateExecution
+import org.onap.aai.domain.yang.ServiceInstance
+import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
+import org.onap.so.bpmn.common.scripts.ExceptionUtil
+import org.onap.so.bpmn.core.domain.Resource
+import org.onap.so.bpmn.core.domain.ServiceDecomposition
+import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.infrastructure.workflow.service.ServicePluginFactory
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
+/**
+ * This groovy class supports the <class>DoCompareServiceInstanceData.bpmn</class> process.
+ *
+ * Inputs:
+ * @param - serviceInstanceData-original
+ * @param - serviceInstanceId
+ * @param - uuiRequest
+ * @param - model-invariant-id-original
+ * @param - model-version-id-original
+ * @param - msoRequestId
+ * @param - isDebugLogEnabled
+ *
+ * Outputs:
+ * @param - addResourceList
+ * @param - delResourceList
+ * @param - uuiRequest-add
+ * @param - uuiRequest-del
+ *
+ */
+public class DoCompareServiceInstanceData extends AbstractServiceTaskProcessor {
+
+ ExceptionUtil exceptionUtil = new ExceptionUtil()
+ JsonUtils jsonUtil = new JsonUtils()
+ private static final Logger logger = LoggerFactory.getLogger( DoCompareServiceInstanceData.class);
+
+ public void preProcessRequest (DelegateExecution execution) {
+ def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+ logger.info("INFO"," ***** preProcessRequest *****", isDebugEnabled)
+ try {
+ checkInput("serviceInstanceData-original", execution, isDebugEnabled)
+ checkInput("serviceInstanceId", execution, isDebugEnabled)
+ checkInput("uuiRequest", execution, isDebugEnabled)
+ checkInput("model-invariant-id-original", execution, isDebugEnabled)
+ checkInput("model-version-id-original", execution, isDebugEnabled)
+ checkInput("msoRequestId", execution, isDebugEnabled)
+ } catch (Exception ex){
+ String msg = "Exception in preProcessRequest " + ex.getMessage()
+ logger.info("INFO", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ logger.info("INFO"," ***** Exit preProcessRequest *****", isDebugEnabled)
+ }
+
+ private void checkInput(String inputName, DelegateExecution execution, isDebugEnabled) {
+ String msg
+ Object inputValue = execution.getVariable(inputName)
+ if (inputValue == null) {
+ msg = "Input" + inputName + "is null"
+ logger.info("INFO", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ }
+ }
+
+
+ public void prepareDecomposeService_Original(DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+
+ try {
+ logger.debug( " ***** Inside prepareDecomposeService_Original of update generic e2e service ***** ")
+ String modelInvariantUuid = execution.getVariable("model-invariant-id-original")
+ String modelUuid = execution.getVariable("model-version-id-original")
+ //here modelVersion is not set, we use modelUuid to decompose the service.
+ String serviceModelInfo = """{
+ "modelInvariantUuid":"${modelInvariantUuid}",
+ "modelUuid":"${modelUuid}",
+ "modelVersion":""
+ }"""
+
+ execution.setVariable("serviceModelInfo_Original", serviceModelInfo)
+
+ logger.debug( " ***** Completed prepareDecomposeService_Original of update generic e2e service ***** ")
+ } catch (Exception ex) {
+ // try error in method block
+ String exceptionMessage = "Bpmn error encountered in update generic e2e service flow. Unexpected Error from method prepareDecomposeService_Original() - " + ex.getMessage()
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
+ }
+ }
+
+ public void processDecomposition_Original(DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+
+ logger.debug( " ***** Inside processDecomposition_Original() of update generic e2e service flow ***** ")
+ try {
+ ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+ execution.setVariable("serviceDecomposition_Original", serviceDecomposition)
+ } catch (Exception ex) {
+ String exceptionMessage = "Bpmn error encountered in update generic e2e service flow. processDecomposition_Original() - " + ex.getMessage()
+ logger.debug( exceptionMessage)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
+ }
+ }
+
+ public void doCompareUuiRquestInput(DelegateExecution execution) {
+
+ def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+ logger.info("INFO", "======== Start doCompareUuiRquestInput Process ======== ", isDebugEnabled)
+
+ String uuiRequest_Target = execution.getVariable("uuiRequest")
+ Map<String, Object> serviceParametersObject_Target = getServiceParametersObject(uuiRequest_Target)
+ Map<String, Object> serviceRequestInputs_Target = (Map<String, Object>) serviceParametersObject_Target.get("requestInputs")
+ List<Object> resources_Target = (List<Object>) serviceParametersObject_Target.get("resources")
+
+ String uuiRequest_Original = ((ServiceInstance) execution.getVariable("serviceInstanceData-original")).getInputParameters()
+ Map<String, Object> serviceParametersObject_Original = getServiceParametersObject(uuiRequest_Original)
+ Map<String, Object> serviceRequestInputs_Original = (Map<String, Object>) serviceParametersObject_Original.get("requestInputs")
+ List<Object> resources_Original = (List<Object>) serviceParametersObject_Original.get("resources")
+
+ logger.info("INFO", "uuiRequest is: " + uuiRequest_Target, isDebugEnabled)
+
+ //the resources which are included by resources_Target but resources_Original are the resources going to be added
+ ArrayList<Object> resourceList_Add = findResourceListIncluded(resources_Target, resources_Original)
+ HashMap<String, Object> serviceRequestInputs_Add = getServiceRequestInputsIncluded(resourceList_Add, serviceRequestInputs_Target, serviceParametersObject_Target)
+ String uuiRequest_add = loadUuiRequestJsonString(uuiRequest_Target, resourceList_Add, serviceRequestInputs_Add)
+ execution.setVariable("uuiRequest", uuiRequest_add)
+ logger.info("INFO", "uuiRequest will be changed to: " + uuiRequest_add, isDebugEnabled)
+
+ //the resources which are included by resources_Original but resources_Target are the resources going to be deleted
+ ArrayList<Object> resourceList_Del = findResourceListIncluded(resources_Original, resources_Target)
+ HashMap<String, Object> serviceRequestInputs_Del = getServiceRequestInputsIncluded(resourceList_Del, serviceRequestInputs_Original, serviceParametersObject_Original)
+ String uuiRequest_del = loadUuiRequestJsonString(uuiRequest_Original, resourceList_Del, serviceRequestInputs_Del)
+ execution.setVariable("uuiRequest-del", uuiRequest_del)
+ logger.info("INFO", "uuiRequest-del: " + uuiRequest_del, isDebugEnabled)
+
+ List<Resource> addResourceList = findResourceList(resourceList_Add, execution)
+ execution.setVariable("addResourceList", addResourceList)
+ logger.info("INFO", "addResourceList: " + addResourceList, isDebugEnabled)
+
+ List<Resource> delResourceList = findResourceList(resourceList_Del, execution)
+ execution.setVariable("delResourceList", delResourceList)
+ logger.info("INFO", "delResourceList: " + delResourceList, isDebugEnabled)
+
+ logger.info("INFO", "======== COMPLETED doCompareUuiRquestInput Process ======== ", isDebugEnabled)
+ }
+
+ private List<Resource> findResourceList(ArrayList<Object> uuiResourceList, DelegateExecution execution) {
+ HashSet<String> addResourceCustomizationUuidSet = getCustomizationUuidSet(uuiResourceList)
+ Set<Resource> resourceSet = new HashSet<>()
+ ServiceDecomposition serviceDecomposition_Original = execution.getVariable("serviceDecomposition_Original")
+ List<Resource> allSR_original = serviceDecomposition_Original.getServiceResources()
+ for (Resource resource : allSR_original) {
+ if (addResourceCustomizationUuidSet.contains(resource.getModelInfo().getModelCustomizationUuid())) {
+ resourceSet.add(resource)
+ }
+ }
+ List<Resource> resourceList = new ArrayList<String>(resourceSet)
+ resourceList
+ }
+
+ private HashSet<String> getCustomizationUuidSet(ArrayList<Object> resourceList_Add) {
+ Set<String> addRsourceCustomizationUuidSet = new HashSet<>()
+ for (Map<String, Object> resourceAdded : resourceList_Add) {
+ addRsourceCustomizationUuidSet.add(resourceAdded.get("rsourceCustomizationUuid"))
+ }
+ addRsourceCustomizationUuidSet
+ }
+
+ private String loadUuiRequestJsonString(String uuiRequest_Target, ArrayList<Object> resourceList_Add, HashMap<String, Object> serviceRequestInputs_Add) {
+ Map<String, Object> uuiObject = ServicePluginFactory.getInstance().getJsonObject(uuiRequest_Target, Map.class)
+ Map<String, Object> serviceObject = (Map<String, Object>) uuiObject.get("service")
+ Map<String, Object> serviceParametersObject = (Map<String, Object>) serviceObject.get("parameters")
+ serviceParametersObject.put("resources", resourceList_Add)
+ serviceParametersObject.put("requestInputs", serviceRequestInputs_Add)
+ String uuiRequest_add = ServicePluginFactory.getInstance().getJsonString(serviceObject)
+ uuiRequest_add
+ }
+
+ private HashMap<String, Object> getServiceRequestInputsIncluded(ArrayList<Object> resourceList_Add, Map<String, Object> serviceRequestInputs_Target, Map<String, Object> serviceParametersObject_Target) {
+ ArrayList<String> newResourceNames = getNewResourceNames(resourceList_Add)
+ Map<String, Object> serviceRequestInputs_Add = new HashMap<String, Object>()
+ for (String inputKey : serviceRequestInputs_Target.keySet()) {
+ String resourceName = (inputKey.split("_"))[0]
+ if (newResourceNames.contains(resourceName)) {
+ serviceRequestInputs_Add.put(inputKey, serviceParametersObject_Target.get(inputKey))
+ }
+ }
+ serviceRequestInputs_Add
+ }
+
+ private ArrayList<String> getNewResourceNames(ArrayList<Object> addResourceList) {
+ Set<String> newResourceNames = new ArrayList<String>()
+ for (Object resourceObject : addResourceList) {
+ Map<String, Object> resourceAdded = (Map<String, Object>) resourceObject
+ String resName = new String(resourceAdded.get("resourceName"))
+ normalizeName(resName)
+ newResourceNames.add(resName)
+ }
+ newResourceNames
+ }
+
+ private void normalizeName(String resName) {
+ resName.replaceAll("_", "")
+ resName.replaceAll(" ", "")
+ resName.toLowerCase()
+ }
+
+ private ArrayList<Object> findResourceListIncluded(List<Object> resources_Target, List<Object> resources_Original) {
+ List<Object> addResourceList = new ArrayList<Object>()
+ for (Object resource_Target : resources_Target) {
+ Map<String, Object> resourceObject_Target = (Map<String, Object>) resource_Target
+ boolean isNewResourceInstance = isNewResourceInstance(resourceObject_Target, resources_Original)
+ if (isNewResourceInstance) {
+ addResourceList.add(resource_Target)
+ }
+ }
+ addResourceList
+ }
+
+ private boolean isNewResourceInstance(Map<String, Object> resourceObject_Target, List<Object> resources_Original) {
+ String resourceIndex_Target = null
+ if (resourceObject_Target.keySet().contains("resourceIndex")) {
+ resourceIndex_Target = resourceObject_Target.get("resourceIndex")
+ }
+ String resourceName_Target = resourceObject_Target.get("resourceName")
+ boolean isNewResourceInstance = true
+ for (Object resource_Original : resources_Original) {
+ Map<String, Object> resourceObject_Original = (Map<String, Object>) resource_Original
+ String resourceIndex_Original = null
+ if (resourceObject_Original.keySet().contains("resourceIndex")) {
+ resourceIndex_Original = resourceObject_Original.get("resourceIndex")
+ }
+ String resourceName_Original = resourceObject_Original.get("resourceName")
+ if (resourceName_Target.equals(resourceName_Original)) {
+ if (resourceIndex_Target != null && resourceIndex_Original != null) {
+ if (resourceIndex_Target.equals(resourceIndex_Original)) {
+ isNewResourceInstance = false
+ }
+ } else {
+ isNewResourceInstance = false
+ }
+ }
+ }
+ isNewResourceInstance
+ }
+
+ private Map<String, Object> getServiceParametersObject(String uuiRequest_Target) {
+ Map<String, Object> uuiObject = ServicePluginFactory.getInstance().getJsonObject(uuiRequest_Target, Map.class)
+ Map<String, Object> serviceObject = (Map<String, Object>) uuiObject.get("service")
+ Map<String, Object> serviceParametersObject = (Map<String, Object>) serviceObject.get("parameters")
+ serviceParametersObject
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy
index ce9df87799..a12c2f4b85 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy
@@ -156,7 +156,7 @@ public class DoCreateE2EServiceInstanceRollback extends AbstractServiceTaskProce
logger.debug("SDNCResponse: " + response)
logger.debug("workflowException: " + workflowException)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy
index 41bae326a5..22c8a11fae 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy
@@ -1081,7 +1081,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
WorkflowException workflowException = execution.getVariable("WorkflowException")
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
// reset variable
String assignSDNCResponseDecodeXml = execution.getVariable(Prefix + "assignSDNCResponse")
@@ -1109,7 +1109,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
WorkflowException workflowException = execution.getVariable("WorkflowException")
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
// reset variable
String assignSDNCResponseDecodeXml = execution.getVariable(Prefix + "activateSDNCResponse")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy
index c144dc0f46..41a302f5f1 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy
@@ -244,7 +244,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
rollbackSDNCReturnCode = execution.getVariable(Prefix + "rollbackSDNCReturnCode")
String rollbackSDNCResponse = execution.getVariable(Prefix + "rollbackSDNCResponse")
String rollbackSDNCReturnInnerCode = ""
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
rollbackSDNCResponse = rollbackSDNCResponse
rollbackSDNCResponse = rollbackSDNCResponse.replace('$', '').replace('<?xml version="1.0" encoding="UTF-8"?>', "")
if (rollbackSDNCReturnCode == "200") {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
index 163bd0f583..bf52b11de2 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
@@ -491,7 +491,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
String response = execution.getVariable("sdncAdapterResponse")
logger.debug("SDNCResponse: " + response)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy
index a337087105..1eeba493f4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy
@@ -149,7 +149,7 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
logger.debug("SDNCResponse: " + response)
logger.debug("workflowException: " + workflowException)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy
index c03f9f9c95..6b4fc840f7 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy
@@ -84,7 +84,7 @@ public class DoCreateVfModule extends VfModuleBase {
String Prefix="DCVFM_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
OofInfraUtils oofInfraUtils = new OofInfraUtils()
CatalogDbUtils catalogDbUtils = new CatalogDbUtilsFactory().create()
DecomposeJsonUtil decomposeJsonUtils = new DecomposeJsonUtil()
@@ -598,7 +598,7 @@ public class DoCreateVfModule extends VfModuleBase {
*/
public void validateWorkflowResponse(DelegateExecution execution, String responseVar,
String responseCodeVar, String errorResponseVar) {
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, responseVar, responseCodeVar, errorResponseVar)
}
@@ -668,8 +668,7 @@ public class DoCreateVfModule extends VfModuleBase {
rollbackData.put("VFMODULE", "rollbackPrepareUpdateVfModule", "true")
execution.setVariable("rollbackData", rollbackData)
} catch (Exception ex) {
- ex.printStackTrace()
- logger.debug('Exception occurred while postProcessing CreateAAIVfModule request:' + ex.getMessage())
+ logger.debug('Exception occurred while postProcessing CreateAAIVfModule request: {}', ex.getMessage(), ex)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Bad response from CreateAAIVfModule' + ex.getMessage())
}
logger.trace('Exited ' + method)
@@ -741,8 +740,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
}
} catch (Exception ex) {
- ex.printStackTrace()
- logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
+ logger.debug('Exception occurred while executing AAI GET: {}', ex.getMessage(), ex)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
}
logger.trace('Exited ' + method)
@@ -822,17 +820,16 @@ public class DoCreateVfModule extends VfModuleBase {
}
}
} catch (Exception ex) {
- ex.printStackTrace()
- logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
+ logger.debug('Exception occurred while executing AAI GET: {}', ex.getMessage(), ex)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
}
logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
'Caught exception in ' + method, "BPMN",
- ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
+ ErrorCode.UnknownError.getValue(), "Exception is:\n" + e, e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIVfModuleForStatus(): ' + e.getMessage())
}
}
@@ -982,6 +979,8 @@ public class DoCreateVfModule extends VfModuleBase {
//Get variables
//cloudSiteId
def cloudSiteId = execution.getVariable("DCVFM_cloudSiteId")
+ //cloudOwner
+ def cloudOwner = execution.getVariable("DCVFM_cloudOwner")
//tenantId
def tenantId = execution.getVariable("DCVFM_tenantId")
//vnfType
@@ -1070,6 +1069,7 @@ public class DoCreateVfModule extends VfModuleBase {
String createVnfARequest = """
<createVfModuleRequest>
<cloudSiteId>${MsoUtils.xmlEscape(cloudSiteId)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId>
<vnfName>${MsoUtils.xmlEscape(vnfName)}</vnfName>
@@ -1233,6 +1233,7 @@ public class DoCreateVfModule extends VfModuleBase {
def vfModuleModelName = execution.getVariable("DCVFM_vfModuleModelName")
def vnfId = execution.getVariable("DCVFM_vnfId")
def cloudSiteId = execution.getVariable("DCVFM_cloudSiteId")
+ def cloudOwner = execution.getVariable("DCVFM_cloudOwner")
def sdncVersion = execution.getVariable("DCVFM_sdncVersion")
def serviceModelInfo = execution.getVariable("serviceModelInfo")
def vnfModelInfo = execution.getVariable("vnfModelInfo")
@@ -1634,7 +1635,7 @@ public class DoCreateVfModule extends VfModuleBase {
logger.debug("workflowException: " + workflowException)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
String sdncResponse = response
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy
index a6040ac290..65f6f76a21 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy
@@ -92,6 +92,8 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
execution.setVariable("DCVFMR_vfModuleModelName", vfModuleModelName)
String cloudSiteId = rollbackData.get("VFMODULE", "aiccloudregion")
execution.setVariable("DCVFMR_cloudSiteId", cloudSiteId)
+ String cloudOwner = rollbackData.get("VFMODULE", "cloudowner")
+ execution.setVariable("DCVFMR_cloudOwner", cloudOwner)
String heatStackId = rollbackData.get("VFMODULE", "heatstackid")
execution.setVariable("DCVFMR_heatStackId", heatStackId)
String requestId = rollbackData.get("VFMODULE", "msorequestid")
@@ -358,6 +360,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
String origRequestId = execution.getVariable("DCVFMR_requestId")
String srvInstId = execution.getVariable("DCVFMR_serviceInstanceId")
String aicCloudRegion = execution.getVariable("DCVFMR_cloudSiteId")
+ String cloudOwner = execution.getVariable("DCVFMR_cloudOwner")
String vnfId = execution.getVariable("DCVFMR_vnfId")
String vfModuleId = execution.getVariable("DCVFMR_vfModuleId")
String vfModuleStackId = execution.getVariable("DCVFMR_heatStackId")
@@ -373,6 +376,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
String request = """
<deleteVfModuleRequest>
<cloudSiteId>${MsoUtils.xmlEscape(aicCloudRegion)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId>
<vfModuleId>${MsoUtils.xmlEscape(vfModuleId)}</vfModuleId>
@@ -459,7 +463,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
WorkflowException workflowException = execution.getVariable("WorkflowException")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy
index 5f160bb068..fb5c0fa0aa 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy
@@ -61,7 +61,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
VidUtils vidUtils = new VidUtils(this)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
OofInfraUtils oofInfraUtils = new OofInfraUtils()
/**
@@ -362,7 +362,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
resourceClient.connect(uri, siUri)
}catch(Exception ex) {
- logger.debug("Error Occured in DoCreateVnf CreateGenericVnf Process ", ex)
+ logger.debug("Error Occured in DoCreateVnf CreateGenericVnf Process: {}", ex.getMessage(), ex)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf CreateGenericVnf Process")
}
logger.trace("COMPLETED DoCreateVnf CreateGenericVnf Process")
@@ -530,7 +530,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
logger.debug("workflowException: " + workflowException)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
logger.debug("SDNCResponse: " + response)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy
index 3209f52fef..7ea32d2a60 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy
@@ -315,7 +315,7 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
logger.debug("workflowException: " + workflowException)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
String sdncResponse = response
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy
index a54d90b2bf..2558f7eff5 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy
@@ -691,7 +691,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
WorkflowException workflowException = execution.getVariable("WorkflowException")
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
// reset variable
String deleteSDNCResponseDecodeXml = execution.getVariable(Prefix + "deleteSDNCResponse")
@@ -719,7 +719,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
WorkflowException workflowException = execution.getVariable("WorkflowException")
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
// reset variable
String assignSDNCResponseDecodeXml = execution.getVariable(Prefix + "deactivateSDNCResponse")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy
index d09fb03445..36c145b0e0 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy
@@ -220,7 +220,7 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
rollbackSDNCReturnCode = execution.getVariable(Prefix + "rollbackSDNCReturnCode")
String rollbackSDNCResponse = execution.getVariable(Prefix + "rollbackSDNCResponse")
String rollbackSDNCReturnInnerCode = ""
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
rollbackSDNCResponse = rollbackSDNCResponse.replace('$', '').replace('<?xml version="1.0" encoding="UTF-8"?>', "")
if (rollbackSDNCReturnCode == "200") {
if (utils.nodeExists(rollbackSDNCResponse, "response-code")) {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy
index 2e1cca54a6..0c676b5589 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy
@@ -258,7 +258,7 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
logger.debug("SDNCResponse: " + response)
logger.debug("workflowException: " + workflowException)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy
index bedf5e0948..b21dcf3433 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy
@@ -111,6 +111,8 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
execution.setVariable("tenantId", tenantId)
String cloudSiteId = jsonUtil.getJsonValue(cloudConfiguration, "lcpCloudRegionId")
execution.setVariable("cloudSiteId", cloudSiteId)
+ String cloudOwner = jsonUtil.getJsonValue(cloudConfiguration, "cloudOwner")
+ execution.setVariable("cloudOwner", cloudOwner)
// Source is HARDCODED
String source = "VID"
execution.setVariable("source", source)
@@ -176,6 +178,8 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
execution.setVariable("vfModuleModelName", vfModuleModelName)
String cloudSiteId = utils.getNodeText(xml, "aic-cloud-region")
execution.setVariable("cloudSiteId", cloudSiteId)
+ String cloudOwner = utils.getNodeText(xml, "cloud-owner")
+ execution.setVariable("cloudOwner", cloudOwner)
}
// formulate the request for PrepareUpdateAAIVfModule
@@ -281,6 +285,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
def origRequestId = execution.getVariable('requestId')
def srvInstId = execution.getVariable("serviceInstanceId")
def aicCloudRegion = execution.getVariable("cloudSiteId")
+ def cloudOwner = execution.getVariable("cloudOwner")
def vnfId = execution.getVariable("vnfId")
def vfModuleId = execution.getVariable("vfModuleId")
def vfModuleStackId = execution.getVariable('DoDVfMod_heatStackId')
@@ -296,6 +301,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
String request = """
<deleteVfModuleRequest>
<cloudSiteId>${MsoUtils.xmlEscape(aicCloudRegion)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId>
<vfModuleId>${MsoUtils.xmlEscape(vfModuleId)}</vfModuleId>
@@ -369,7 +375,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
WorkflowException workflowException = execution.getVariable("WorkflowException")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
@@ -615,8 +621,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
logger.debug("Received orchestration status from A&AI: " + orchestrationStatus)
}
} catch (Exception ex) {
- ex.printStackTrace()
- logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
+ logger.debug('Exception occurred while executing AAI GET: {}', ex.getMessage(), ex)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
}
logger.trace('Exited ' + method)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy
index 3be52f50f7..e5306c40de 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy
@@ -50,7 +50,7 @@ import org.slf4j.LoggerFactory
public class DoDeleteVfModuleFromVnf extends VfModuleBase {
private static final Logger logger = LoggerFactory.getLogger( DoDeleteVfModuleFromVnf.class);
-
+
def Prefix="DDVFMV_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
@@ -66,7 +66,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
initProcessVariables(execution)
try {
-
+
// Building Block-type request
// Set mso-request-id to request-id for VNF Adapter interface
@@ -75,10 +75,13 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
execution.setVariable("requestId", requestId)
logger.debug("msoRequestId: " + requestId)
String tenantId = execution.getVariable("tenantId")
- logger.debug("tenantId: " + tenantId)
+ logger.debug("tenantId: " + tenantId)
String cloudSiteId = execution.getVariable("lcpCloudRegionId")
execution.setVariable("cloudSiteId", cloudSiteId)
logger.debug("cloudSiteId: " + cloudSiteId)
+ String cloudOwner = execution.getVariable("cloudOwner")
+ execution.setVariable("cloudOwner", cloudOwner)
+ logger.debug("cloudOwner: " + cloudOwner)
// Source is HARDCODED
String source = "VID"
execution.setVariable("source", source)
@@ -99,15 +102,15 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
}
else {
execution.setVariable(Prefix + "serviceInstanceIdToSdnc", serviceInstanceId)
- }
+ }
String sdncVersion = execution.getVariable("sdncVersion")
if (sdncVersion == null) {
sdncVersion = "1707"
}
execution.setVariable(Prefix + "sdncVersion", sdncVersion)
- logger.debug("Incoming Sdnc Version is: " + sdncVersion)
-
+ logger.debug("Incoming Sdnc Version is: " + sdncVersion)
+
String sdncCallbackUrl = (String) UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution)
if (sdncCallbackUrl == null || sdncCallbackUrl.trim().isEmpty()) {
def msg = 'Required variable \'mso.workflow.sdncadapter.callback\' is missing'
@@ -119,8 +122,6 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
logger.debug("SDNC Callback URL: " + sdncCallbackUrl)
logger.debug("SDNC Callback URL is: " + sdncCallbackUrl)
-
-
}catch(BpmnError b){
throw b
}catch(Exception e){
@@ -128,7 +129,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error encountered in PreProcess method!")
}
}
-
+
public void queryAAIForVfModule(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.queryAAIForVfModule(' +
'execution=' + execution.getId() +
@@ -151,8 +152,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
execution.setVariable('DDVMFV_getVnfResponse', "Generic Vnf not found!")
}
} catch (Exception ex) {
- ex.printStackTrace()
- logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
+ logger.debug('Exception occurred while executing AAI GET: {}', ex.getMessage(), ex)
execution.setVariable('DDVMFV_getVnfResponseCode', 500)
execution.setVariable('DDVFMV_getVnfResponse', 'AAI GET Failed:' + ex.getMessage())
}
@@ -166,7 +166,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIForVfModule(): ' + e.getMessage())
}
}
-
+
/**
* Validate the VF Module. That is, confirm that a VF Module with the input VF Module ID
* exists in the retrieved Generic VNF. Then, check to make sure that if that VF Module
@@ -339,7 +339,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
logger.debug("workflowException: " + workflowException)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
logger.debug("SDNCResponse: " + response)
@@ -363,6 +363,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
def origRequestId = execution.getVariable('requestId')
def srvInstId = execution.getVariable("serviceInstanceId")
def aicCloudRegion = execution.getVariable("cloudSiteId")
+ def cloudOwner = execution.getVariable("cloudOwner")
def vnfId = execution.getVariable("vnfId")
def vfModuleId = execution.getVariable("vfModuleId")
def vfModuleStackId = execution.getVariable('DDVMFV_heatStackId')
@@ -378,6 +379,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
String request = """
<deleteVfModuleRequest>
<cloudSiteId>${MsoUtils.xmlEscape(aicCloudRegion)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId>
<vfModuleId>${MsoUtils.xmlEscape(vfModuleId)}</vfModuleId>
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy
index 787b582808..c419f0dc7d 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy
@@ -170,7 +170,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor{
execution.setVariable(prefix+'volumeGroupHeatStackId', heatStackId)
logger.debug('Heat stack id from AAI response: ' + heatStackId)
- AAIResultWrapper wrapper = getAAIClient().get(uri);
+ AAIResultWrapper wrapper = getAAIClient().get(resourceUri);
Optional<Relationships> relationships = wrapper.getRelationships()
String volumeGroupTenantId = null
@@ -217,6 +217,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor{
*/
public void prepareVnfAdapterDeleteRequest(DelegateExecution execution, isDebugLogEnabled) {
def cloudRegion = execution.getVariable(prefix+'aicCloudRegion')
+ def cloudOwner = execution.getVariable(prefix+'cloudOwner')
def tenantId = execution.getVariable('tenantId') // input parameter (optional) - see preProcessRequest
def volumeGroupId = execution.getVariable('volumeGroupId') // input parameter (required)
def volumeGroupHeatStackId = execution.getVariable(prefix+'volumeGroupHeatStackId') // from AAI query volume group
@@ -233,6 +234,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor{
String vnfAdapterRestRequest = """
<deleteVolumeGroupRequest>
<cloudSiteId>${MsoUtils.xmlEscape(cloudRegion)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<volumeGroupId>${MsoUtils.xmlEscape(volumeGroupId)}</volumeGroupId>
<volumeGroupStackId>${MsoUtils.xmlEscape(volumeGroupHeatStackId)}</volumeGroupStackId>
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy
index fb62babae9..9bd3388b79 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy
@@ -60,7 +60,7 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
VidUtils vidUtils = new VidUtils(this)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
/**
* This method gets and validates the incoming
@@ -322,7 +322,7 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
}
if (vfModuleBaseEntry != null) {
vfModulesList.add(vfModuleBaseEntry)
- }
+ }
}
}else{
execution.setVariable('DCVFM_queryAAIVfModuleResponseCode', 404)
@@ -331,8 +331,7 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
}
execution.setVariable("DDVAM_vfModules", vfModulesList)
} catch (Exception ex) {
- ex.printStackTrace()
- logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
+ logger.debug('Exception occurred while executing AAI GET: {}', ex.getMessage(), ex)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
}
logger.trace('Exited ' + method)
@@ -501,7 +500,7 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
logger.debug("workflowException: " + workflowException)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
logger.debug("SDNCResponse: " + response)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy
index 4fe30803c4..508131279a 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy
@@ -195,7 +195,6 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_initResOperStatusRequest", payload)
logger.info( "Outgoing initResourceOperationStatus: \n" + payload)
- utils.logAudit("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)
}catch(Exception e){
logger.info( "Exception Occured Processing preInitResourcesOperStatus. Exception is:\n" + e)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy
index ce61595680..6162780b27 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy
@@ -782,7 +782,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
String source = execution.getVariable(Prefix + "source")
String requestInput = execution.getVariable(Prefix + "networkRequest")
- String queryIdResponse = execution.getVariable(Prefix + "requeryIdAAIResponse")
+ L3Network queryIdResponse = execution.getVariable(Prefix + "requeryIdAAIResponse")
String cloudRegionId = execution.getVariable(Prefix + "cloudRegionPo")
String backoutOnFailure = execution.getVariable(Prefix + "rollbackEnabled")
@@ -946,7 +946,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
// reset variable
String changeAssignSDNCResponseDecodeXml = execution.getVariable(Prefix + "changeAssignSDNCResponse")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollback.groovy
index 1b98451fbe..371e54ca75 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollback.groovy
@@ -204,7 +204,7 @@ public class DoUpdateNetworkInstanceRollback extends AbstractServiceTaskProcesso
rollbackSDNCReturnCode = execution.getVariable(Prefix + "rollbackSDNCReturnCode")
String rollbackSDNCResponse = execution.getVariable(Prefix + "rollbackSDNCResponse")
String rollbackSDNCReturnInnerCode = ""
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
rollbackSDNCResponse = rollbackSDNCResponse.replace('$', '').replace('<?xml version="1.0" encoding="UTF-8"?>', "")
if (rollbackSDNCReturnCode == "200") {
if (utils.nodeExists(rollbackSDNCResponse, "response-code")) {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModule.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModule.groovy
index a17dc9d7fe..abbcf66323 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModule.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModule.groovy
@@ -143,6 +143,12 @@ public class DoUpdateVfModule extends VfModuleBase {
execution.setVariable("DOUPVfMod_aicCloudRegion", cloudSiteId)
logger.debug("cloudSiteId: " + cloudSiteId)
+
+ //cloudOwner
+ def cloudOwner = execution.getVariable("cloudOwner")
+ execution.setVariable("DOUPVfMod_cloudOwner", cloudOwner)
+ logger.debug("cloudOwner: " + cloudOwner)
+
//vnfType
def vnfType = execution.getVariable("vnfType")
execution.setVariable("DOUPVfMod_vnfType", vnfType)
@@ -304,6 +310,7 @@ public class DoUpdateVfModule extends VfModuleBase {
execution.setVariable('DOUPVfMod_modelCustomizationUuid', getNodeTextForce(vnfInputs, 'model-customization-id'))
execution.setVariable('DOUPVfMod_serviceId', getRequiredNodeText(execution, vnfInputs, 'service-id'))
execution.setVariable('DOUPVfMod_aicCloudRegion', getRequiredNodeText(execution, vnfInputs, 'aic-cloud-region'))
+ execution.setVariable('DOUPVfMod_cloudOwner', getRequiredNodeText(execution, vnfInputs, 'cloud-owner'))
execution.setVariable('DOUPVfMod_tenantId', getRequiredNodeText(execution, vnfInputs, 'tenant-id'))
//isBaseVfModule
def isBaseVfModule = "false"
@@ -640,6 +647,7 @@ public class DoUpdateVfModule extends VfModuleBase {
heatStackId = vfModule.getHeatStackId()
}
def cloudId = execution.getVariable('DOUPVfMod_aicCloudRegion')
+ def cloudOwner = execution.getVariable('DOUPVfMod_cloudOwner')
def vnfType = execution.getVariable('DOUPVfMod_vnfType')
def vnfName = execution.getVariable('DOUPVfMod_vnfName')
def vfModuleModelName = execution.getVariable('DOUPVfMod_vfModuleModelName')
@@ -672,6 +680,7 @@ public class DoUpdateVfModule extends VfModuleBase {
String vnfAdapterRestRequest = """
<updateVfModuleRequest>
<cloudSiteId>${MsoUtils.xmlEscape(cloudId)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId>
<vfModuleId>${MsoUtils.xmlEscape(vfModuleId)}</vfModuleId>
@@ -979,7 +988,7 @@ public class DoUpdateVfModule extends VfModuleBase {
logger.debug("workflowException: " + workflowException)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
logger.debug("SDNCResponse: " + response)
@@ -1032,8 +1041,7 @@ public class DoUpdateVfModule extends VfModuleBase {
}
}
} catch (Exception ex) {
- ex.printStackTrace()
- logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
+ logger.debug('Exception occurred while executing AAI GET: {}', ex.getMessage(), ex)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
}
logger.trace('Exited ' + method)
@@ -1042,7 +1050,7 @@ public class DoUpdateVfModule extends VfModuleBase {
} catch (Exception e) {
logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
'Caught exception in ' + method, "BPMN",
- ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
+ ErrorCode.UnknownError.getValue(), "Exception is:\n" + e, e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIVfModule(): ' + e.getMessage())
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy
index 3dd5e61246..eb788a85b7 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy
@@ -265,8 +265,7 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
}
execution.setVariable("DUVAM_vfModules", vfModulesList)
} catch (Exception ex) {
- ex.printStackTrace()
- logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
+ logger.debug('Exception occurred while executing AAI GET: {}', ex.getMessage(), ex)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
}
logger.trace('Exited ' + method)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy
index 4e3517e5b5..8e554e286d 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy
@@ -72,7 +72,6 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
try {
String siRequest = execution.getVariable("bpmnRequest")
- utils.logAudit(siRequest)
String requestId = execution.getVariable("mso-request-id")
execution.setVariable("msoRequestId", requestId)
@@ -190,6 +189,7 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
JSONObject ob = new JSONObject(wrapper.getJson())
JSONArray ar = ob.getJSONObject("relationship-list").getJSONArray("relationship")
+ execution.setVariable("serviceInstanceData-original", si.get())
execution.setVariable("serviceRelationShip", ar.toString())
@@ -277,7 +277,6 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)
logger.error( "Outgoing updateServiceOperStatusRequest: \n" + payload)
- utils.logAudit("CreateVfModuleInfra Outgoing updateServiceOperStatusRequest Request: " + payload)
}catch(Exception e){
logger.debug( "Exception Occured Processing prepareInitServiceOperationStatus. Exception is:\n" + e)
@@ -398,7 +397,6 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
<aetgt:ErrorCode>${MsoUtils.xmlEscape(errorCode)}</aetgt:ErrorCode>
</aetgt:WorkflowException>"""
- utils.logAudit(buildworkflowException)
sendWorkflowResponse(execution, 500, buildworkflowException)
} catch (Exception ex) {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstance.groovy
index 0b46a5a849..b12da9f959 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstance.groovy
@@ -362,7 +362,7 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
} catch (Exception ex) {
String errorException = " Bpmn error encountered in UpdateNetworkInstance flow. FalloutHandlerRequest, buildErrorResponse() - "
- logger.debug("Exception error in UpdateNetworkInstance flow, buildErrorResponse(): " + ex.getMessage())
+ logger.debug("Exception error in UpdateNetworkInstance flow, buildErrorResponse(): {}", ex.getMessage(), ex)
falloutHandlerRequest =
"""<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
xmlns:ns="http://org.onap/so/request/types/v1"
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy
index 0c3294778a..3e9b934a2e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy
@@ -100,6 +100,7 @@ class UpdateVfModuleVolume extends VfModuleBase {
execution.setVariable('UPDVfModVol_vnfType', getRequiredNodeText(execution, volumeInputs, 'vnf-type'))
execution.setVariable('UPDVfModVol_serviceId', getRequiredNodeText(execution, volumeInputs, 'service-id'))
execution.setVariable('UPDVfModVol_aicCloudRegion', getRequiredNodeText(execution, volumeInputs, 'aic-cloud-region'))
+ execution.setVariable('UPDVfModVol_cloudOwner', getRequiredNodeText(execution, volumeInputs, 'cloud-owner'))
execution.setVariable('UPDVfModVol_tenantId', getRequiredNodeText(execution, volumeInputs, 'tenant-id'))
def volumeParams = utils.getNodeXml(request, 'volume-params')
@@ -255,6 +256,7 @@ class UpdateVfModuleVolume extends VfModuleBase {
String vnfAdapterRestRequest = """
<updateVolumeGroupRequest>
<cloudSiteId>${MsoUtils.xmlEscape(aicCloudRegion)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<volumeGroupId>${MsoUtils.xmlEscape(volumeGroupId)}</volumeGroupId>
<volumeGroupStackId>${MsoUtils.xmlEscape(volumeGroupHeatStackId)}</volumeGroupStackId>
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy
index 361d6a2173..0344206145 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy
@@ -135,6 +135,7 @@ class UpdateVfModuleVolumeInfraV1 extends VfModuleBase {
execution.setVariable('UPDVfModVol_vnfVersion', getRequiredNodeText(execution, volumeInputs, 'asdc-service-model-version'))
execution.setVariable('UPDVfModVol_serviceId', utils.getNodeText(volumeInputs, 'service-id'))
execution.setVariable('UPDVfModVol_aicCloudRegion', getRequiredNodeText(execution, volumeInputs, 'aic-cloud-region'))
+ execution.setVariable('UPDVfModVol_cloudRegion', getRequiredNodeText(execution, volumeInputs, 'cloud-owner'))
execution.setVariable('UPDVfModVol_tenantId', getRequiredNodeText(execution, volumeInputs, 'tenant-id'))
//execution.setVariable('UPDVfModVol_modelCustomizationId', getRequiredNodeText(execution, volumeInputs, 'model-customization-id'))
@@ -296,6 +297,7 @@ class UpdateVfModuleVolumeInfraV1 extends VfModuleBase {
public void prepVnfAdapterRest(DelegateExecution execution, isDebugLogEnabled) {
def aicCloudRegion = execution.getVariable('UPDVfModVol_aicCloudRegion')
+ def cloudOwner = execution.getVariable("UPDVfModVol_cloudRegion")
def tenantId = execution.getVariable('UPDVfModVol_tenantId')
def volumeGroupId = execution.getVariable('UPDVfModVol_volumeGroupId')
@@ -328,6 +330,7 @@ class UpdateVfModuleVolumeInfraV1 extends VfModuleBase {
String vnfAdapterRestRequest = """
<updateVolumeGroupRequest>
<cloudSiteId>${MsoUtils.xmlEscape(aicCloudRegion)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId>
<vnfName>${MsoUtils.xmlEscape(vnfName)}</vnfName>
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy
index 24589a0893..2c5b6430e6 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy
@@ -511,7 +511,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
logger.debug("SDNCResponse: " + response)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy
index f27b3d94b1..58c0ef2dcf 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy
@@ -167,7 +167,7 @@ public class DoCreateAllottedResourceBRGRollback extends AbstractServiceTaskProc
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
logger.debug("SDNCResponse: " + response)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy
index b6e7470834..61dd13b4e2 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy
@@ -446,7 +446,7 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
logger.debug("SDNCResponse: " + response)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy
index ad2c9e155d..44e27d99cf 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy
@@ -168,7 +168,7 @@ public class DoCreateAllottedResourceTXCRollback extends AbstractServiceTaskProc
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
logger.debug("SDNCResponse: " + response)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy
index ca1b2ded2a..9dcee3dfb2 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy
@@ -302,7 +302,7 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
logger.debug("SDNCResponse: " + response)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy
index 0da6fd26f4..43e095859e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy
@@ -306,7 +306,7 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
logger.debug("SDNCResponse: " + response)
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java
index a47b16fc33..d401522800 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java
@@ -23,7 +23,6 @@ package org.onap.so.bpmn.infrastructure.aai;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
-
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.AAIResourcesClient;
@@ -34,57 +33,64 @@ import org.onap.so.client.aai.entities.uri.AAIUriFactory;
public class AAICreateResources extends AAIResource {
- public void createAAIProject (String projectName, String serviceInstance){
- AAIResourceUri projectURI = AAIUriFactory.createResourceUri(AAIObjectType.PROJECT, projectName);
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
- getAaiClient().createIfNotExists(projectURI, Optional.empty()).connect(projectURI, serviceInstanceURI);
-
- }
-
- public void createAAIOwningEntity(String owningEntityId, String owningEntityName,String serviceInstance){
- AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
- Map<String, String> hashMap= new HashMap<>();
- hashMap.put("owning-entity-name", owningEntityName);
- getAaiClient().createIfNotExists(owningEntityURI, Optional.of(hashMap)).connect(owningEntityURI, serviceInstanceURI);
- }
+ public void createAAIProject(String projectName, String serviceInstance) {
+ AAIResourceUri projectURI = AAIUriFactory.createResourceUri(AAIObjectType.PROJECT, projectName);
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ getAaiClient().createIfNotExists(projectURI, Optional.empty()).connect(projectURI, serviceInstanceURI);
+
+ }
+
+ public void createAAIOwningEntity(String owningEntityId, String owningEntityName, String serviceInstance) {
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ Map<String, String> hashMap = new HashMap<>();
+ hashMap.put("owning-entity-name", owningEntityName);
+ getAaiClient().createIfNotExists(owningEntityURI, Optional.of(hashMap)).connect(owningEntityURI,
+ serviceInstanceURI);
+ }
+
+ public boolean existsOwningEntity(String owningEntityId) {
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ return getAaiClient().exists(owningEntityURI);
+ }
+
+ public void connectOwningEntityandServiceInstance(String owningEntityId, String serviceInstance) {
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ getAaiClient().connect(owningEntityURI, serviceInstanceURI);
+ }
+
+ public void createAAIPlatform(String platformName, String vnfId) {
+ AAIResourceUri platformURI = AAIUriFactory.createResourceUri(AAIObjectType.PLATFORM, platformName);
+ AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
+ getAaiClient().createIfNotExists(platformURI, Optional.empty()).connect(platformURI, genericVnfURI);
+ }
+
+ public void createAAILineOfBusiness(String lineOfBusiness, String vnfId) {
+ AAIResourceUri lineOfBusinessURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.LINE_OF_BUSINESS, lineOfBusiness);
+ AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
+ getAaiClient().createIfNotExists(lineOfBusinessURI, Optional.empty()).connect(lineOfBusinessURI, genericVnfURI);
+ }
+
+ public void createAAIServiceInstance(String globalCustomerId, String serviceType, String serviceInstanceId) {
+ AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
+ globalCustomerId, serviceType, serviceInstanceId);
+ getAaiClient().createIfNotExists(serviceInstanceURI, Optional.empty());
+ }
+
+ public Optional<GenericVnf> getVnfInstance(String vnfId) {
+ try {
+ AAIResourceUri vnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
+ AAIResultWrapper aaiResponse = getAaiClient().get(vnfURI);
+ Optional<GenericVnf> vnf = aaiResponse.asBean(GenericVnf.class);
+ return vnf;
+ } catch (Exception ex) {
+ return Optional.empty();
+ }
+ }
- public boolean existsOwningEntity(String owningEntityId){
- AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
- return getAaiClient().exists(owningEntityURI);
- }
-
- public void connectOwningEntityandServiceInstance (String owningEntityId, String serviceInstance){
- AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
- getAaiClient().connect(owningEntityURI, serviceInstanceURI);
- }
-
- public void createAAIPlatform(String platformName,String vnfId){
- AAIResourceUri platformURI = AAIUriFactory.createResourceUri(AAIObjectType.PLATFORM, platformName);
- AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF,vnfId);
- getAaiClient().createIfNotExists(platformURI, Optional.empty()).connect(platformURI, genericVnfURI);
- }
-
- public void createAAILineOfBusiness(String lineOfBusiness,String vnfId){
- AAIResourceUri lineOfBusinessURI = AAIUriFactory.createResourceUri(AAIObjectType.LINE_OF_BUSINESS, lineOfBusiness);
- AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF,vnfId);
- getAaiClient().createIfNotExists(lineOfBusinessURI, Optional.empty()).connect(lineOfBusinessURI, genericVnfURI);
- }
- public void createAAIServiceInstance(String globalCustomerId, String serviceType, String serviceInstanceId){
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustomerId,serviceType,serviceInstanceId);
- getAaiClient().createIfNotExists(serviceInstanceURI, Optional.empty());
- }
-
- public Optional<GenericVnf> getVnfInstance(String vnfId){
- try{
- AAIResourceUri vnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
- AAIResultWrapper aaiResponse = getAaiClient().get(vnfURI);
- Optional<GenericVnf> vnf = aaiResponse.asBean(GenericVnf.class);
- return vnf;
- } catch (Exception ex){
- return Optional.empty();
- }
- }
-
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java
index cea6fe740d..2526ca5c25 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java
@@ -29,21 +29,23 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.springframework.stereotype.Component;
-public class AAIDeleteServiceInstance extends AAIResource implements JavaDelegate{
+public class AAIDeleteServiceInstance extends AAIResource implements JavaDelegate {
+
+ ExceptionUtil exceptionUtil = new ExceptionUtil();
+
+ public void execute(DelegateExecution execution) throws Exception {
+ try {
+ String serviceInstanceId = (String) execution.getVariable("serviceInstanceId");
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId);
+ getAaiClient().delete(serviceInstanceURI);
+ execution.setVariable("GENDS_SuccessIndicator", true);
+ } catch (Exception ex) {
+ String msg = "Exception in Delete Serivce Instance. Service Instance could not be deleted in AAI."
+ + ex.getMessage();
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
+ }
+
+ }
- ExceptionUtil exceptionUtil = new ExceptionUtil();
- public void execute(DelegateExecution execution) throws Exception {
- try{
- String serviceInstanceId = (String) execution.getVariable("serviceInstanceId");
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
- serviceInstanceId);
- getAaiClient().delete(serviceInstanceURI);
- execution.setVariable("GENDS_SuccessIndicator",true);
- } catch(Exception ex){
- String msg = "Exception in Delete Serivce Instance. Service Instance could not be deleted in AAI." + ex.getMessage();
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
- }
-
- }
-
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIResource.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIResource.java
index 3bc02be476..1410752f76 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIResource.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIResource.java
@@ -24,17 +24,17 @@ import org.onap.so.client.aai.AAIResourcesClient;
import org.springframework.stereotype.Component;
@Component
-public abstract class AAIResource {
- private AAIResourcesClient aaiClient;
+public abstract class AAIResource {
+ private AAIResourcesClient aaiClient;
- public AAIResourcesClient getAaiClient() {
- if(aaiClient == null)
- return new AAIResourcesClient();
- else
- return aaiClient;
- }
+ public AAIResourcesClient getAaiClient() {
+ if (aaiClient == null)
+ return new AAIResourcesClient();
+ else
+ return aaiClient;
+ }
- public void setAaiClient(AAIResourcesClient aaiClient) {
- this.aaiClient = aaiClient;
- }
+ public void setAaiClient(AAIResourcesClient aaiClient) {
+ this.aaiClient = aaiClient;
+ }
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java
index 67ba155336..376ca4dbdb 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java
@@ -21,74 +21,144 @@
package org.onap.so.bpmn.infrastructure.aai;
public class AAIServiceInstance {
- String serviceInstanceName;
- String serviceType;
- String serviceRole;
- String orchestrationStatus;
- String modelInvariantUuid;
- String modelVersionId;
- String environmentContext;
- String workloadContext;
- public AAIServiceInstance(String serviceInstanceName, String serviceType, String serviceRole,
- String orchestrationStatus, String modelInvariantUuid, String modelVersionId, String environmentContext,
- String workloadContext) {
- this.serviceInstanceName = serviceInstanceName;
- this.serviceType = serviceType;
- this.serviceRole = serviceRole;
- this.orchestrationStatus = orchestrationStatus;
- this.modelInvariantUuid = modelInvariantUuid;
- this.modelVersionId = modelVersionId;
- this.environmentContext = environmentContext;
- this.workloadContext = workloadContext;
- }
- public String getServiceInstanceName() {
- return serviceInstanceName;
- }
- public void setServiceInstanceName(String serviceInstanceName) {
- this.serviceInstanceName = serviceInstanceName;
- }
- public String getServiceType() {
- return serviceType;
- }
- public void setServiceType(String serviceType) {
- this.serviceType = serviceType;
- }
- public String getServiceRole() {
- return serviceRole;
- }
- public void setServiceRole(String serviceRole) {
- this.serviceRole = serviceRole;
- }
- public String getOrchestrationStatus() {
- return orchestrationStatus;
- }
- public void setOrchestrationStatus(String orchestrationStatus) {
- this.orchestrationStatus = orchestrationStatus;
- }
- public String getModelInvariantUuid() {
- return modelInvariantUuid;
- }
- public void setModelInvariantUuid(String modelInvariantUuid) {
- this.modelInvariantUuid = modelInvariantUuid;
- }
- public String getModelVersionId() {
- return modelVersionId;
- }
- public void setModelVersionId(String modelVersionId) {
- this.modelVersionId = modelVersionId;
- }
- public String getEnvironmentContext() {
- return environmentContext;
- }
- public void setEnvironmentContext(String environmentContext) {
- this.environmentContext = environmentContext;
- }
- public String getWorkloadContext() {
- return workloadContext;
- }
- public void setWorkloadContext(String workloadContext) {
- this.workloadContext = workloadContext;
- }
-
+ String serviceInstanceName;
+ String serviceType;
+ String serviceRole;
+ String orchestrationStatus;
+ String modelInvariantUuid;
+ String modelVersionId;
+ String environmentContext;
+ String workloadContext;
+
+ public static class AAIServiceInstanceBuilder {
+ private String serviceInstanceName;
+ private String serviceType;
+ private String serviceRole;
+ private String orchestrationStatus;
+ private String modelInvariantUuid;
+ private String modelVersionId;
+ private String environmentContext;
+ private String workloadContext;
+
+ public AAIServiceInstanceBuilder setServiceInstanceName(String serviceInstanceName) {
+ this.serviceInstanceName = serviceInstanceName;
+ return this;
+ }
+
+ public AAIServiceInstanceBuilder setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ return this;
+ }
+
+ public AAIServiceInstanceBuilder setServiceRole(String serviceRole) {
+ this.serviceRole = serviceRole;
+ return this;
+ }
+
+ public AAIServiceInstanceBuilder setOrchestrationStatus(String orchestrationStatus) {
+ this.orchestrationStatus = orchestrationStatus;
+ return this;
+ }
+
+ public AAIServiceInstanceBuilder setModelInvariantUuid(String modelInvariantUuid) {
+ this.modelInvariantUuid = modelInvariantUuid;
+ return this;
+ }
+
+ public AAIServiceInstanceBuilder setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ return this;
+ }
+
+ public AAIServiceInstanceBuilder setEnvironmentContext(String environmentContext) {
+ this.environmentContext = environmentContext;
+ return this;
+ }
+
+ public AAIServiceInstanceBuilder setWorkloadContext(String workloadContext) {
+ this.workloadContext = workloadContext;
+ return this;
+ }
+
+ public AAIServiceInstance createAAIServiceInstance() {
+ return new AAIServiceInstance(this);
+ }
+ }
+
+ public AAIServiceInstance(AAIServiceInstanceBuilder aaiServiceInstanceBuilder) {
+ this.serviceInstanceName = aaiServiceInstanceBuilder.serviceInstanceName;
+ this.serviceType = aaiServiceInstanceBuilder.serviceType;
+ this.serviceRole = aaiServiceInstanceBuilder.serviceRole;
+ this.orchestrationStatus = aaiServiceInstanceBuilder.orchestrationStatus;
+ this.modelInvariantUuid = aaiServiceInstanceBuilder.modelInvariantUuid;
+ this.modelVersionId = aaiServiceInstanceBuilder.modelVersionId;
+ this.environmentContext = aaiServiceInstanceBuilder.environmentContext;
+ this.workloadContext = aaiServiceInstanceBuilder.workloadContext;
+ }
+
+ public String getServiceInstanceName() {
+ return serviceInstanceName;
+ }
+
+ public void setServiceInstanceName(String serviceInstanceName) {
+ this.serviceInstanceName = serviceInstanceName;
+ }
+
+ public String getServiceType() {
+ return serviceType;
+ }
+
+ public void setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ }
+
+ public String getServiceRole() {
+ return serviceRole;
+ }
+
+ public void setServiceRole(String serviceRole) {
+ this.serviceRole = serviceRole;
+ }
+
+ public String getOrchestrationStatus() {
+ return orchestrationStatus;
+ }
+
+ public void setOrchestrationStatus(String orchestrationStatus) {
+ this.orchestrationStatus = orchestrationStatus;
+ }
+
+ public String getModelInvariantUuid() {
+ return modelInvariantUuid;
+ }
+
+ public void setModelInvariantUuid(String modelInvariantUuid) {
+ this.modelInvariantUuid = modelInvariantUuid;
+ }
+
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ public String getEnvironmentContext() {
+ return environmentContext;
+ }
+
+ public void setEnvironmentContext(String environmentContext) {
+ this.environmentContext = environmentContext;
+ }
+
+ public String getWorkloadContext() {
+ return workloadContext;
+ }
+
+ public void setWorkloadContext(String workloadContext) {
+ this.workloadContext = workloadContext;
+ }
+
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAICreateResources.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAICreateResources.java
index 0c519ef29f..bbca10be0f 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAICreateResources.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAICreateResources.java
@@ -25,7 +25,6 @@ package org.onap.so.bpmn.infrastructure.aai.groovyflows;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
-
import org.onap.aai.domain.yang.OwningEntities;
import org.onap.aai.domain.yang.OwningEntity;
import org.onap.so.client.aai.AAIObjectPlurals;
@@ -37,85 +36,88 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class AAICreateResources {
-
- private static final Logger logger = LoggerFactory.getLogger(AAICreateResources.class);
-
- public void createAAIProject (String projectName, String serviceInstance){
- AAIResourceUri projectURI = AAIUriFactory.createResourceUri(AAIObjectType.PROJECT, projectName);
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- aaiRC.createIfNotExists(projectURI, Optional.empty()).connect(projectURI, serviceInstanceURI);
-
- }
-
- public void createAAIOwningEntity(String owningEntityId, String owningEntityName,String serviceInstance){
- AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createNodesUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
- Map<String, String> hashMap= new HashMap<>();
- hashMap.put("owning-entity-name", owningEntityName);
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- aaiRC.createIfNotExists(owningEntityURI, Optional.of(hashMap)).connect(owningEntityURI, serviceInstanceURI);
- }
-
- public boolean existsOwningEntity(String owningEntityId){
- AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- return aaiRC.exists(owningEntityURI);
- }
-
- protected OwningEntities getOwningEntityName(String owningEntityName){
-
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- return aaiRC.get(OwningEntities.class,
- AAIUriFactory
- .createResourceUri(AAIObjectPlurals.OWNING_ENTITY)
- .queryParam("owning-entity-name", owningEntityName))
- .orElseGet(() -> {
- logger.debug("No Owning Entity matched by name");
- return null;
- });
-
- }
-
- public Optional<OwningEntity> getOwningEntityNames(String owningEntityName) throws Exception{
- OwningEntity owningEntity = null;
- OwningEntities owningEntities = null;
- owningEntities = getOwningEntityName(owningEntityName);
-
- if (owningEntities == null) {
- return Optional.empty();
- } else if (owningEntities.getOwningEntity().size() > 1) {
- throw new Exception("Multiple OwningEntities Returned");
- } else {
- owningEntity = owningEntities.getOwningEntity().get(0);
- }
- return Optional.of(owningEntity);
- }
-
- public void connectOwningEntityandServiceInstance (String owningEntityId, String serviceInstance){
- AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- aaiRC.connect(owningEntityURI, serviceInstanceURI);
- }
-
- public void createAAIPlatform(String platformName,String vnfId){
- AAIResourceUri platformURI = AAIUriFactory.createResourceUri(AAIObjectType.PLATFORM, platformName);
- AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF,vnfId);
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- aaiRC.createIfNotExists(platformURI, Optional.empty()).connect(platformURI, genericVnfURI);
- }
-
- public void createAAILineOfBusiness(String lineOfBusiness,String vnfId){
- AAIResourceUri lineOfBusinessURI = AAIUriFactory.createResourceUri(AAIObjectType.LINE_OF_BUSINESS, lineOfBusiness);
- AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF,vnfId);
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- aaiRC.createIfNotExists(lineOfBusinessURI, Optional.empty()).connect(lineOfBusinessURI, genericVnfURI);
- }
- public void createAAIServiceInstance(String globalCustomerId, String serviceType, String serviceInstanceId){
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustomerId,serviceType,serviceInstanceId);
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- aaiRC.createIfNotExists(serviceInstanceURI, Optional.empty());
- }
-
+
+ private static final Logger logger = LoggerFactory.getLogger(AAICreateResources.class);
+
+ public void createAAIProject(String projectName, String serviceInstance) {
+ AAIResourceUri projectURI = AAIUriFactory.createResourceUri(AAIObjectType.PROJECT, projectName);
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.createIfNotExists(projectURI, Optional.empty()).connect(projectURI, serviceInstanceURI);
+
+ }
+
+ public void createAAIOwningEntity(String owningEntityId, String owningEntityName, String serviceInstance) {
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createNodesUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ Map<String, String> hashMap = new HashMap<>();
+ hashMap.put("owning-entity-name", owningEntityName);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.createIfNotExists(owningEntityURI, Optional.of(hashMap)).connect(owningEntityURI, serviceInstanceURI);
+ }
+
+ public boolean existsOwningEntity(String owningEntityId) {
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ return aaiRC.exists(owningEntityURI);
+ }
+
+ protected OwningEntities getOwningEntityName(String owningEntityName) {
+
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ return aaiRC.get(OwningEntities.class, AAIUriFactory.createResourceUri(AAIObjectPlurals.OWNING_ENTITY)
+ .queryParam("owning-entity-name", owningEntityName)).orElseGet(() -> {
+ logger.debug("No Owning Entity matched by name");
+ return null;
+ });
+
+ }
+
+ public Optional<OwningEntity> getOwningEntityNames(String owningEntityName) throws Exception {
+ OwningEntity owningEntity = null;
+ OwningEntities owningEntities = null;
+ owningEntities = getOwningEntityName(owningEntityName);
+
+ if (owningEntities == null) {
+ return Optional.empty();
+ } else if (owningEntities.getOwningEntity().size() > 1) {
+ throw new Exception("Multiple OwningEntities Returned");
+ } else {
+ owningEntity = owningEntities.getOwningEntity().get(0);
+ }
+ return Optional.of(owningEntity);
+ }
+
+ public void connectOwningEntityandServiceInstance(String owningEntityId, String serviceInstance) {
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.connect(owningEntityURI, serviceInstanceURI);
+ }
+
+ public void createAAIPlatform(String platformName, String vnfId) {
+ AAIResourceUri platformURI = AAIUriFactory.createResourceUri(AAIObjectType.PLATFORM, platformName);
+ AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.createIfNotExists(platformURI, Optional.empty()).connect(platformURI, genericVnfURI);
+ }
+
+ public void createAAILineOfBusiness(String lineOfBusiness, String vnfId) {
+ AAIResourceUri lineOfBusinessURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.LINE_OF_BUSINESS, lineOfBusiness);
+ AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.createIfNotExists(lineOfBusinessURI, Optional.empty()).connect(lineOfBusinessURI, genericVnfURI);
+ }
+
+ public void createAAIServiceInstance(String globalCustomerId, String serviceType, String serviceInstanceId) {
+ AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
+ globalCustomerId, serviceType, serviceInstanceId);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.createIfNotExists(serviceInstanceURI, Optional.empty());
+ }
+
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIDeleteServiceInstance.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIDeleteServiceInstance.java
index 495c77255d..fb95ae3993 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIDeleteServiceInstance.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIDeleteServiceInstance.java
@@ -28,22 +28,24 @@ import org.onap.so.client.aai.AAIResourcesClient;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
-public class AAIDeleteServiceInstance implements JavaDelegate{
+public class AAIDeleteServiceInstance implements JavaDelegate {
+
+ ExceptionUtil exceptionUtil = new ExceptionUtil();
+
+ public void execute(DelegateExecution execution) throws Exception {
+ try {
+ String serviceInstanceId = (String) execution.getVariable("serviceInstanceId");
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.delete(serviceInstanceURI);
+ execution.setVariable("GENDS_SuccessIndicator", true);
+ } catch (Exception ex) {
+ String msg = "Exception in Delete Serivce Instance. Service Instance could not be deleted in AAI."
+ + ex.getMessage();
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
+ }
+
+ }
- ExceptionUtil exceptionUtil = new ExceptionUtil();
- public void execute(DelegateExecution execution) throws Exception {
- try{
- String serviceInstanceId = (String) execution.getVariable("serviceInstanceId");
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
- serviceInstanceId);
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- aaiRC.delete(serviceInstanceURI);
- execution.setVariable("GENDS_SuccessIndicator",true);
- } catch(Exception ex){
- String msg = "Exception in Delete Serivce Instance. Service Instance could not be deleted in AAI." + ex.getMessage();
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
- }
-
- }
-
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIServiceInstance.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIServiceInstance.java
index 805ece9de8..2d69351744 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIServiceInstance.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIServiceInstance.java
@@ -21,74 +21,91 @@
package org.onap.so.bpmn.infrastructure.aai.groovyflows;
public class AAIServiceInstance {
- String serviceInstanceName;
- String serviceType;
- String serviceRole;
- String orchestrationStatus;
- String modelInvariantUuid;
- String modelVersionId;
- String environmentContext;
- String workloadContext;
- public AAIServiceInstance(String serviceInstanceName, String serviceType, String serviceRole,
- String orchestrationStatus, String modelInvariantUuid, String modelVersionId, String environmentContext,
- String workloadContext) {
- this.serviceInstanceName = serviceInstanceName;
- this.serviceType = serviceType;
- this.serviceRole = serviceRole;
- this.orchestrationStatus = orchestrationStatus;
- this.modelInvariantUuid = modelInvariantUuid;
- this.modelVersionId = modelVersionId;
- this.environmentContext = environmentContext;
- this.workloadContext = workloadContext;
- }
- public String getServiceInstanceName() {
- return serviceInstanceName;
- }
- public void setServiceInstanceName(String serviceInstanceName) {
- this.serviceInstanceName = serviceInstanceName;
- }
- public String getServiceType() {
- return serviceType;
- }
- public void setServiceType(String serviceType) {
- this.serviceType = serviceType;
- }
- public String getServiceRole() {
- return serviceRole;
- }
- public void setServiceRole(String serviceRole) {
- this.serviceRole = serviceRole;
- }
- public String getOrchestrationStatus() {
- return orchestrationStatus;
- }
- public void setOrchestrationStatus(String orchestrationStatus) {
- this.orchestrationStatus = orchestrationStatus;
- }
- public String getModelInvariantUuid() {
- return modelInvariantUuid;
- }
- public void setModelInvariantUuid(String modelInvariantUuid) {
- this.modelInvariantUuid = modelInvariantUuid;
- }
- public String getModelVersionId() {
- return modelVersionId;
- }
- public void setModelVersionId(String modelVersionId) {
- this.modelVersionId = modelVersionId;
- }
- public String getEnvironmentContext() {
- return environmentContext;
- }
- public void setEnvironmentContext(String environmentContext) {
- this.environmentContext = environmentContext;
- }
- public String getWorkloadContext() {
- return workloadContext;
- }
- public void setWorkloadContext(String workloadContext) {
- this.workloadContext = workloadContext;
- }
-
+ String serviceInstanceName;
+ String serviceType;
+ String serviceRole;
+ String orchestrationStatus;
+ String modelInvariantUuid;
+ String modelVersionId;
+ String environmentContext;
+ String workloadContext;
+
+ public AAIServiceInstance(String serviceInstanceName, String serviceType, String serviceRole,
+ String orchestrationStatus, String modelInvariantUuid, String modelVersionId, String environmentContext,
+ String workloadContext) {
+ this.serviceInstanceName = serviceInstanceName;
+ this.serviceType = serviceType;
+ this.serviceRole = serviceRole;
+ this.orchestrationStatus = orchestrationStatus;
+ this.modelInvariantUuid = modelInvariantUuid;
+ this.modelVersionId = modelVersionId;
+ this.environmentContext = environmentContext;
+ this.workloadContext = workloadContext;
+ }
+
+ public String getServiceInstanceName() {
+ return serviceInstanceName;
+ }
+
+ public void setServiceInstanceName(String serviceInstanceName) {
+ this.serviceInstanceName = serviceInstanceName;
+ }
+
+ public String getServiceType() {
+ return serviceType;
+ }
+
+ public void setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ }
+
+ public String getServiceRole() {
+ return serviceRole;
+ }
+
+ public void setServiceRole(String serviceRole) {
+ this.serviceRole = serviceRole;
+ }
+
+ public String getOrchestrationStatus() {
+ return orchestrationStatus;
+ }
+
+ public void setOrchestrationStatus(String orchestrationStatus) {
+ this.orchestrationStatus = orchestrationStatus;
+ }
+
+ public String getModelInvariantUuid() {
+ return modelInvariantUuid;
+ }
+
+ public void setModelInvariantUuid(String modelInvariantUuid) {
+ this.modelInvariantUuid = modelInvariantUuid;
+ }
+
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ public String getEnvironmentContext() {
+ return environmentContext;
+ }
+
+ public void setEnvironmentContext(String environmentContext) {
+ this.environmentContext = environmentContext;
+ }
+
+ public String getWorkloadContext() {
+ return workloadContext;
+ }
+
+ public void setWorkloadContext(String workloadContext) {
+ this.workloadContext = workloadContext;
+ }
+
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGenerator.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGenerator.java
index 3b443cbaf2..55387d6a3d 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGenerator.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGenerator.java
@@ -27,14 +27,15 @@ import org.springframework.stereotype.Component;
@Component
public class AAIObjectInstanceNameGenerator {
- public String generateInstanceGroupName(InstanceGroup instanceGroup, GenericVnf vnf) {
- if(vnf.getVnfName() != null && instanceGroup.getModelInfoInstanceGroup().getFunction() != null) {
- return vnf.getVnfName() + "_" + instanceGroup.getModelInfoInstanceGroup().getFunction();
- } else {
- throw new IllegalArgumentException("Cannot generate instance group name because either one or both fields are null: "
- + " Vnf Instance Name: " + vnf.getVnfName()
- + ", Instance Group Function: " + instanceGroup.getModelInfoInstanceGroup().getFunction());
- }
- }
-
+ public String generateInstanceGroupName(InstanceGroup instanceGroup, GenericVnf vnf) {
+ if (vnf.getVnfName() != null && instanceGroup.getModelInfoInstanceGroup().getFunction() != null) {
+ return vnf.getVnfName() + "_" + instanceGroup.getModelInfoInstanceGroup().getFunction();
+ } else {
+ throw new IllegalArgumentException(
+ "Cannot generate instance group name because either one or both fields are null: "
+ + " Vnf Instance Name: " + vnf.getVnfName() + ", Instance Group Function: "
+ + instanceGroup.getModelInfoInstanceGroup().getFunction());
+ }
+ }
+
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/PnfNotificationEvent.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/PnfNotificationEvent.java
new file mode 100644
index 0000000000..267ddbf6a7
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/PnfNotificationEvent.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.pnf;
+
+import org.springframework.context.ApplicationEvent;
+
+public class PnfNotificationEvent extends ApplicationEvent {
+
+ private String pnfCorrelationId;
+
+ /**
+ * Create a new ApplicationEvent.
+ *
+ * @param source the object on which the event initially occurred (never {@code null})
+ */
+ public PnfNotificationEvent(Object source, String pnfCorrelationId) {
+ super(source);
+ this.pnfCorrelationId = pnfCorrelationId;
+ }
+
+ public String getPnfCorrelationId() {
+ return pnfCorrelationId;
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java
index e0fa41b7a1..493340c9ef 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegate.java
@@ -22,9 +22,7 @@ package org.onap.so.bpmn.infrastructure.pnf.delegate;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.AAI_CONTAINS_INFO_ABOUT_PNF;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
-
import java.io.IOException;
-
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.onap.so.bpmn.common.scripts.ExceptionUtil;
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java
new file mode 100644
index 0000000000..d67e6ef0db
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegate.java
@@ -0,0 +1,90 @@
+/*
+ * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix
+ * Foundation. ================================================================================ Licensed under the
+ * Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may
+ * obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific language governing permissions and limitations under the
+ * License.
+ *
+ * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.pnf.delegate;
+
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.MODEL_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_BLUEPRINT_NAME;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_BLUEPRINT_VERSION;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_CUSTOMIZATION_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_INSTANCE_NAME;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_MODEL_INFO;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SKIP_POST_INSTANTIATION_CONFIGURATION;
+import java.util.List;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.onap.so.bpmn.core.json.JsonUtils;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.db.catalog.beans.PnfResourceCustomization;
+import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * This implementation of {@link JavaDelegate} is used to check the SO catalogdb for PNF config flag.
+ *
+ * It queries the PNF resource customization table for the skip_post_instantiation_configuration for required PNF model
+ * UUID.
+ */
+@Component
+public class ConfigCheckerDelegate implements JavaDelegate {
+
+ private Logger logger = LoggerFactory.getLogger(ConfigCheckerDelegate.class);
+
+ // ERROR CODE for variable not found in the delegation Context
+ private static int ERROR_CODE = 601;
+
+ @Autowired
+ protected ExceptionBuilder exceptionUtil;
+
+ @Autowired
+ protected CatalogDbClient catalogDbClient;
+
+ @Override
+ public void execute(DelegateExecution delegateExecution) throws Exception {
+
+ logger.debug("Running execute block for activity id:{}, name:{}", delegateExecution.getCurrentActivityId(),
+ delegateExecution.getCurrentActivityName());
+
+ if (delegateExecution.hasVariable(SERVICE_MODEL_INFO)) {
+ String serviceModelInfo = (String) delegateExecution.getVariable(SERVICE_MODEL_INFO);
+ String serviceModelUuid = JsonUtils.getJsonValue(serviceModelInfo, MODEL_UUID);
+ delegateExecution.setVariable(MODEL_UUID, serviceModelUuid);
+ List<PnfResourceCustomization> pnfCustomizations =
+ catalogDbClient.getPnfResourceCustomizationByModelUuid(serviceModelUuid);
+ if (pnfCustomizations != null && pnfCustomizations.size() >= 1) {
+ PnfResourceCustomization pnfResourceCustomization = pnfCustomizations.get(0);
+ boolean skipPostInstantiationConfiguration = pnfResourceCustomization.isSkipPostInstConf();
+ delegateExecution.setVariable(SKIP_POST_INSTANTIATION_CONFIGURATION,
+ skipPostInstantiationConfiguration);
+ delegateExecution.setVariable(PRC_BLUEPRINT_NAME, pnfResourceCustomization.getBlueprintName());
+ delegateExecution.setVariable(PRC_BLUEPRINT_VERSION, pnfResourceCustomization.getBlueprintVersion());
+ delegateExecution.setVariable(PRC_CUSTOMIZATION_UUID,
+ pnfResourceCustomization.getModelCustomizationUUID());
+ delegateExecution.setVariable(PRC_INSTANCE_NAME, pnfResourceCustomization.getModelInstanceName());
+ } else {
+ logger.warn("Unable to find the PNF resource customizations of model service UUID: {}",
+ serviceModelUuid);
+ exceptionUtil.buildAndThrowWorkflowException(delegateExecution, ERROR_CODE,
+ "Unable to find the PNF resource customizations of model service UUID: " + serviceModelUuid);
+ }
+ } else {
+ logger.warn("Unable to find the parameter: {} in the execution context", SERVICE_MODEL_INFO);
+ exceptionUtil.buildAndThrowWorkflowException(delegateExecution, ERROR_CODE,
+ "Unable to find parameter " + SERVICE_MODEL_INFO);
+ }
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegate.java
index e56cb83119..cb06085ee8 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegate.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegate.java
@@ -24,7 +24,6 @@ package org.onap.so.bpmn.infrastructure.pnf.delegate;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
-
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.onap.aai.domain.yang.Pnf;
@@ -37,9 +36,7 @@ import org.springframework.stereotype.Component;
/**
* Implementation of "Create Pnf entry in AAI" task in CreateAndActivatePnfResource.bpmn
*
- * Inputs:
- * - pnfCorrelationId - String
- * - pnfUuid - String
+ * Inputs: - pnfCorrelationId - String - pnfUuid - String
*/
@Component
public class CreatePnfEntryInAaiDelegate implements JavaDelegate {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java
index a367bada02..6d73b61ab2 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java
@@ -51,8 +51,8 @@ public class CreateRelation implements JavaDelegate {
new ExceptionUtil().buildAndThrowWorkflowException(delegateExecution, 9999,
"An exception occurred when making service and pnf relation. Exception: " + e.getMessage());
}
- logger.debug("The relation has been made between service with id: {} and pnf with name: {}",
- serviceInstanceId, pnfName);
+ logger.debug("The relation has been made between service with id: {} and pnf with name: {}", serviceInstanceId,
+ pnfName);
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java
index 7d449e72a8..c16175b8e2 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java
@@ -34,4 +34,26 @@ public class ExecutionVariableNames {
public final static String TIMEOUT_FOR_NOTIFICATION = "timeoutForPnfEntryNotification";
public final static String PNF_UUID = "pnfUuid";
public final static String SERVICE_INSTANCE_ID = "serviceInstanceId";
+ public final static String MSO_REQUEST_ID = "msoRequestId";
+ public final static String MODEL_UUID = "modelUuid";
+
+ public final static String SERVICE_MODEL_INFO = "serviceModelInfo";
+
+ /**
+ * Variable used to contain the {@link org.onap.so.client.cds.beans.AbstractCDSPropertiesBean} json value.
+ */
+ public static final String EXECUTION_OBJECT = "executionObject";
+
+ /**
+ * Variables used to contain the {@link org.onap.so.db.catalog.beans.PnfResourceCustomization} fields.
+ */
+ public static final String PRC_BLUEPRINT_NAME = "PRC_blueprintName";
+ public static final String PRC_BLUEPRINT_VERSION = "PRC_blueprintVersion";
+ public static final String PRC_CUSTOMIZATION_UUID = "PRC_customizationUuid";
+ public static final String PRC_INSTANCE_NAME = "PRC_instanceName";
+
+ /**
+ * Variable used to contain skipPostInstantiationConfiguration flag.
+ */
+ public static final String SKIP_POST_INSTANTIATION_CONFIGURATION = "SkipPostInstantiationConfiguration";
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/GeneratePnfUuidDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/GeneratePnfUuidDelegate.java
index f5483e489e..852ca4fcef 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/GeneratePnfUuidDelegate.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/GeneratePnfUuidDelegate.java
@@ -21,7 +21,6 @@
package org.onap.so.bpmn.infrastructure.pnf.delegate;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
-
import java.util.UUID;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
@@ -35,7 +34,7 @@ public class GeneratePnfUuidDelegate implements JavaDelegate {
private static final Logger logger = LoggerFactory.getLogger(GeneratePnfUuidDelegate.class);
@Override
- public void execute(DelegateExecution delegateExecution){
+ public void execute(DelegateExecution delegateExecution) {
UUID uuid = UUID.randomUUID();
logger.debug("Generated UUID for pnf: {}, version: {}, variant: {}", uuid, uuid.version(), uuid.variant());
delegateExecution.setVariable(PNF_UUID, uuid.toString());
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
index 96455acb84..e2dc375cd1 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
@@ -23,29 +23,40 @@ package org.onap.so.bpmn.infrastructure.pnf.delegate;
import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.onap.so.bpmn.infrastructure.pnf.PnfNotificationEvent;
import org.onap.so.bpmn.infrastructure.pnf.dmaap.DmaapClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
@Component
-public class InformDmaapClient implements JavaDelegate {
+public class InformDmaapClient implements JavaDelegate, ApplicationListener<PnfNotificationEvent> {
+ private Logger logger = LoggerFactory.getLogger(getClass());
private DmaapClient dmaapClient;
+ private DelegateExecution execution;
@Override
public void execute(DelegateExecution execution) {
String pnfCorrelationId = (String) execution.getVariable(ExecutionVariableNames.PNF_CORRELATION_ID);
RuntimeService runtimeService = execution.getProcessEngineServices().getRuntimeService();
- dmaapClient.registerForUpdate(pnfCorrelationId, () ->
- runtimeService
- .createMessageCorrelation("WorkflowMessage")
- .processInstanceBusinessKey(execution.getProcessBusinessKey())
- .correlateWithResult()
- );
+ dmaapClient.registerForUpdate(pnfCorrelationId, () -> runtimeService.createMessageCorrelation("WorkflowMessage")
+ .processInstanceBusinessKey(execution.getProcessBusinessKey()).correlateWithResult());
+ this.execution = execution;
}
@Autowired
public void setDmaapClient(DmaapClient dmaapClient) {
this.dmaapClient = dmaapClient;
}
+
+ @Override
+ public void onApplicationEvent(PnfNotificationEvent event) {
+ logger.info("Received application event for pnfCorrelationId: {}", event.getPnfCorrelationId());
+ RuntimeService runtimeService = execution.getProcessEngineServices().getRuntimeService();
+ runtimeService.createMessageCorrelation("WorkflowMessage")
+ .processInstanceBusinessKey(execution.getProcessBusinessKey()).correlateWithResult();
+ }
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java
index 1caadea0de..b52110ea82 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java
@@ -26,7 +26,6 @@ import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableName
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_INSTANCE_ID;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.TIMEOUT_FOR_NOTIFICATION;
-
import com.google.common.base.Strings;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
@@ -38,7 +37,8 @@ import org.springframework.stereotype.Component;
@Component
public class PnfCheckInputs implements JavaDelegate {
- public static final String UUID_REGEX = "(?i)^[0-9a-f]{8}-[0-9a-f]{4}-[1-5]{1}[0-9a-f]{3}-[89ab]{1}[0-9a-f]{3}-[0-9a-f]{12}$";
+ public static final String UUID_REGEX =
+ "(?i)^[0-9a-f]{8}-[0-9a-f]{4}-[1-5]{1}[0-9a-f]{3}-[89ab]{1}[0-9a-f]{3}-[0-9a-f]{12}$";
private String pnfEntryNotificationTimeout;
@@ -58,7 +58,8 @@ public class PnfCheckInputs implements JavaDelegate {
private void validatePnfCorrelationId(DelegateExecution execution) {
String pnfCorrelationId = (String) execution.getVariable(PNF_CORRELATION_ID);
if (Strings.isNullOrEmpty(pnfCorrelationId)) {
- new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999, "pnfCorrelationId variable not defined");
+ new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999,
+ "pnfCorrelationId variable not defined");
}
}
@@ -83,7 +84,8 @@ public class PnfCheckInputs implements JavaDelegate {
private void validateServiceInstanceId(DelegateExecution execution) {
String serviceInstanceId = (String) execution.getVariable(SERVICE_INSTANCE_ID);
if (Strings.isNullOrEmpty(serviceInstanceId)) {
- new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999, "serviceInstanceId variable not defined");
+ new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999,
+ "serviceInstanceId variable not defined");
}
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareCdsCallDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareCdsCallDelegate.java
new file mode 100644
index 0000000000..c4c299d4b6
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareCdsCallDelegate.java
@@ -0,0 +1,78 @@
+/*
+ * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix
+ * Foundation. ================================================================================ Licensed under the
+ * Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may
+ * obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific language governing permissions and limitations under the
+ * License.
+ *
+ * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.pnf.delegate;
+
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.EXECUTION_OBJECT;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.MSO_REQUEST_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_BLUEPRINT_NAME;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_BLUEPRINT_VERSION;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.onap.so.client.cds.beans.AbstractCDSPropertiesBean;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * Abstract class for preparing CDS call.
+ */
+public abstract class PrepareCdsCallDelegate implements JavaDelegate {
+
+ protected Logger logger = LoggerFactory.getLogger(this.getClass());
+
+ protected static final String ORIGINATOR_ID = "SO";
+ protected static final int ERROR_CODE = 7010;
+
+ protected String actionName;
+ protected String mode;
+
+ @Autowired
+ protected ExceptionBuilder exceptionUtil;
+
+ @Override
+ public void execute(DelegateExecution delegateExecution) {
+
+ logger.debug("Running execute block for activity:{}", delegateExecution.getCurrentActivityId());
+ AbstractCDSPropertiesBean cdsPropertiesBean = new AbstractCDSPropertiesBean();
+ cdsPropertiesBean.setBlueprintName((String) delegateExecution.getVariable(PRC_BLUEPRINT_NAME));
+ cdsPropertiesBean.setBlueprintVersion((String) delegateExecution.getVariable(PRC_BLUEPRINT_VERSION));
+ cdsPropertiesBean.setOriginatorId(ORIGINATOR_ID);
+ cdsPropertiesBean.setActionName(getActionName());
+ cdsPropertiesBean.setMode(getMode());
+ cdsPropertiesBean.setRequestId((String) delegateExecution.getVariable(MSO_REQUEST_ID));
+ cdsPropertiesBean.setSubRequestId((String) delegateExecution.getVariable(PNF_UUID));
+ cdsPropertiesBean.setRequestObject(getRequestObject(delegateExecution));
+ delegateExecution.setVariable(EXECUTION_OBJECT, cdsPropertiesBean);
+ }
+
+ /**
+ * Return the request object sent to CDS call.
+ *
+ * @param delegateExecution BPMN delegateExecution context
+ * @return string value of the request object
+ */
+ protected abstract String getRequestObject(final DelegateExecution delegateExecution);
+
+ public String getActionName() {
+ return actionName;
+ }
+
+ public String getMode() {
+ return mode;
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigAssignDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigAssignDelegate.java
new file mode 100644
index 0000000000..dd2601f0d0
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigAssignDelegate.java
@@ -0,0 +1,73 @@
+/*
+ * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix
+ * Foundation. ================================================================================ Licensed under the
+ * Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may
+ * obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific language governing permissions and limitations under the
+ * License.
+ *
+ * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.pnf.delegate;
+
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.MODEL_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_CUSTOMIZATION_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_INSTANCE_NAME;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_INSTANCE_ID;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.onap.so.client.cds.beans.AbstractCDSPropertiesBean;
+import org.onap.so.client.cds.beans.ConfigAssignPropertiesForPnf;
+import org.onap.so.client.cds.beans.ConfigAssignRequestPnf;
+import org.springframework.stereotype.Component;
+
+/**
+ * This implementation of {@link JavaDelegate} is used to prepare for config Assign.
+ *
+ * It queries the PNF resource customization table and construct the {@link AbstractCDSPropertiesBean} as
+ * executionObject.
+ */
+@Component
+public class PrepareConfigAssignDelegate extends PrepareCdsCallDelegate {
+
+ public PrepareConfigAssignDelegate() {
+ this.actionName = "config-assign";
+ this.mode = "sync";
+ }
+
+ @Override
+ protected String getRequestObject(final DelegateExecution delegateExecution) {
+
+ ConfigAssignPropertiesForPnf configAssignProperties = new ConfigAssignPropertiesForPnf();
+ configAssignProperties.setServiceInstanceId((String) delegateExecution.getVariable(SERVICE_INSTANCE_ID));
+
+ /**
+ * PNF Name matches the name in AAI, i.e., correlationID as in customized workflow.
+ */
+ configAssignProperties.setPnfName((String) delegateExecution.getVariable(PNF_CORRELATION_ID));
+
+ /**
+ * PNF id match AAI entry, i.e, PNF UUID.
+ */
+ configAssignProperties.setPnfId((String) delegateExecution.getVariable(PNF_UUID));
+ configAssignProperties.setPnfCustomizationUuid((String) delegateExecution.getVariable(PRC_CUSTOMIZATION_UUID));
+ configAssignProperties.setServiceModelUuid((String) delegateExecution.getVariable(MODEL_UUID));
+
+ ConfigAssignRequestPnf configAssignRequest = new ConfigAssignRequestPnf();
+ configAssignRequest.setConfigAssignPropertiesForPnf(configAssignProperties);
+
+ /**
+ * resolution key is the same as PNF name.
+ */
+ configAssignRequest.setResolutionKey((String) delegateExecution.getVariable(PNF_CORRELATION_ID));
+
+ return configAssignRequest.toString();
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigDeployDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigDeployDelegate.java
new file mode 100644
index 0000000000..16f712fa66
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigDeployDelegate.java
@@ -0,0 +1,110 @@
+/*
+ * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix
+ * Foundation. ================================================================================ Licensed under the
+ * Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may
+ * obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific language governing permissions and limitations under the
+ * License.
+ *
+ * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.pnf.delegate;
+
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.MODEL_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_CUSTOMIZATION_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_INSTANCE_ID;
+import java.io.IOException;
+import java.util.Optional;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.onap.aai.domain.yang.Pnf;
+import org.onap.so.bpmn.infrastructure.pnf.management.PnfManagement;
+import org.onap.so.client.cds.beans.AbstractCDSPropertiesBean;
+import org.onap.so.client.cds.beans.ConfigDeployPropertiesForPnf;
+import org.onap.so.client.cds.beans.ConfigDeployRequestPnf;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * This implementation of {@link JavaDelegate} is used to prepare for config Deploy.
+ *
+ * It queries the PNF resource customization table and construct the {@link AbstractCDSPropertiesBean} as
+ * executionObject.
+ */
+@Component
+public class PrepareConfigDeployDelegate extends PrepareCdsCallDelegate {
+
+ @Autowired
+ private PnfManagement pnfManagement;
+
+ public PrepareConfigDeployDelegate() {
+ this.actionName = "config-deploy";
+ this.mode = "async";
+ }
+
+ @Override
+ protected String getRequestObject(DelegateExecution delegateExecution) {
+
+ ConfigDeployPropertiesForPnf configDeployProperties = new ConfigDeployPropertiesForPnf();
+
+ configDeployProperties.setServiceInstanceId((String) delegateExecution.getVariable(SERVICE_INSTANCE_ID));
+
+ /**
+ * PNF Name matches the name in AAI, i.e., correlationID as in customized workflow.
+ */
+ configDeployProperties.setPnfName((String) delegateExecution.getVariable(PNF_CORRELATION_ID));
+
+ /**
+ * PNF id match AAI entry, i.e, PNF UUID.
+ */
+ configDeployProperties.setPnfId((String) delegateExecution.getVariable(PNF_UUID));
+ configDeployProperties.setPnfCustomizationUuid((String) delegateExecution.getVariable(PRC_CUSTOMIZATION_UUID));
+ configDeployProperties.setServiceModelUuid((String) delegateExecution.getVariable(MODEL_UUID));
+ setIpAddress(configDeployProperties, delegateExecution);
+
+ ConfigDeployRequestPnf configDeployRequest = new ConfigDeployRequestPnf();
+ configDeployRequest.setConfigDeployPropertiesForPnf(configDeployProperties);
+
+ /**
+ * Resolution key is the same as PNF name.
+ */
+ configDeployRequest.setResolutionKey((String) delegateExecution.getVariable(PNF_CORRELATION_ID));
+
+ return configDeployRequest.toString();
+ }
+
+ private void setIpAddress(ConfigDeployPropertiesForPnf configDeployProperties,
+ DelegateExecution delegateExecution) {
+
+ /**
+ * Retrieve PNF entry from AAI.
+ */
+ try {
+ String pnfName = (String) delegateExecution.getVariable(PNF_CORRELATION_ID);
+ Optional<Pnf> pnfOptional = pnfManagement.getEntryFor(pnfName);
+ if (pnfOptional.isPresent()) {
+ Pnf pnf = pnfOptional.get();
+
+ /**
+ * PRH patches the AAI with oam address. Use ipaddress-v4-oam and ipaddress-v6-oam for the config deploy
+ * request.
+ */
+ configDeployProperties.setPnfIpV4Address(pnf.getIpaddressV4Oam());
+ configDeployProperties.setPnfIpV6Address(pnf.getIpaddressV6Oam());
+ } else {
+ exceptionUtil.buildAndThrowWorkflowException(delegateExecution, ERROR_CODE,
+ "AAI entry for PNF: " + pnfName + " does not exist");
+ }
+ } catch (IOException e) {
+ logger.warn(e.getMessage(), e);
+ exceptionUtil.buildAndThrowWorkflowException(delegateExecution, ERROR_CODE,
+ "Unable to fetch from AAI" + e.getMessage());
+ }
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationId.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationId.java
index fb5d04328f..7cb78a10e5 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationId.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationId.java
@@ -41,9 +41,8 @@ public final class JsonUtilForPnfCorrelationId {
List<String> list = new ArrayList<>();
Spliterator<JsonElement> spliterator = array.spliterator();
spliterator.forEachRemaining(jsonElement -> {
- handleEscapedCharacters(jsonElement)
- .ifPresent(jsonObject -> getPnfCorrelationId(jsonObject)
- .ifPresent(pnfCorrelationId -> list.add(pnfCorrelationId)));
+ handleEscapedCharacters(jsonElement).ifPresent(jsonObject -> getPnfCorrelationId(jsonObject)
+ .ifPresent(pnfCorrelationId -> list.add(pnfCorrelationId)));
});
return list;
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java
index 1b7a69eec8..2869111485 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java
@@ -35,9 +35,11 @@ import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
+import org.onap.so.bpmn.infrastructure.pnf.PnfNotificationEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationEventPublisher;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@@ -53,19 +55,20 @@ public class PnfEventReadyDmaapClient implements DmaapClient {
private volatile ScheduledThreadPoolExecutor executor;
private volatile boolean dmaapThreadListenerIsRunning;
+ private ApplicationEventPublisher applicationEventPublisher;
+
@Autowired
- public PnfEventReadyDmaapClient(Environment env) {
+ public PnfEventReadyDmaapClient(Environment env, ApplicationEventPublisher applicationEventPublisher) {
+ this.applicationEventPublisher = applicationEventPublisher;
httpClient = HttpClientBuilder.create().build();
pnfCorrelationIdToThreadMap = new ConcurrentHashMap<>();
topicListenerDelayInSeconds = env.getProperty("pnf.dmaap.topicListenerDelayInSeconds", Integer.class);
executor = null;
getRequest = new HttpGet(UriBuilder.fromUri(env.getProperty("pnf.dmaap.uriPathPrefix"))
- .scheme(env.getProperty("pnf.dmaap.protocol"))
- .host(env.getProperty("pnf.dmaap.host"))
- .port(env.getProperty("pnf.dmaap.port", Integer.class))
- .path(env.getProperty("pnf.dmaap.topicName"))
- .path(env.getProperty("pnf.dmaap.consumerGroup"))
- .path(env.getProperty("pnf.dmaap.consumerId")).build());
+ .scheme(env.getProperty("pnf.dmaap.protocol")).host(env.getProperty("pnf.dmaap.host"))
+ .port(env.getProperty("pnf.dmaap.port", Integer.class)).path(env.getProperty("pnf.dmaap.topicName"))
+ .path(env.getProperty("pnf.dmaap.consumerGroup")).path(env.getProperty("pnf.dmaap.consumerId"))
+ .build());
}
@Override
@@ -92,8 +95,8 @@ public class PnfEventReadyDmaapClient implements DmaapClient {
executor = new ScheduledThreadPoolExecutor(1);
executor.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
executor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
- executor.scheduleWithFixedDelay(new DmaapTopicListenerThread(), 0,
- topicListenerDelayInSeconds, TimeUnit.SECONDS);
+ executor.scheduleWithFixedDelay(new DmaapTopicListenerThread(), 0, topicListenerDelayInSeconds,
+ TimeUnit.SECONDS);
dmaapThreadListenerIsRunning = true;
}
}
@@ -116,8 +119,7 @@ public class PnfEventReadyDmaapClient implements DmaapClient {
getPnfCorrelationIdListFromResponse(response).forEach(this::informAboutPnfReadyIfPnfCorrelationIdFound);
} catch (IOException e) {
logger.error("Exception caught during sending rest request to dmaap for listening event topic", e);
- }
- finally {
+ } finally {
getRequest.reset();
}
}
@@ -133,12 +135,9 @@ public class PnfEventReadyDmaapClient implements DmaapClient {
}
private void informAboutPnfReadyIfPnfCorrelationIdFound(String pnfCorrelationId) {
- Runnable runnable = unregister(pnfCorrelationId);
- if (runnable != null) {
- logger.debug("dmaap listener gets pnf ready event for pnfCorrelationId: {}", pnfCorrelationId);
- runnable.run();
- }
+ unregister(pnfCorrelationId);
+ PnfNotificationEvent pnfNotificationEvent = new PnfNotificationEvent(this, pnfCorrelationId);
+ applicationEventPublisher.publishEvent(pnfNotificationEvent);
}
}
-
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/management/PnfManagementImpl.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/management/PnfManagementImpl.java
index 32ea357817..b1af8b1e0b 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/management/PnfManagementImpl.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/management/PnfManagementImpl.java
@@ -46,8 +46,8 @@ public class PnfManagementImpl implements PnfManagement {
@Override
public void createRelation(String serviceInstanceId, String pnfName) {
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
- serviceInstanceId);
+ AAIResourceUri serviceInstanceURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId);
AAIResourceUri pnfUri = AAIUriFactory.createResourceUri(AAIObjectType.PNF, pnfName);
new AAIResourcesClient().connect(serviceInstanceURI, pnfUri);
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/properties/BPMNProperties.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/properties/BPMNProperties.java
index ee8743f846..8b2bb9a8de 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/properties/BPMNProperties.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/properties/BPMNProperties.java
@@ -22,22 +22,22 @@ package org.onap.so.bpmn.infrastructure.properties;
import java.util.Arrays;
import java.util.List;
import org.onap.so.bpmn.core.UrnPropertiesReader;
-
import org.onap.so.bpmn.core.UrnPropertiesReader;
public class BPMNProperties {
public static String getProperty(String key, String defaultValue) {
- String value = UrnPropertiesReader.getVariable(key);
- if (value == null) {
- return defaultValue;
- } else {
- return value;
- }
+ String value = UrnPropertiesReader.getVariable(key);
+ if (value == null) {
+ return defaultValue;
+ } else {
+ return value;
+ }
}
public static List<String> getResourceSequenceProp(String input) {
- String resourceSequence = UrnPropertiesReader.getVariable("mso.workflow.custom."+ input + ".resource.sequence");
+ String resourceSequence =
+ UrnPropertiesReader.getVariable("mso.workflow.custom." + input + ".resource.sequence");
if (resourceSequence != null) {
return Arrays.asList(resourceSequence.split(","));
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NSResourceInputParameter.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NSResourceInputParameter.java
index 292f6ef575..2995e24c00 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NSResourceInputParameter.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NSResourceInputParameter.java
@@ -22,7 +22,6 @@ package org.onap.so.bpmn.infrastructure.vfcmodel;
-
/**
* NS Create Input Parameter For VFC Adapter<br>
* <p>
@@ -44,7 +43,6 @@ public class NSResourceInputParameter {
-
/**
* @return Returns the nsServiceName.
*/
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsOperationKey.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsOperationKey.java
index 81826a27eb..3e35952a9e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsOperationKey.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsOperationKey.java
@@ -21,8 +21,7 @@ package org.onap.so.bpmn.infrastructure.vfcmodel;
/**
- * The operation key object for NS
- * <br>
+ * The operation key object for NS <br>
* <p>
* </p>
*
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java
index 0d8f2fcbd7..ad388feffc 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java
@@ -37,7 +37,8 @@ public class NsParameters {
private List<LocationConstraint> locationConstraints;
- private Map<String, Object> additionalParamForNs = new HashMap<String,Object>();
+ private Map<String, Object> additionalParamForNs = new HashMap<String, Object>();
+
/**
* @return Returns the locationConstraints.
*/
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/VimLocation.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/VimLocation.java
index 970fa43d9f..8b9295b44f 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/VimLocation.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/VimLocation.java
@@ -28,7 +28,7 @@ package org.onap.so.bpmn.infrastructure.vfcmodel;
* </p>
*
* @author
- * @version ONAP Amsterdam Release 2017-10-18
+ * @version ONAP Amsterdam Release 2017-10-18
*/
public class VimLocation {
private String vimId;
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java
index 113f05d3ca..896a8bd98c 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java
@@ -22,15 +22,18 @@
package org.onap.so.bpmn.infrastructure.workflow.service;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
import java.io.IOException;
import java.net.SocketTimeoutException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
-
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.ParseException;
@@ -68,716 +71,734 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.util.UriUtils;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-
public class ServicePluginFactory {
- // SOTN calculate route
- public static final String OOF_DEFAULT_ENDPOINT = "http://192.168.1.223:8443/oof/sotncalc";
-
- public static final String THIRD_SP_DEFAULT_ENDPOINT = "http://192.168.1.223:8443/sp/resourcemgr/querytps";
-
- public static final String INVENTORY_OSS_DEFAULT_ENDPOINT = "http://192.168.1.199:8443/oss/inventory";
-
- private static final int DEFAULT_TIME_OUT = 60000;
-
- static JsonUtils jsonUtil = new JsonUtils();
-
- private static Logger logger = LoggerFactory.getLogger(ServicePluginFactory.class);
-
- private static ServicePluginFactory instance;
-
-
- public static synchronized ServicePluginFactory getInstance() {
- if (null == instance) {
- instance = new ServicePluginFactory();
- }
- return instance;
- }
-
- private ServicePluginFactory() {
-
- }
-
- private String getInventoryOSSEndPoint(){
- return UrnPropertiesReader.getVariable("mso.service-plugin.inventory-oss-endpoint", INVENTORY_OSS_DEFAULT_ENDPOINT);
- }
-
- private String getThirdSPEndPoint(){
- return UrnPropertiesReader.getVariable("mso.service-plugin.third-sp-endpoint", THIRD_SP_DEFAULT_ENDPOINT);
- }
-
- private String getOOFCalcEndPoint(){
- return UrnPropertiesReader.getVariable("mso.service-plugin.oof-calc-endpoint", OOF_DEFAULT_ENDPOINT);
- }
-
- @SuppressWarnings("unchecked")
- public String doProcessSiteLocation(ServiceDecomposition serviceDecomposition, String uuiRequest) {
- if(!isNeedProcessSite(uuiRequest)) {
- return uuiRequest;
- }
-
- Map<String, Object> uuiObject = getJsonObject(uuiRequest, Map.class);
- Map<String, Object> serviceObject = (Map<String, Object>) uuiObject.get("service");
- Map<String, Object> serviceParametersObject = (Map<String, Object>) serviceObject.get("parameters");
- Map<String, Object> serviceRequestInputs = (Map<String, Object>) serviceParametersObject.get("requestInputs");
- List<Object> resources = (List<Object>) serviceParametersObject.get("resources");
-
- if (isSiteLocationLocal(serviceRequestInputs, resources)) {
- // resources changed : added TP info
- String newRequest = getJsonString(uuiObject);
- return newRequest;
- }
-
- List<Resource> addResourceList = new ArrayList<>();
- addResourceList.addAll(serviceDecomposition.getServiceResources());
-
- serviceDecomposition.setVnfResources(null);
- serviceDecomposition.setAllottedResources(null);
- serviceDecomposition.setNetworkResources(null);
- serviceDecomposition.setConfigResources(null);
- for (Resource resource : addResourceList) {
- String resourcemodelName = resource.getModelInfo().getModelName();
- if (StringUtils.containsIgnoreCase(resourcemodelName, "sppartner")) {
- // change serviceDecomposition
- serviceDecomposition.addResource(resource);
- break;
- }
- }
-
- return uuiRequest;
- }
-
- private boolean isNeedProcessSite(String uuiRequest) {
- return uuiRequest.toLowerCase().contains("site_address") && uuiRequest.toLowerCase().contains("sotncondition_clientsignal");
- }
-
- @SuppressWarnings("unchecked")
- private boolean isSiteLocationLocal(Map<String, Object> serviceRequestInputs, List<Object> resources) {
- Map<String, Object> tpInfoMap = getTPforVPNAttachment(serviceRequestInputs);
-
- if(tpInfoMap.isEmpty()) {
- return true;
- }
- String host = (String) tpInfoMap.get("host");
- // host is empty means TP is in local, not empty means TP is in remote ONAP
- if (!host.isEmpty()) {
- return false;
- }
-
- Map<String, Object> accessTPInfo = new HashMap<String, Object>();
- accessTPInfo.put("access-provider-id", tpInfoMap.get("access-provider-id"));
- accessTPInfo.put("access-client-id", tpInfoMap.get("access-client-id"));
- accessTPInfo.put("access-topology-id", tpInfoMap.get("access-topology-id"));
- accessTPInfo.put("access-node-id", tpInfoMap.get("access-node-id"));
- accessTPInfo.put("access-ltp-id", tpInfoMap.get("access-ltp-id"));
-
- // change resources
- String resourceName = (String) tpInfoMap.get("resourceName");
- for(Object curResource : resources) {
- Map<String, Object> resource = (Map<String, Object>)curResource;
- String curResourceName = (String) resource.get("resourceName");
- curResourceName = curResourceName.replaceAll(" ", "");
- if(resourceName.equalsIgnoreCase(curResourceName)) {
- putResourceRequestInputs(resource, accessTPInfo);
- break;
- }
- }
-
- return true;
- }
-
- @SuppressWarnings("unchecked")
- private Map<String, Object> getTPforVPNAttachment(Map<String, Object> serviceRequestInputs) {
- Object location = null;
- Object clientSignal = null;
- String vpnAttachmentResourceName = null;
-
- // support R2 uuiReq and R1 uuiReq
- // logic for R2 uuiRequest params in service level
- for (Entry<String, Object> entry : serviceRequestInputs.entrySet()) {
- String key = entry.getKey();
- if (key.toLowerCase().contains("site_address")) {
- location = entry.getValue();
- }
- if (key.toLowerCase().contains("sotncondition_clientsignal")) {
- clientSignal = entry.getValue();
- vpnAttachmentResourceName = key.substring(0, key.indexOf("_"));
- }
- }
-
- Map<String, Object> tpInfoMap = new HashMap<String, Object>();
-
- // Site resource has location param and SOTNAttachment resource has clientSignal param
- if(location == null || clientSignal == null ) {
- return tpInfoMap;
- }
-
- // Query terminal points from InventoryOSS system by location.
- String locationAddress = (String) location;
- List<Object> locationTPList = queryAccessTPbyLocationFromInventoryOSS(locationAddress);
- if(locationTPList != null && !locationTPList.isEmpty()) {
- for(Object tp: locationTPList) {
- Map<String, Object> tpJson = (Map<String, Object>) tp;
- String loc = (String)tpJson.get ("location");
- if(StringUtils.equalsIgnoreCase (locationAddress, loc)) {
- tpInfoMap = tpJson;
- // add resourceName
- tpInfoMap.put("resourceName", vpnAttachmentResourceName);
- break;
- }
- }
- logger.debug("Get Terminal TP from InventoryOSS");
- return tpInfoMap;
- }
-
- return tpInfoMap;
- }
-
- @SuppressWarnings("unchecked")
- private List<Object> queryAccessTPbyLocationFromInventoryOSS(String locationAddress) {
- String url = getInventoryOSSEndPoint();
- url += "/oss/inventory?location=" + UriUtils.encode(locationAddress,"UTF-8");
- String responseContent = sendRequest(url, "GET", "");
- List<Object> accessTPs = new ArrayList<>();
- if (null != responseContent) {
- accessTPs = getJsonObject(responseContent, List.class);
- }
- return accessTPs;
- }
-
- @SuppressWarnings("unchecked")
- private void putResourceRequestInputs(Map<String, Object> resource, Map<String, Object> resourceInputs) {
- Map<String, Object> resourceParametersObject = new HashMap<>();
- Map<String, Object> resourceRequestInputs = new HashMap<>();
- resourceRequestInputs.put("requestInputs", resourceInputs);
- resourceParametersObject.put("parameters", resourceRequestInputs);
-
- if(resource.containsKey("parameters")) {
- Map<String, Object> resParametersObject = (Map<String, Object>) resource.get("parameters");
- if(resParametersObject.containsKey("requestInputs")) {
- Map<String, Object> resRequestInputs = (Map<String, Object>) resourceRequestInputs.get("requestInputs");
- Map<String, Object> oldRequestInputs = (Map<String, Object>) resParametersObject.get("requestInputs");
- if(oldRequestInputs != null) {
- oldRequestInputs.putAll(resRequestInputs);
- }
- else {
- resParametersObject.put("requestInputs", resRequestInputs);
- }
- }
- else {
- resParametersObject.putAll(resourceRequestInputs);
- }
- }
- else {
- resource.putAll(resourceParametersObject);
- }
-
- return;
- }
-
-
-
- @SuppressWarnings("unchecked")
- public String doTPResourcesAllocation(DelegateExecution execution, String uuiRequest) {
- Map<String, Object> uuiObject = getJsonObject(uuiRequest, Map.class);
- Map<String, Object> serviceObject = (Map<String, Object>) uuiObject.get("service");
- Map<String, Object> serviceParametersObject = (Map<String, Object>) serviceObject.get("parameters");
- Map<String, Object> serviceRequestInputs = (Map<String, Object>) serviceParametersObject.get("requestInputs");
-
- if(!isNeedAllocateCrossTPResources(serviceRequestInputs)) {
- return uuiRequest;
- }
-
- allocateCrossTPResources(execution, serviceRequestInputs);
- String newRequest = getJsonString(uuiObject);
- return newRequest;
- }
-
- @SuppressWarnings("unchecked")
- private boolean isNeedAllocateCrossTPResources(Map<String, Object> serviceRequestInputs) {
- if(serviceRequestInputs.containsKey("CallSource"))
- {
- String callSource = (String) serviceRequestInputs.get("CallSource");
- if("ExternalAPI".equalsIgnoreCase(callSource)) {
- return false;
- }
- }
- for (String input : serviceRequestInputs.keySet())
- {
- if(input.toLowerCase().contains("sotnconnectivity")) {
- return true;
- }
- }
- return false;
- }
-
- @SuppressWarnings("unchecked")
- private void allocateCrossTPResources(DelegateExecution execution, Map<String, Object> serviceRequestInputs) {
-
- Map<String, Object> crossTPs = this.getTPsfromAAI();
-
- if(crossTPs == null || crossTPs.isEmpty()) {
- serviceRequestInputs.put("local-access-provider-id", "");
- serviceRequestInputs.put("local-access-client-id", "");
- serviceRequestInputs.put("local-access-topology-id", "");
- serviceRequestInputs.put("local-access-node-id", "");
- serviceRequestInputs.put("local-access-ltp-id", "");
- serviceRequestInputs.put("remote-access-provider-id", "");
- serviceRequestInputs.put("remote-access-client-id", "");
- serviceRequestInputs.put("remote-access-topology-id", "");
- serviceRequestInputs.put("remote-access-node-id", "");
- serviceRequestInputs.put("remote-access-ltp-id", "");
- }
- else {
- serviceRequestInputs.put("local-access-provider-id", crossTPs.get("local-access-provider-id"));
- serviceRequestInputs.put("local-access-client-id", crossTPs.get("local-access-client-id"));
- serviceRequestInputs.put("local-access-topology-id", crossTPs.get("local-access-topology-id"));
- serviceRequestInputs.put("local-access-node-id", crossTPs.get("local-access-node-id"));
- serviceRequestInputs.put("local-access-ltp-id", crossTPs.get("local-access-ltp-id"));
- serviceRequestInputs.put("remote-access-provider-id", crossTPs.get("remote-access-provider-id"));
- serviceRequestInputs.put("remote-access-client-id", crossTPs.get("remote-client-id"));
- serviceRequestInputs.put("remote-access-topology-id", crossTPs.get("remote-topology-id"));
- serviceRequestInputs.put("remote-access-node-id", crossTPs.get("remote-node-id"));
- serviceRequestInputs.put("remote-access-ltp-id", crossTPs.get("remote-ltp-id"));
- }
-
- return;
- }
-
- // This method returns Local and remote TPs information from AAI
- public Map getTPsfromAAI() {
- Map<String, Object> tpInfo = new HashMap<>();
-
- AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.LOGICAL_LINK);
- AAIResourcesClient client = new AAIResourcesClient();
- Optional<LogicalLinks> result = client.get(LogicalLinks.class, uri);
-
- if (result.isPresent()) {
- LogicalLinks links = result.get();
- boolean isRemoteLink = false;
-
- links.getLogicalLink();
-
- for (LogicalLink link : links.getLogicalLink()) {
- AAIResultWrapper wrapper = new AAIResultWrapper(link);
- Optional<Relationships> optRelationships = wrapper.getRelationships();
- List<AAIResourceUri> pInterfaces = new ArrayList<>();
- if (optRelationships.isPresent()) {
- Relationships relationships = optRelationships.get();
- if (!relationships.getRelatedAAIUris(AAIObjectType.EXT_AAI_NETWORK).isEmpty()) {
- isRemoteLink = true;
- }
- pInterfaces.addAll(relationships.getRelatedAAIUris(AAIObjectType.P_INTERFACE));
- }
-
- if (isRemoteLink) {
- // find remote p interface
- AAIResourceUri localTP = null;
- AAIResourceUri remoteTP = null;
-
- AAIResourceUri pInterface0 = pInterfaces.get(0);
-
- if (isRemotePInterface(client, pInterface0)) {
- remoteTP = pInterfaces.get(0);
- localTP = pInterfaces.get(1);
- } else {
- localTP = pInterfaces.get(0);
- remoteTP = pInterfaces.get(1);
- }
-
- if (localTP != null && remoteTP != null) {
- // give local tp
- String tpUrl = localTP.build().toString();
- PInterface intfLocal = client.get(PInterface.class, localTP).get();
- tpInfo.put("local-access-node-id", tpUrl.split("/")[6]);
-
- String[] networkRef = intfLocal.getNetworkRef().split("/");
- if (networkRef.length == 6) {
- tpInfo.put("local-access-provider-id", networkRef[1]);
- tpInfo.put("local-access-client-id", networkRef[3]);
- tpInfo.put("local-access-topology-id", networkRef[5]);
- }
- String ltpIdStr = tpUrl.substring(tpUrl.lastIndexOf("/") + 1);
- if (ltpIdStr.contains("-")) {
- tpInfo.put("local-access-ltp-id", ltpIdStr.substring(ltpIdStr.lastIndexOf("-") + 1));
- }
-
- // give remote tp
- tpUrl = remoteTP.build().toString();
- PInterface intfRemote = client.get(PInterface.class, remoteTP).get();
- tpInfo.put("remote-access-node-id", tpUrl.split("/")[6]);
-
- String[] networkRefRemote = intfRemote.getNetworkRef().split("/");
-
- if (networkRefRemote.length == 6) {
- tpInfo.put("remote-access-provider-id", networkRefRemote[1]);
- tpInfo.put("remote-access-client-id", networkRefRemote[3]);
- tpInfo.put("remote-access-topology-id", networkRefRemote[5]);
- }
- String ltpIdStrR = tpUrl.substring(tpUrl.lastIndexOf("/") + 1);
- if (ltpIdStrR.contains("-")) {
- tpInfo.put("remote-access-ltp-id", ltpIdStrR.substring(ltpIdStr.lastIndexOf("-") + 1));
- }
- return tpInfo;
- }
- }
- }
- }
- return tpInfo;
- }
-
- // this method check if pInterface is remote
- private boolean isRemotePInterface(AAIResourcesClient client, AAIResourceUri uri) {
-
- String uriString = uri.build().toString();
-
- if (uriString != null) {
- // get the pnfname
- String[] token = uriString.split("/");
- AAIResourceUri parent = AAIUriFactory.createResourceUri(AAIObjectType.PNF, token[4]);
-
- AAIResultWrapper wrapper = client.get(parent);
- Optional<Relationships> optRelationships = wrapper.getRelationships();
- if (optRelationships.isPresent()) {
- Relationships relationships = optRelationships.get();
-
- return !relationships.getRelatedAAIUris(AAIObjectType.EXT_AAI_NETWORK).isEmpty();
- }
- }
-
- return false;
- }
-
- public String preProcessService(ServiceDecomposition serviceDecomposition, String uuiRequest) {
-
- // now only for sotn
- if (isSOTN(serviceDecomposition, uuiRequest)) {
- // We Need to query the terminalpoint of the VPN by site location
- // info
- return preProcessSOTNService(serviceDecomposition, uuiRequest);
- }
- return uuiRequest;
- }
-
- public String doServiceHoming(ServiceDecomposition serviceDecomposition, String uuiRequest) {
- // now only for sotn
- if (isSOTN(serviceDecomposition, uuiRequest)) {
- return doSOTNServiceHoming(serviceDecomposition, uuiRequest);
- }
- return uuiRequest;
- }
-
- private boolean isSOTN(ServiceDecomposition serviceDecomposition, String uuiRequest) {
- // there should be a register platform , we check it very simple here.
- return uuiRequest.contains("clientSignal") && uuiRequest.contains("vpnType");
- }
-
- private String preProcessSOTNService(ServiceDecomposition serviceDecomposition, String uuiRequest) {
- Map<String, Object> uuiObject = getJsonObject(uuiRequest, Map.class);
- Map<String, Object> serviceObject = (Map<String, Object>) uuiObject.get("service");
- Map<String, Object> serviceParametersObject = (Map<String, Object>) serviceObject.get("parameters");
- Map<String, Object> serviceRequestInputs = (Map<String, Object>) serviceParametersObject.get("requestInputs");
- List<Object> resources = (List<Object>) serviceParametersObject.get("resources");
- // This is a logic for demo , it could not be finalized to community.
- String srcLocation = "";
- String dstLocation = "";
- String srcClientSignal = "";
- String dstClientSignal = "";
- // support R2 uuiReq and R1 uuiReq
- // logic for R2 uuiRequest params in service level
- for (Entry<String, Object> entry : serviceRequestInputs.entrySet()) {
- if (entry.getKey().toLowerCase().contains("location")) {
- if ("".equals(srcLocation)) {
- srcLocation = (String) entry.getValue();
- } else if ("".equals(dstLocation)) {
- dstLocation = (String) entry.getValue();
- }
- }
- if (entry.getKey().toLowerCase().contains("clientsignal")) {
- if ("".equals(srcClientSignal)) {
- srcClientSignal = (String) entry.getValue();
- } else if ("".equals(dstClientSignal)) {
- dstClientSignal = (String) entry.getValue();
- }
- }
- }
-
- // logic for R1 uuiRequest, params in resource level
- for (Object resource : resources) {
- Map<String, Object> resourceObject = (Map<String, Object>) resource;
- Map<String, Object> resourceParametersObject = (Map<String, Object>) resourceObject.get("parameters");
- Map<String, Object> resourceRequestInputs = (Map<String, Object>) resourceParametersObject.get("requestInputs");
- for (Entry<String, Object> entry : resourceRequestInputs.entrySet()) {
- if (entry.getKey().toLowerCase().contains("location")) {
- if ("".equals(srcLocation)) {
- srcLocation = (String) entry.getValue();
- } else if ("".equals(dstLocation)) {
- dstLocation = (String) entry.getValue();
- }
- }
- if (entry.getKey().toLowerCase().contains("clientsignal")) {
- if ("".equals(srcClientSignal)) {
- srcClientSignal = (String) entry.getValue();
- } else if ("".equals(dstClientSignal)) {
- dstClientSignal = (String) entry.getValue();
- }
- }
- }
- }
-
- Map<String, Object> vpnRequestInputs = getVPNResourceRequestInputs(resources);
- // here we put client signal to vpn resource inputs
- if(null!=vpnRequestInputs) {
- vpnRequestInputs.put("src-client-signal", srcClientSignal);
- vpnRequestInputs.put("dst-client-signal", dstClientSignal);
- }
-
-
- // Now we need to query terminal points from SP resourcemgr system.
- List<Object> locationTerminalPointList = queryTerminalPointsFromServiceProviderSystem(srcLocation, dstLocation);
- Map<String, Object> tpInfoMap = (Map<String, Object>) locationTerminalPointList.get(0);
-
- serviceRequestInputs.put("inner-src-access-provider-id", tpInfoMap.get("access-provider-id"));
- serviceRequestInputs.put("inner-src-access-client-id", tpInfoMap.get("access-client-id"));
- serviceRequestInputs.put("inner-src-access-topology-id", tpInfoMap.get("access-topology-id"));
- serviceRequestInputs.put("inner-src-access-node-id", tpInfoMap.get("access-node-id"));
- serviceRequestInputs.put("inner-src-access-ltp-id", tpInfoMap.get("access-ltp-id"));
- tpInfoMap = (Map<String, Object>) locationTerminalPointList.get(1);
-
- serviceRequestInputs.put("inner-dst-access-provider-id", tpInfoMap.get("access-provider-id"));
- serviceRequestInputs.put("inner-dst-access-client-id", tpInfoMap.get("access-client-id"));
- serviceRequestInputs.put("inner-dst-access-topology-id", tpInfoMap.get("access-topology-id"));
- serviceRequestInputs.put("inner-dst-access-node-id", tpInfoMap.get("access-node-id"));
- serviceRequestInputs.put("inner-dst-access-ltp-id", tpInfoMap.get("access-ltp-id"));
-
- String newRequest = getJsonString(uuiObject);
- return newRequest;
- }
-
- private List<Object> queryTerminalPointsFromServiceProviderSystem(String srcLocation, String dstLocation) {
- Map<String, String> locationSrc = new HashMap<>();
- locationSrc.put("location", srcLocation);
- Map<String, String> locationDst = new HashMap<>();
- locationDst.put("location", dstLocation);
- List<Map<String, String>> locations = new ArrayList<>();
- locations.add(locationSrc);
- locations.add(locationDst);
- List<Object> returnList = new ArrayList<>();
- String reqContent = getJsonString(locations);
- String url = getThirdSPEndPoint();
- String responseContent = sendRequest(url, "POST", reqContent);
- if (null != responseContent) {
- returnList = getJsonObject(responseContent, List.class);
- }
- return returnList;
- }
-
- @SuppressWarnings("unchecked")
- private Map<String, Object> getVPNResourceRequestInputs(List<Object> resources) {
- for (Object resource : resources) {
- Map<String, Object> resourceObject = (Map<String, Object>) resource;
- Map<String, Object> resourceParametersObject = (Map<String, Object>) resourceObject.get("parameters");
- Map<String, Object> resourceRequestInputs = (Map<String, Object>) resourceParametersObject.get("requestInputs");
- for (Entry<String, Object> entry : resourceRequestInputs.entrySet()) {
- if (entry.getKey().toLowerCase().contains("vpntype")) {
- return resourceRequestInputs;
- }
- }
- }
- return null;
- }
-
- public static void main(String args[]){
- String str = "restconf/config/GENERIC-RESOURCE-API:services/service/eca7e542-12ba-48de-8544-fac59303b14e/service-data/networks/network/aec07806-1671-4af2-b722-53c8e320a633/network-data/";
-
- int index1 = str.indexOf("/network/");
- int index2 = str.indexOf("/network-data");
-
- String str1 = str.substring(index1 + "/network/".length(), index2);
- System.out.println(str1);
-
- }
-
- private String doSOTNServiceHoming(ServiceDecomposition serviceDecomposition, String uuiRequest) {
- // query the route for the service.
- Map<String, Object> uuiObject = getJsonObject(uuiRequest, Map.class);
- Map<String, Object> serviceObject = (Map<String, Object>) uuiObject.get("service");
- Map<String, Object> serviceParametersObject = (Map<String, Object>) serviceObject.get("parameters");
- Map<String, Object> serviceRequestInputs = (Map<String, Object>) serviceParametersObject.get("requestInputs");
- Map<String, Object> oofQueryObject = new HashMap<>();
- List<Object> resources = (List<Object>) serviceParametersObject.get("resources");
- oofQueryObject.put("src-access-provider-id", serviceRequestInputs.get("inner-src-access-provider-id"));
- oofQueryObject.put("src-access-client-id", serviceRequestInputs.get("inner-src-access-client-id"));
- oofQueryObject.put("src-access-topology-id", serviceRequestInputs.get("inner-src-access-topology-id"));
- oofQueryObject.put("src-access-node-id", serviceRequestInputs.get("inner-src-access-node-id"));
- oofQueryObject.put("src-access-ltp-id", serviceRequestInputs.get("inner-src-access-ltp-id"));
- oofQueryObject.put("dst-access-provider-id", serviceRequestInputs.get("inner-dst-access-provider-id"));
- oofQueryObject.put("dst-access-client-id", serviceRequestInputs.get("inner-dst-access-client-id"));
- oofQueryObject.put("dst-access-topology-id", serviceRequestInputs.get("inner-dst-access-topology-id"));
- oofQueryObject.put("dst-access-node-id", serviceRequestInputs.get("inner-dst-access-node-id"));
- oofQueryObject.put("dst-access-ltp-id", serviceRequestInputs.get("inner-dst-access-ltp-id"));
- String oofRequestReq = getJsonString(oofQueryObject);
- String url = getOOFCalcEndPoint();
- String responseContent = sendRequest(url, "POST", oofRequestReq);
-
- List<Object> returnList = new ArrayList<>();
- if (null != responseContent) {
- returnList = getJsonObject(responseContent, List.class);
- }
- // in demo we have only one VPN. no cross VPNs, so get first item.
- Map<String, Object> returnRoute = getReturnRoute(returnList);
- Map<String, Object> vpnRequestInputs = getVPNResourceRequestInputs(resources);
- if(null!=vpnRequestInputs) {
- vpnRequestInputs.putAll(returnRoute);
- }
- String newRequest = getJsonString(uuiObject);
- return newRequest;
- }
-
- private Map<String, Object> getReturnRoute(List<Object> returnList){
- Map<String, Object> returnRoute = new HashMap<>();
- for(Object returnVpn :returnList){
- Map<String, Object> returnVpnInfo = (Map<String, Object>) returnVpn;
- String accessTopoId = (String)returnVpnInfo.get("access-topology-id");
- if("100".equals(accessTopoId)){
- returnRoute.putAll(returnVpnInfo);
- }
- else if("101".equals(accessTopoId)){
- for(String key : returnVpnInfo.keySet()){
- returnRoute.put("domain1-" + key, returnVpnInfo.get(key));
- }
- }
- else if("102".equals(accessTopoId)){
- for(String key : returnVpnInfo.keySet()){
- returnRoute.put("domain2-" + key, returnVpnInfo.get(key));
- }
- }
- else{
- for(String key : returnVpnInfo.keySet()){
- returnRoute.put("domain" + accessTopoId +"-" + key, returnVpnInfo.get(key));
- }
- }
- }
- return returnRoute;
- }
-
- private Map<String, Object> getResourceParams(Execution execution, String resourceCustomizationUuid,
- String serviceParameters) {
- List<String> resourceList = jsonUtil.StringArrayToList(execution,
- JsonUtils.getJsonValue(serviceParameters, "resources"));
- // Get the right location str for resource. default is an empty array.
- String resourceInputsFromUui = "";
- for (String resource : resourceList) {
- String resCusUuid = JsonUtils.getJsonValue(resource, "resourceCustomizationUuid");
- if (resourceCustomizationUuid.equals(resCusUuid)) {
- String resourceParameters = JsonUtils.getJsonValue(resource, "parameters");
- resourceInputsFromUui = JsonUtils.getJsonValue(resourceParameters, "requestInputs");
- }
- }
- Map<String, Object> resourceInputsFromUuiMap = getJsonObject(resourceInputsFromUui, Map.class);
- return resourceInputsFromUuiMap;
- }
-
- public static <T> T getJsonObject(String jsonstr, Class<T> type) {
- ObjectMapper mapper = new ObjectMapper();
- mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
- try {
- return mapper.readValue(jsonstr, type);
- } catch (IOException e) {
- logger.error("{} {} fail to unMarshal json", MessageEnum.RA_NS_EXC.toString(),
- ErrorCode.BusinessProcesssError.getValue(), e);
- }
- return null;
- }
-
- public static String getJsonString(Object srcObj) {
- ObjectMapper mapper = new ObjectMapper();
- mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
- String jsonStr = null;
- try {
- jsonStr = mapper.writeValueAsString(srcObj);
- } catch (JsonProcessingException e) {
- logger.debug("SdcToscaParserException", e);
- }
- return jsonStr;
- }
-
- private static String sendRequest(String url, String methodType, String content) {
-
- String msbUrl = url;
- HttpRequestBase method = null;
- HttpResponse httpResponse = null;
-
- try {
- int timeout = DEFAULT_TIME_OUT;
-
- RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(timeout).setConnectTimeout(timeout)
- .setConnectionRequestTimeout(timeout).build();
-
- HttpClient client = HttpClientBuilder.create().build();
-
- if ("POST".equals(methodType.toUpperCase())) {
- HttpPost httpPost = new HttpPost(msbUrl);
- httpPost.setConfig(requestConfig);
- httpPost.setEntity(new StringEntity(content, ContentType.APPLICATION_JSON));
- method = httpPost;
- } else if ("PUT".equals(methodType.toUpperCase())) {
- HttpPut httpPut = new HttpPut(msbUrl);
- httpPut.setConfig(requestConfig);
- httpPut.setEntity(new StringEntity(content, ContentType.APPLICATION_JSON));
- method = httpPut;
- } else if ("GET".equals(methodType.toUpperCase())) {
- HttpGet httpGet = new HttpGet(msbUrl);
- httpGet.setConfig(requestConfig);
- httpGet.addHeader("X-FromAppId", "MSO");
- httpGet.addHeader("Accept","application/json");
- method = httpGet;
- } else if ("DELETE".equals(methodType.toUpperCase())) {
- HttpDelete httpDelete = new HttpDelete(msbUrl);
- httpDelete.setConfig(requestConfig);
- method = httpDelete;
- }
-
- httpResponse = client.execute(method);
- String responseContent = null;
- if (null != httpResponse && httpResponse.getEntity() != null) {
- try {
- responseContent = EntityUtils.toString(httpResponse.getEntity(), "UTF-8");
- } catch (ParseException e) {
- logger.debug("ParseException in sendrequest", e);
- } catch (IOException e) {
- logger.debug("IOException in sendrequest", e);
- }
- }
- if (null != method) {
- method.reset();
- }
- method = null;
- return responseContent;
-
- } catch (SocketTimeoutException | ConnectTimeoutException e) {
- return null;
-
- } catch (Exception e) {
- return null;
-
- } finally {
- if (httpResponse != null) {
- try {
- EntityUtils.consume(httpResponse.getEntity());
- } catch (Exception e) {
- }
- }
- if (method != null) {
- try {
- method.reset();
- } catch (Exception e) {
-
- }
- }
- }
- }
+ // SOTN calculate route
+ public static final String OOF_DEFAULT_ENDPOINT = "http://192.168.1.223:8443/oof/sotncalc";
+
+ public static final String THIRD_SP_DEFAULT_ENDPOINT = "http://192.168.1.223:8443/sp/resourcemgr/querytps";
+
+ public static final String INVENTORY_OSS_DEFAULT_ENDPOINT = "http://192.168.1.199:8443/oss/inventory";
+
+ private static final int DEFAULT_TIME_OUT = 60000;
+
+ static JsonUtils jsonUtil = new JsonUtils();
+
+ private static Logger logger = LoggerFactory.getLogger(ServicePluginFactory.class);
+
+ private static ServicePluginFactory instance;
+
+
+ public static synchronized ServicePluginFactory getInstance() {
+ if (null == instance) {
+ instance = new ServicePluginFactory();
+ }
+ return instance;
+ }
+
+ private ServicePluginFactory() {
+
+ }
+
+ private String getInventoryOSSEndPoint() {
+ return UrnPropertiesReader.getVariable("mso.service-plugin.inventory-oss-endpoint",
+ INVENTORY_OSS_DEFAULT_ENDPOINT);
+ }
+
+ private String getThirdSPEndPoint() {
+ return UrnPropertiesReader.getVariable("mso.service-plugin.third-sp-endpoint", THIRD_SP_DEFAULT_ENDPOINT);
+ }
+
+ private String getOOFCalcEndPoint() {
+ return UrnPropertiesReader.getVariable("mso.service-plugin.oof-calc-endpoint", OOF_DEFAULT_ENDPOINT);
+ }
+
+ @SuppressWarnings("unchecked")
+ public String doProcessSiteLocation(ServiceDecomposition serviceDecomposition, String uuiRequest) {
+ if (!isNeedProcessSite(uuiRequest)) {
+ return uuiRequest;
+ }
+
+ Map<String, Object> uuiObject = getJsonObject(uuiRequest, Map.class);
+ if (uuiObject == null) {
+ return uuiRequest;
+ }
+ Map<String, Object> serviceObject =
+ (Map<String, Object>) uuiObject.getOrDefault("service", Collections.emptyMap());
+ Map<String, Object> serviceParametersObject =
+ (Map<String, Object>) serviceObject.getOrDefault("parameters", Collections.emptyMap());
+ Map<String, Object> serviceRequestInputs =
+ (Map<String, Object>) serviceParametersObject.getOrDefault("requestInputs", Collections.emptyMap());
+ List<Object> resources =
+ (List<Object>) serviceParametersObject.getOrDefault("resources", Collections.emptyList());
+
+ if (isSiteLocationLocal(serviceRequestInputs, resources)) {
+ // resources changed : added TP info
+ return getJsonString(uuiObject);
+ }
+
+ List<Resource> addResourceList = new ArrayList<>();
+ addResourceList.addAll(serviceDecomposition.getServiceResources());
+
+ serviceDecomposition.setVnfResources(null);
+ serviceDecomposition.setAllottedResources(null);
+ serviceDecomposition.setNetworkResources(null);
+ serviceDecomposition.setConfigResources(null);
+ for (Resource resource : addResourceList) {
+ String resourcemodelName = resource.getModelInfo().getModelName();
+ if (StringUtils.containsIgnoreCase(resourcemodelName, "sppartner")) {
+ // change serviceDecomposition
+ serviceDecomposition.addResource(resource);
+ break;
+ }
+ }
+
+ return uuiRequest;
+ }
+
+ private boolean isNeedProcessSite(String uuiRequest) {
+ return uuiRequest.toLowerCase().contains("site_address")
+ && uuiRequest.toLowerCase().contains("sotncondition_clientsignal");
+ }
+
+ @SuppressWarnings("unchecked")
+ private boolean isSiteLocationLocal(Map<String, Object> serviceRequestInputs, List<Object> resources) {
+ Map<String, Object> tpInfoMap = getTPforVPNAttachment(serviceRequestInputs);
+
+ if (tpInfoMap.isEmpty()) {
+ return true;
+ }
+ String host = (String) tpInfoMap.get("host");
+ // host is empty means TP is in local, not empty means TP is in remote ONAP
+ if (!host.isEmpty()) {
+ return false;
+ }
+
+ Map<String, Object> accessTPInfo = new HashMap<String, Object>();
+ accessTPInfo.put("access-provider-id", tpInfoMap.get("access-provider-id"));
+ accessTPInfo.put("access-client-id", tpInfoMap.get("access-client-id"));
+ accessTPInfo.put("access-topology-id", tpInfoMap.get("access-topology-id"));
+ accessTPInfo.put("access-node-id", tpInfoMap.get("access-node-id"));
+ accessTPInfo.put("access-ltp-id", tpInfoMap.get("access-ltp-id"));
+
+ // change resources
+ String resourceName = (String) tpInfoMap.get("resourceName");
+ for (Object curResource : resources) {
+ Map<String, Object> resource = (Map<String, Object>) curResource;
+ String curResourceName = (String) resource.get("resourceName");
+ curResourceName = curResourceName.replaceAll(" ", "");
+ if (resourceName.equalsIgnoreCase(curResourceName)) {
+ putResourceRequestInputs(resource, accessTPInfo);
+ break;
+ }
+ }
+
+ return true;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Map<String, Object> getTPforVPNAttachment(Map<String, Object> serviceRequestInputs) {
+ Object location = null;
+ Object clientSignal = null;
+ String vpnAttachmentResourceName = null;
+
+ // support R2 uuiReq and R1 uuiReq
+ // logic for R2 uuiRequest params in service level
+ for (Entry<String, Object> entry : serviceRequestInputs.entrySet()) {
+ String key = entry.getKey();
+ if (key.toLowerCase().contains("site_address")) {
+ location = entry.getValue();
+ }
+ if (key.toLowerCase().contains("sotncondition_clientsignal")) {
+ clientSignal = entry.getValue();
+ vpnAttachmentResourceName = key.substring(0, key.indexOf("_"));
+ }
+ }
+
+ Map<String, Object> tpInfoMap = new HashMap<String, Object>();
+
+ // Site resource has location param and SOTNAttachment resource has clientSignal param
+ if (location == null || clientSignal == null) {
+ return tpInfoMap;
+ }
+
+ // Query terminal points from InventoryOSS system by location.
+ String locationAddress = (String) location;
+ List<Object> locationTPList = queryAccessTPbyLocationFromInventoryOSS(locationAddress);
+ if (locationTPList != null && !locationTPList.isEmpty()) {
+ for (Object tp : locationTPList) {
+ Map<String, Object> tpJson = (Map<String, Object>) tp;
+ String loc = (String) tpJson.get("location");
+ if (StringUtils.equalsIgnoreCase(locationAddress, loc)) {
+ tpInfoMap = tpJson;
+ // add resourceName
+ tpInfoMap.put("resourceName", vpnAttachmentResourceName);
+ break;
+ }
+ }
+ logger.debug("Get Terminal TP from InventoryOSS");
+ return tpInfoMap;
+ }
+
+ return tpInfoMap;
+ }
+
+ @SuppressWarnings("unchecked")
+ private List<Object> queryAccessTPbyLocationFromInventoryOSS(String locationAddress) {
+ String url = getInventoryOSSEndPoint();
+ url += "/oss/inventory?location=" + UriUtils.encode(locationAddress, "UTF-8");
+ String responseContent = sendRequest(url, "GET", "");
+ List<Object> accessTPs = new ArrayList<>();
+ if (null != responseContent) {
+ accessTPs = getJsonObject(responseContent, List.class);
+ }
+ return accessTPs;
+ }
+
+ @SuppressWarnings("unchecked")
+ private void putResourceRequestInputs(Map<String, Object> resource, Map<String, Object> resourceInputs) {
+ Map<String, Object> resourceParametersObject = new HashMap<>();
+ Map<String, Object> resourceRequestInputs = new HashMap<>();
+ resourceRequestInputs.put("requestInputs", resourceInputs);
+ resourceParametersObject.put("parameters", resourceRequestInputs);
+
+ if (resource.containsKey("parameters")) {
+ Map<String, Object> resParametersObject = (Map<String, Object>) resource.get("parameters");
+ if (resParametersObject.containsKey("requestInputs")) {
+ Map<String, Object> resRequestInputs = (Map<String, Object>) resourceRequestInputs.get("requestInputs");
+ Map<String, Object> oldRequestInputs = (Map<String, Object>) resParametersObject.get("requestInputs");
+ if (oldRequestInputs != null) {
+ oldRequestInputs.putAll(resRequestInputs);
+ } else {
+ resParametersObject.put("requestInputs", resRequestInputs);
+ }
+ } else {
+ resParametersObject.putAll(resourceRequestInputs);
+ }
+ } else {
+ resource.putAll(resourceParametersObject);
+ }
+
+ return;
+ }
+
+
+
+ @SuppressWarnings("unchecked")
+ public String doTPResourcesAllocation(DelegateExecution execution, String uuiRequest) {
+ Map<String, Object> uuiObject = getJsonObject(uuiRequest, Map.class);
+ if (uuiObject == null) {
+ return uuiRequest;
+ }
+ Map<String, Object> serviceObject =
+ (Map<String, Object>) uuiObject.getOrDefault("service", Collections.emptyMap());
+ Map<String, Object> serviceParametersObject =
+ (Map<String, Object>) serviceObject.getOrDefault("parameters", Collections.emptyMap());
+ Map<String, Object> serviceRequestInputs =
+ (Map<String, Object>) serviceParametersObject.getOrDefault("requestInputs", Collections.emptyMap());
+
+ if (!isNeedAllocateCrossTPResources(serviceRequestInputs)) {
+ return uuiRequest;
+ }
+
+ allocateCrossTPResources(execution, serviceRequestInputs);
+ return getJsonString(uuiObject);
+ }
+
+ @SuppressWarnings("unchecked")
+ private boolean isNeedAllocateCrossTPResources(Map<String, Object> serviceRequestInputs) {
+ if (serviceRequestInputs.containsKey("CallSource")) {
+ String callSource = (String) serviceRequestInputs.get("CallSource");
+ if ("ExternalAPI".equalsIgnoreCase(callSource)) {
+ return false;
+ }
+ }
+ for (String input : serviceRequestInputs.keySet()) {
+ if (input.toLowerCase().contains("sotnconnectivity")) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @SuppressWarnings("unchecked")
+ private void allocateCrossTPResources(DelegateExecution execution, Map<String, Object> serviceRequestInputs) {
+
+ Map<String, Object> crossTPs = this.getTPsfromAAI();
+
+ if (crossTPs == null || crossTPs.isEmpty()) {
+ serviceRequestInputs.put("local-access-provider-id", "");
+ serviceRequestInputs.put("local-access-client-id", "");
+ serviceRequestInputs.put("local-access-topology-id", "");
+ serviceRequestInputs.put("local-access-node-id", "");
+ serviceRequestInputs.put("local-access-ltp-id", "");
+ serviceRequestInputs.put("remote-access-provider-id", "");
+ serviceRequestInputs.put("remote-access-client-id", "");
+ serviceRequestInputs.put("remote-access-topology-id", "");
+ serviceRequestInputs.put("remote-access-node-id", "");
+ serviceRequestInputs.put("remote-access-ltp-id", "");
+ } else {
+ serviceRequestInputs.put("local-access-provider-id", crossTPs.get("local-access-provider-id"));
+ serviceRequestInputs.put("local-access-client-id", crossTPs.get("local-access-client-id"));
+ serviceRequestInputs.put("local-access-topology-id", crossTPs.get("local-access-topology-id"));
+ serviceRequestInputs.put("local-access-node-id", crossTPs.get("local-access-node-id"));
+ serviceRequestInputs.put("local-access-ltp-id", crossTPs.get("local-access-ltp-id"));
+ serviceRequestInputs.put("remote-access-provider-id", crossTPs.get("remote-access-provider-id"));
+ serviceRequestInputs.put("remote-access-client-id", crossTPs.get("remote-client-id"));
+ serviceRequestInputs.put("remote-access-topology-id", crossTPs.get("remote-topology-id"));
+ serviceRequestInputs.put("remote-access-node-id", crossTPs.get("remote-node-id"));
+ serviceRequestInputs.put("remote-access-ltp-id", crossTPs.get("remote-ltp-id"));
+ }
+
+ return;
+ }
+
+ // This method returns Local and remote TPs information from AAI
+ public Map getTPsfromAAI() {
+ Map<String, Object> tpInfo = new HashMap<>();
+
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.LOGICAL_LINK);
+ AAIResourcesClient client = new AAIResourcesClient();
+ Optional<LogicalLinks> result = client.get(LogicalLinks.class, uri);
+
+ if (result.isPresent()) {
+ LogicalLinks links = result.get();
+ boolean isRemoteLink = false;
+
+ links.getLogicalLink();
+
+ for (LogicalLink link : links.getLogicalLink()) {
+ AAIResultWrapper wrapper = new AAIResultWrapper(link);
+ Optional<Relationships> optRelationships = wrapper.getRelationships();
+ List<AAIResourceUri> pInterfaces = new ArrayList<>();
+ if (optRelationships.isPresent()) {
+ Relationships relationships = optRelationships.get();
+ if (!relationships.getRelatedAAIUris(AAIObjectType.EXT_AAI_NETWORK).isEmpty()) {
+ isRemoteLink = true;
+ }
+ pInterfaces.addAll(relationships.getRelatedAAIUris(AAIObjectType.P_INTERFACE));
+ }
+
+ if (isRemoteLink) {
+ // find remote p interface
+ AAIResourceUri localTP = null;
+ AAIResourceUri remoteTP = null;
+
+ AAIResourceUri pInterface0 = pInterfaces.get(0);
+
+ if (isRemotePInterface(client, pInterface0)) {
+ remoteTP = pInterfaces.get(0);
+ localTP = pInterfaces.get(1);
+ } else {
+ localTP = pInterfaces.get(0);
+ remoteTP = pInterfaces.get(1);
+ }
+
+ if (localTP != null && remoteTP != null) {
+ // give local tp
+ String tpUrl = localTP.build().toString();
+ PInterface intfLocal = client.get(PInterface.class, localTP).get();
+ tpInfo.put("local-access-node-id", tpUrl.split("/")[6]);
+
+ String[] networkRef = intfLocal.getNetworkRef().split("/");
+ if (networkRef.length == 6) {
+ tpInfo.put("local-access-provider-id", networkRef[1]);
+ tpInfo.put("local-access-client-id", networkRef[3]);
+ tpInfo.put("local-access-topology-id", networkRef[5]);
+ }
+ String ltpIdStr = tpUrl.substring(tpUrl.lastIndexOf("/") + 1);
+ if (ltpIdStr.contains("-")) {
+ tpInfo.put("local-access-ltp-id", ltpIdStr.substring(ltpIdStr.lastIndexOf("-") + 1));
+ }
+
+ // give remote tp
+ tpUrl = remoteTP.build().toString();
+ PInterface intfRemote = client.get(PInterface.class, remoteTP).get();
+ tpInfo.put("remote-access-node-id", tpUrl.split("/")[6]);
+
+ String[] networkRefRemote = intfRemote.getNetworkRef().split("/");
+
+ if (networkRefRemote.length == 6) {
+ tpInfo.put("remote-access-provider-id", networkRefRemote[1]);
+ tpInfo.put("remote-access-client-id", networkRefRemote[3]);
+ tpInfo.put("remote-access-topology-id", networkRefRemote[5]);
+ }
+ String ltpIdStrR = tpUrl.substring(tpUrl.lastIndexOf("/") + 1);
+ if (ltpIdStrR.contains("-")) {
+ tpInfo.put("remote-access-ltp-id", ltpIdStrR.substring(ltpIdStr.lastIndexOf("-") + 1));
+ }
+ return tpInfo;
+ }
+ }
+ }
+ }
+ return tpInfo;
+ }
+
+ // this method check if pInterface is remote
+ private boolean isRemotePInterface(AAIResourcesClient client, AAIResourceUri uri) {
+
+ String uriString = uri.build().toString();
+
+ if (uriString != null) {
+ // get the pnfname
+ String[] token = uriString.split("/");
+ AAIResourceUri parent = AAIUriFactory.createResourceUri(AAIObjectType.PNF, token[4]);
+
+ AAIResultWrapper wrapper = client.get(parent);
+ Optional<Relationships> optRelationships = wrapper.getRelationships();
+ if (optRelationships.isPresent()) {
+ Relationships relationships = optRelationships.get();
+
+ return !relationships.getRelatedAAIUris(AAIObjectType.EXT_AAI_NETWORK).isEmpty();
+ }
+ }
+
+ return false;
+ }
+
+ public String preProcessService(ServiceDecomposition serviceDecomposition, String uuiRequest) {
+
+ // now only for sotn
+ if (isSOTN(serviceDecomposition, uuiRequest)) {
+ // We Need to query the terminalpoint of the VPN by site location
+ // info
+ return preProcessSOTNService(serviceDecomposition, uuiRequest);
+ }
+ return uuiRequest;
+ }
+
+ public String doServiceHoming(ServiceDecomposition serviceDecomposition, String uuiRequest) {
+ // now only for sotn
+ if (isSOTN(serviceDecomposition, uuiRequest)) {
+ return doSOTNServiceHoming(serviceDecomposition, uuiRequest);
+ }
+ return uuiRequest;
+ }
+
+ private boolean isSOTN(ServiceDecomposition serviceDecomposition, String uuiRequest) {
+ // there should be a register platform , we check it very simple here.
+ return uuiRequest.contains("clientSignal") && uuiRequest.contains("vpnType");
+ }
+
+ @SuppressWarnings("unchecked")
+ private String preProcessSOTNService(ServiceDecomposition serviceDecomposition, String uuiRequest) {
+ Map<String, Object> uuiObject = getJsonObject(uuiRequest, Map.class);
+ if (uuiObject == null) {
+ return uuiRequest;
+ }
+ Map<String, Object> serviceObject =
+ (Map<String, Object>) uuiObject.getOrDefault("service", Collections.emptyMap());
+ Map<String, Object> serviceParametersObject =
+ (Map<String, Object>) serviceObject.getOrDefault("parameters", Collections.emptyMap());
+ Map<String, Object> serviceRequestInputs =
+ (Map<String, Object>) serviceParametersObject.getOrDefault("requestInputs", Collections.emptyMap());
+ List<Object> resources =
+ (List<Object>) serviceParametersObject.getOrDefault("resources", Collections.emptyList());
+ // This is a logic for demo , it could not be finalized to community.
+ String srcLocation = "";
+ String dstLocation = "";
+ String srcClientSignal = "";
+ String dstClientSignal = "";
+ // support R2 uuiReq and R1 uuiReq
+ // logic for R2 uuiRequest params in service level
+ for (Entry<String, Object> entry : serviceRequestInputs.entrySet()) {
+ if (entry.getKey().toLowerCase().contains("location")) {
+ if ("".equals(srcLocation)) {
+ srcLocation = (String) entry.getValue();
+ } else if ("".equals(dstLocation)) {
+ dstLocation = (String) entry.getValue();
+ }
+ }
+ if (entry.getKey().toLowerCase().contains("clientsignal")) {
+ if ("".equals(srcClientSignal)) {
+ srcClientSignal = (String) entry.getValue();
+ } else if ("".equals(dstClientSignal)) {
+ dstClientSignal = (String) entry.getValue();
+ }
+ }
+ }
+
+ // logic for R1 uuiRequest, params in resource level
+ for (Object resource : resources) {
+ Map<String, Object> resourceObject = (Map<String, Object>) resource;
+ Map<String, Object> resourceParametersObject = (Map<String, Object>) resourceObject.get("parameters");
+ Map<String, Object> resourceRequestInputs =
+ (Map<String, Object>) resourceParametersObject.get("requestInputs");
+ for (Entry<String, Object> entry : resourceRequestInputs.entrySet()) {
+ if (entry.getKey().toLowerCase().contains("location")) {
+ if ("".equals(srcLocation)) {
+ srcLocation = (String) entry.getValue();
+ } else if ("".equals(dstLocation)) {
+ dstLocation = (String) entry.getValue();
+ }
+ }
+ if (entry.getKey().toLowerCase().contains("clientsignal")) {
+ if ("".equals(srcClientSignal)) {
+ srcClientSignal = (String) entry.getValue();
+ } else if ("".equals(dstClientSignal)) {
+ dstClientSignal = (String) entry.getValue();
+ }
+ }
+ }
+ }
+
+ Map<String, Object> vpnRequestInputs = getVPNResourceRequestInputs(resources);
+ // here we put client signal to vpn resource inputs
+ if (null != vpnRequestInputs) {
+ vpnRequestInputs.put("src-client-signal", srcClientSignal);
+ vpnRequestInputs.put("dst-client-signal", dstClientSignal);
+ }
+
+
+ // Now we need to query terminal points from SP resourcemgr system.
+ List<Object> locationTerminalPointList = queryTerminalPointsFromServiceProviderSystem(srcLocation, dstLocation);
+ Map<String, Object> tpInfoMap = (Map<String, Object>) locationTerminalPointList.get(0);
+
+ serviceRequestInputs.put("inner-src-access-provider-id", tpInfoMap.get("access-provider-id"));
+ serviceRequestInputs.put("inner-src-access-client-id", tpInfoMap.get("access-client-id"));
+ serviceRequestInputs.put("inner-src-access-topology-id", tpInfoMap.get("access-topology-id"));
+ serviceRequestInputs.put("inner-src-access-node-id", tpInfoMap.get("access-node-id"));
+ serviceRequestInputs.put("inner-src-access-ltp-id", tpInfoMap.get("access-ltp-id"));
+ tpInfoMap = (Map<String, Object>) locationTerminalPointList.get(1);
+
+ serviceRequestInputs.put("inner-dst-access-provider-id", tpInfoMap.get("access-provider-id"));
+ serviceRequestInputs.put("inner-dst-access-client-id", tpInfoMap.get("access-client-id"));
+ serviceRequestInputs.put("inner-dst-access-topology-id", tpInfoMap.get("access-topology-id"));
+ serviceRequestInputs.put("inner-dst-access-node-id", tpInfoMap.get("access-node-id"));
+ serviceRequestInputs.put("inner-dst-access-ltp-id", tpInfoMap.get("access-ltp-id"));
+
+ String newRequest = getJsonString(uuiObject);
+ return newRequest;
+ }
+
+ private List<Object> queryTerminalPointsFromServiceProviderSystem(String srcLocation, String dstLocation) {
+ Map<String, String> locationSrc = new HashMap<>();
+ locationSrc.put("location", srcLocation);
+ Map<String, String> locationDst = new HashMap<>();
+ locationDst.put("location", dstLocation);
+ List<Map<String, String>> locations = new ArrayList<>();
+ locations.add(locationSrc);
+ locations.add(locationDst);
+ List<Object> returnList = new ArrayList<>();
+ String reqContent = getJsonString(locations);
+ String url = getThirdSPEndPoint();
+ String responseContent = sendRequest(url, "POST", reqContent);
+ if (null != responseContent) {
+ returnList = getJsonObject(responseContent, List.class);
+ }
+ return returnList;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Map<String, Object> getVPNResourceRequestInputs(List<Object> resources) {
+ for (Object resource : resources) {
+ Map<String, Object> resourceObject = (Map<String, Object>) resource;
+ Map<String, Object> resourceParametersObject = (Map<String, Object>) resourceObject.get("parameters");
+ Map<String, Object> resourceRequestInputs =
+ (Map<String, Object>) resourceParametersObject.get("requestInputs");
+ for (Entry<String, Object> entry : resourceRequestInputs.entrySet()) {
+ if (entry.getKey().toLowerCase().contains("vpntype")) {
+ return resourceRequestInputs;
+ }
+ }
+ }
+ return null;
+ }
+
+ public static void main(String args[]) {
+ String str =
+ "restconf/config/GENERIC-RESOURCE-API:services/service/eca7e542-12ba-48de-8544-fac59303b14e/service-data/networks/network/aec07806-1671-4af2-b722-53c8e320a633/network-data/";
+
+ int index1 = str.indexOf("/network/");
+ int index2 = str.indexOf("/network-data");
+
+ String str1 = str.substring(index1 + "/network/".length(), index2);
+ System.out.println(str1);
+
+ }
+
+ @SuppressWarnings("unchecked")
+ private String doSOTNServiceHoming(ServiceDecomposition serviceDecomposition, String uuiRequest) {
+ // query the route for the service.
+ Map<String, Object> uuiObject = getJsonObject(uuiRequest, Map.class);
+ if (uuiObject == null) {
+ return uuiRequest;
+ }
+ Map<String, Object> serviceObject =
+ (Map<String, Object>) uuiObject.getOrDefault("service", Collections.emptyMap());
+ Map<String, Object> serviceParametersObject =
+ (Map<String, Object>) serviceObject.getOrDefault("parameters", Collections.emptyMap());
+ Map<String, Object> serviceRequestInputs =
+ (Map<String, Object>) serviceParametersObject.getOrDefault("requestInputs", Collections.emptyMap());
+ Map<String, Object> oofQueryObject = new HashMap<>();
+ List<Object> resources =
+ (List<Object>) serviceParametersObject.getOrDefault("resources", Collections.emptyList());
+ oofQueryObject.put("src-access-provider-id", serviceRequestInputs.get("inner-src-access-provider-id"));
+ oofQueryObject.put("src-access-client-id", serviceRequestInputs.get("inner-src-access-client-id"));
+ oofQueryObject.put("src-access-topology-id", serviceRequestInputs.get("inner-src-access-topology-id"));
+ oofQueryObject.put("src-access-node-id", serviceRequestInputs.get("inner-src-access-node-id"));
+ oofQueryObject.put("src-access-ltp-id", serviceRequestInputs.get("inner-src-access-ltp-id"));
+ oofQueryObject.put("dst-access-provider-id", serviceRequestInputs.get("inner-dst-access-provider-id"));
+ oofQueryObject.put("dst-access-client-id", serviceRequestInputs.get("inner-dst-access-client-id"));
+ oofQueryObject.put("dst-access-topology-id", serviceRequestInputs.get("inner-dst-access-topology-id"));
+ oofQueryObject.put("dst-access-node-id", serviceRequestInputs.get("inner-dst-access-node-id"));
+ oofQueryObject.put("dst-access-ltp-id", serviceRequestInputs.get("inner-dst-access-ltp-id"));
+ String oofRequestReq = getJsonString(oofQueryObject);
+ String url = getOOFCalcEndPoint();
+ String responseContent = sendRequest(url, "POST", oofRequestReq);
+
+ List<Object> returnList = new ArrayList<>();
+ if (null != responseContent) {
+ returnList = getJsonObject(responseContent, List.class);
+ }
+ // in demo we have only one VPN. no cross VPNs, so get first item.
+ Map<String, Object> returnRoute = getReturnRoute(returnList);
+ Map<String, Object> vpnRequestInputs = getVPNResourceRequestInputs(resources);
+ if (null != vpnRequestInputs) {
+ vpnRequestInputs.putAll(returnRoute);
+ }
+ return getJsonString(uuiObject);
+ }
+
+ private Map<String, Object> getReturnRoute(List<Object> returnList) {
+ Map<String, Object> returnRoute = new HashMap<>();
+ for (Object returnVpn : returnList) {
+ Map<String, Object> returnVpnInfo = (Map<String, Object>) returnVpn;
+ String accessTopoId = (String) returnVpnInfo.get("access-topology-id");
+ if ("100".equals(accessTopoId)) {
+ returnRoute.putAll(returnVpnInfo);
+ } else if ("101".equals(accessTopoId)) {
+ for (String key : returnVpnInfo.keySet()) {
+ returnRoute.put("domain1-" + key, returnVpnInfo.get(key));
+ }
+ } else if ("102".equals(accessTopoId)) {
+ for (String key : returnVpnInfo.keySet()) {
+ returnRoute.put("domain2-" + key, returnVpnInfo.get(key));
+ }
+ } else {
+ for (String key : returnVpnInfo.keySet()) {
+ returnRoute.put("domain" + accessTopoId + "-" + key, returnVpnInfo.get(key));
+ }
+ }
+ }
+ return returnRoute;
+ }
+
+ private Map<String, Object> getResourceParams(Execution execution, String resourceCustomizationUuid,
+ String serviceParameters) {
+ List<String> resourceList =
+ jsonUtil.StringArrayToList(execution, JsonUtils.getJsonValue(serviceParameters, "resources"));
+ // Get the right location str for resource. default is an empty array.
+ String resourceInputsFromUui = "";
+ for (String resource : resourceList) {
+ String resCusUuid = JsonUtils.getJsonValue(resource, "resourceCustomizationUuid");
+ if (resourceCustomizationUuid.equals(resCusUuid)) {
+ String resourceParameters = JsonUtils.getJsonValue(resource, "parameters");
+ resourceInputsFromUui = JsonUtils.getJsonValue(resourceParameters, "requestInputs");
+ }
+ }
+ Map<String, Object> resourceInputsFromUuiMap = getJsonObject(resourceInputsFromUui, Map.class);
+ return resourceInputsFromUuiMap;
+ }
+
+ private static <T> T getJsonObject(String jsonstr, Class<T> type) {
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
+ try {
+ return mapper.readValue(jsonstr, type);
+ } catch (IOException e) {
+ logger.error("{} {} fail to unMarshal json", MessageEnum.RA_NS_EXC.toString(),
+ ErrorCode.BusinessProcesssError.getValue(), e);
+ }
+ return null;
+ }
+
+ public static String getJsonString(Object srcObj) {
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
+ String jsonStr = null;
+ try {
+ jsonStr = mapper.writeValueAsString(srcObj);
+ } catch (JsonProcessingException e) {
+ logger.debug("SdcToscaParserException", e);
+ }
+ return jsonStr;
+ }
+
+ private static String sendRequest(String url, String methodType, String content) {
+
+ String msbUrl = url;
+ HttpRequestBase method = null;
+ HttpResponse httpResponse = null;
+
+ try {
+ int timeout = DEFAULT_TIME_OUT;
+
+ RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(timeout).setConnectTimeout(timeout)
+ .setConnectionRequestTimeout(timeout).build();
+
+ HttpClient client = HttpClientBuilder.create().build();
+
+ if ("POST".equals(methodType.toUpperCase())) {
+ HttpPost httpPost = new HttpPost(msbUrl);
+ httpPost.setConfig(requestConfig);
+ httpPost.setEntity(new StringEntity(content, ContentType.APPLICATION_JSON));
+ method = httpPost;
+ } else if ("PUT".equals(methodType.toUpperCase())) {
+ HttpPut httpPut = new HttpPut(msbUrl);
+ httpPut.setConfig(requestConfig);
+ httpPut.setEntity(new StringEntity(content, ContentType.APPLICATION_JSON));
+ method = httpPut;
+ } else if ("GET".equals(methodType.toUpperCase())) {
+ HttpGet httpGet = new HttpGet(msbUrl);
+ httpGet.setConfig(requestConfig);
+ httpGet.addHeader("X-FromAppId", "MSO");
+ httpGet.addHeader("Accept", "application/json");
+ method = httpGet;
+ } else if ("DELETE".equals(methodType.toUpperCase())) {
+ HttpDelete httpDelete = new HttpDelete(msbUrl);
+ httpDelete.setConfig(requestConfig);
+ method = httpDelete;
+ }
+
+ httpResponse = client.execute(method);
+ String responseContent = null;
+ if (null != httpResponse && httpResponse.getEntity() != null) {
+ try {
+ responseContent = EntityUtils.toString(httpResponse.getEntity(), "UTF-8");
+ } catch (ParseException e) {
+ logger.debug("ParseException in sendrequest", e);
+ } catch (IOException e) {
+ logger.debug("IOException in sendrequest", e);
+ }
+ }
+ if (null != method) {
+ method.reset();
+ }
+ method = null;
+ return responseContent;
+
+ } catch (SocketTimeoutException | ConnectTimeoutException e) {
+ return null;
+
+ } catch (Exception e) {
+ return null;
+
+ } finally {
+ if (httpResponse != null) {
+ try {
+ EntityUtils.consume(httpResponse.getEntity());
+ } catch (Exception e) {
+ }
+ }
+ if (method != null) {
+ try {
+ method.reset();
+ } catch (Exception e) {
+
+ }
+ }
+ }
+ }
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java
index 4c9bb4259e..5451f9ff57 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java
@@ -27,7 +27,6 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
@@ -52,7 +51,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
-
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -69,30 +67,31 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
private static final String TOPOLOGY_PROPERTIES = "topology.properties";
public static final String ONAP_IP = "ONAP_IP";
- private static final String POST_BODY_TEMPLATE = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://org.onap.so/requestsdb\"><soapenv:Header/><soapenv:Body>\n"+
- " <ns:updateResourceOperationStatus>\n"+
- " <errorCode>$errorCode</errorCode>\n"+
- " <jobId>$jobId</jobId>\n"+
- " <operType>$operType</operType>\n"+
- " <operationId>$operationId</operationId>\n"+
- " <progress>$progress</progress>\n"+
- " <resourceTemplateUUID>$resourceTemplateUUID</resourceTemplateUUID>\n"+
- " <serviceId>$serviceId</serviceId>\n"+
- " <status>$status</status>\n"+
- " <statusDescription>$statusDescription</statusDescription>\n"+
- " </ns:updateResourceOperationStatus></soapenv:Body></soapenv:Envelope>";
-
- private static final String GET_BODY_TEMPLATE = " <soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://org.onap.so/requestsdb\"><soapenv:Header/><soapenv:Body>\n" +
- " <ns:getResourceOperationStatus>\n" +
- " <operationId>$operationId</operationId>\n" +
- " <resourceTemplateUUID>$resourceTemplateUUID</resourceTemplateUUID>\n" +
- " <serviceId>$serviceId</serviceId>\n" +
- " </ns:getResourceOperationStatus></soapenv:Body></soapenv:Envelope>";
+ private static final String POST_BODY_TEMPLATE =
+ "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://org.onap.so/requestsdb\"><soapenv:Header/><soapenv:Body>\n"
+ + " <ns:updateResourceOperationStatus>\n"
+ + " <errorCode>$errorCode</errorCode>\n" + " <jobId>$jobId</jobId>\n"
+ + " <operType>$operType</operType>\n"
+ + " <operationId>$operationId</operationId>\n"
+ + " <progress>$progress</progress>\n"
+ + " <resourceTemplateUUID>$resourceTemplateUUID</resourceTemplateUUID>\n"
+ + " <serviceId>$serviceId</serviceId>\n"
+ + " <status>$status</status>\n"
+ + " <statusDescription>$statusDescription</statusDescription>\n"
+ + " </ns:updateResourceOperationStatus></soapenv:Body></soapenv:Envelope>";
+
+ private static final String GET_BODY_TEMPLATE =
+ " <soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://org.onap.so/requestsdb\"><soapenv:Header/><soapenv:Body>\n"
+ + " <ns:getResourceOperationStatus>\n"
+ + " <operationId>$operationId</operationId>\n"
+ + " <resourceTemplateUUID>$resourceTemplateUUID</resourceTemplateUUID>\n"
+ + " <serviceId>$serviceId</serviceId>\n"
+ + " </ns:getResourceOperationStatus></soapenv:Body></soapenv:Envelope>";
private void updateResOperStatus(ResourceOperationStatus resourceOperationStatus) throws RouteException {
logger.info("AbstractSdncOperationTask.updateResOperStatus begin!");
- String requestsdbEndPoint = env.getProperty("mso.adapters.openecomp.db.endpoint");
+ String requestsdbEndPoint = env.getProperty("mso.adapters.openecomp.db.endpoint");
HttpPost httpPost = new HttpPost(requestsdbEndPoint);
httpPost.addHeader("Authorization", "Basic YnBlbDpwYXNzd29yZDEk");
httpPost.addHeader("Content-type", "application/soap+xml");
@@ -119,12 +118,13 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
String result = null;
String errorMsg;
- try(CloseableHttpClient httpClient = HttpClients.createDefault()) {
+ try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
CloseableHttpResponse closeableHttpResponse = httpClient.execute(httpPost);
result = EntityUtils.toString(closeableHttpResponse.getEntity());
logger.info("result = {}", result);
- if(closeableHttpResponse.getStatusLine().getStatusCode() != 200) {
- logger.info("exception: fail for status code = {}", closeableHttpResponse.getStatusLine().getStatusCode());
+ if (closeableHttpResponse.getStatusLine().getStatusCode() != 200) {
+ logger.info("exception: fail for status code = {}",
+ closeableHttpResponse.getStatusLine().getStatusCode());
throw new RouteException(result, "SERVICE_GET_ERR");
}
@@ -171,9 +171,10 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
return getBody;
}
- private ResourceOperationStatus getResourceOperationStatus(String serviceId, String operationId, String resourceTemplateUUID) throws RouteException {
+ private ResourceOperationStatus getResourceOperationStatus(String serviceId, String operationId,
+ String resourceTemplateUUID) throws RouteException {
logger.info("AbstractSdncOperationTask.getResourceOperationStatus begin!");
- String requestsdbEndPoint = env.getProperty("mso.adapters.openecomp.db.endpoint");
+ String requestsdbEndPoint = env.getProperty("mso.adapters.openecomp.db.endpoint");
HttpPost httpPost = new HttpPost(requestsdbEndPoint);
httpPost.addHeader("Authorization", "Basic YnBlbDpwYXNzd29yZDEk");
httpPost.addHeader("Content-type", "application/soap+xml");
@@ -224,7 +225,8 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
logger.error("exception: AbstractSdncOperationTask.fail!:", e);
logger.error(Arrays.toString(e.getStackTrace()));
execution.setVariable("SDNCA_SuccessIndicator", false);
- updateProgress(execution, RequestsDbConstant.Status.ERROR, null, "100", "sendRestrequestAndHandleResponse finished!");
+ updateProgress(execution, RequestsDbConstant.Status.ERROR, null, "100",
+ "sendRestrequestAndHandleResponse finished!");
}
logger.info("AbstractSdncOperationTask.execute end!");
@@ -247,15 +249,11 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
return inputs;
}
- public abstract void sendRestrequestAndHandleResponse(DelegateExecution execution,
- Map<String, String> inputs,
- GenericResourceApi genericResourceApiClient) throws Exception;
+ public abstract void sendRestrequestAndHandleResponse(DelegateExecution execution, Map<String, String> inputs,
+ GenericResourceApi genericResourceApiClient) throws Exception;
- public void updateProgress(DelegateExecution execution,
- String status,
- String errorCode,
- String progress,
- String statusDescription) {
+ public void updateProgress(DelegateExecution execution, String status, String errorCode, String progress,
+ String statusDescription) {
logger.info("AbstractSdncOperationTask.updateProgress begin!");
String serviceId = (String) execution.getVariable("serviceId");
serviceId = StringUtils.isBlank(serviceId) ? (String) execution.getVariable("serviceInstanceId") : serviceId;
@@ -265,7 +263,8 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
resourceTemplateId = StringUtils.isBlank(resourceTemplateId) ? "" : resourceTemplateUUID;
resourceTemplateUUID = StringUtils.isBlank(resourceTemplateUUID) ? resourceTemplateId : resourceTemplateUUID;
try {
- ResourceOperationStatus resourceOperationStatus = getResourceOperationStatus(serviceId, operationId, resourceTemplateUUID);
+ ResourceOperationStatus resourceOperationStatus =
+ getResourceOperationStatus(serviceId, operationId, resourceTemplateUUID);
if (!StringUtils.isBlank(status)) {
resourceOperationStatus.setStatus(status);
}
@@ -284,8 +283,8 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
logger.info("exception: AbstractSdncOperationTask.updateProgress fail!");
logger.error("exception: AbstractSdncOperationTask.updateProgress fail:", exception);
logger.error("{} {} {} {} {}", MessageEnum.GENERAL_EXCEPTION.toString(),
- " updateProgress catch exception: ", this.getTaskName(),
- ErrorCode.UnknownError.getValue(), exception.getClass().toString());
+ " updateProgress catch exception: ", this.getTaskName(), ErrorCode.UnknownError.getValue(),
+ exception.getClass().toString());
}
}
@@ -293,11 +292,11 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
protected boolean isSend2SdncDirectly() {
logger.info("AbstractSdncOperationTask.isSend2SdncDirectly begin!");
String sdncHost = UrnPropertiesReader.getVariable("sdnc.host");
- if (!StringUtils.isBlank(sdncHost)) {
- logger.info("AbstractSdncOperationTask.isSend2SdncDirectly = true.");
- return true;
- }
-
+ if (!StringUtils.isBlank(sdncHost)) {
+ logger.info("AbstractSdncOperationTask.isSend2SdncDirectly = true.");
+ return true;
+ }
+
logger.info("AbstractSdncOperationTask.isSend2SdncDirectly = false.");
return false;
}
@@ -305,7 +304,7 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
protected String getSdncIp() {
logger.info("AbstractSdncOperationTask.getSdncIp begin.");
String sdncIp = null;
- sdncIp = UrnPropertiesReader.getVariable("sdnc-ip");
+ sdncIp = UrnPropertiesReader.getVariable("sdnc-ip");
String returnIp = StringUtils.isBlank(sdncIp) || !isIp(sdncIp) ? null : sdncIp;
logger.info("AbstractSdncOperationTask.getSdncIp: sdncIp = {}", returnIp);
return returnIp;
@@ -340,7 +339,7 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
strMsbPort = env.getProperty("msb.port", String.valueOf(DEFAULT_MSB_PORT));
}
msbPort = Integer.valueOf(strMsbPort);
-
+
logger.info("AbstractSdncOperationTask.getGenericResourceApiClient msbIp = " + msbIp + " msbPort = " + msbPort);
MSBServiceClient msbClient = new MSBServiceClient(msbIp, msbPort);
RestServiceCreater restServiceCreater = new RestServiceCreater(msbClient);
@@ -353,6 +352,7 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
}
public String getProcessKey(DelegateExecution execution) {
- return execution.getProcessEngineServices().getRepositoryService().getProcessDefinition(execution.getProcessDefinitionId()).getKey();
+ return execution.getProcessEngineServices().getRepositoryService()
+ .getProcessDefinition(execution.getProcessDefinitionId()).getKey();
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java
index a5c609dc2a..4d58439fda 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java
@@ -23,7 +23,6 @@
package org.onap.so.bpmn.infrastructure.workflow.serviceTask;
import java.util.Map;
-
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
@@ -49,29 +48,30 @@ public class SdncNetworkTopologyOperationTask extends AbstractSdncOperationTask
private static final String URL = "/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation";
@Override
- public void sendRestrequestAndHandleResponse(DelegateExecution execution,
- Map<String, String> inputs,
- GenericResourceApi genericResourceApiClient) throws Exception {
+ public void sendRestrequestAndHandleResponse(DelegateExecution execution, Map<String, String> inputs,
+ GenericResourceApi genericResourceApiClient) throws Exception {
logger.info("SdncNetworkTopologyOperationTask.sendRestrequestAndHandleResponse begin!");
- updateProgress(execution, RequestsDbConstant.Status.PROCESSING, null, "40", "sendRestrequestAndHandleResponse begin!");
+ updateProgress(execution, RequestsDbConstant.Status.PROCESSING, null, "40",
+ "sendRestrequestAndHandleResponse begin!");
NetworkRpcInputEntityBuilder builder = new NetworkRpcInputEntityBuilder();
RpcNetworkTopologyOperationInputEntity inputEntity = builder.build(execution, inputs);
updateProgress(execution, RequestsDbConstant.Status.PROCESSING, null, "50", "RequestBody build finished!");
RpcNetworkTopologyOperationOutputEntity outputEntity;
if (!isSend2SdncDirectly()) {
- outputEntity = genericResourceApiClient.postNetworkTopologyOperation
- (HeaderUtil.DefaulAuth, inputEntity).execute().body();
- updateProgress(execution, null, null, "90", "sendRestrequestAndHandleResponse finished!");
- saveOutput(execution, outputEntity);
+ outputEntity = genericResourceApiClient.postNetworkTopologyOperation(HeaderUtil.DefaulAuth, inputEntity)
+ .execute().body();
+ updateProgress(execution, null, null, "90", "sendRestrequestAndHandleResponse finished!");
+ saveOutput(execution, outputEntity);
} else {
send2SdncDirectly(HeaderUtil.DefaulAuth, inputEntity);
}
- updateProgress(execution, RequestsDbConstant.Status.FINISHED, null, RequestsDbConstant.Progress.ONE_HUNDRED, "execute finished!");
+ updateProgress(execution, RequestsDbConstant.Status.FINISHED, null, RequestsDbConstant.Progress.ONE_HUNDRED,
+ "execute finished!");
logger.info("SdncNetworkTopologyOperationTask.sendRestrequestAndHandleResponse end!");
}
- private void send2SdncDirectly(String defaulAuth,
- RpcNetworkTopologyOperationInputEntity inputEntity) throws RouteException {
+ private void send2SdncDirectly(String defaulAuth, RpcNetworkTopologyOperationInputEntity inputEntity)
+ throws RouteException {
logger.info("SdncNetworkTopologyOperationTask.send2SdncDirectly begin!");
String url = "http://" + getSdncIp() + ":" + getSdncPort() + URL;
HttpPost httpPost = new HttpPost(url);
@@ -84,7 +84,8 @@ public class SdncNetworkTopologyOperationTask extends AbstractSdncOperationTask
logger.info("SdncNetworkTopologyOperationTask.send2SdncDirectly end!");
}
- private void saveOutput(DelegateExecution execution, RpcNetworkTopologyOperationOutputEntity output) throws RouteException {
+ private void saveOutput(DelegateExecution execution, RpcNetworkTopologyOperationOutputEntity output)
+ throws RouteException {
logger.info("SdncNetworkTopologyOperationTask.saveOutput begin!");
String responseCode = output.getOutput().getResponseCode();
if (!"200".equals(responseCode)) {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java
index 2fd550dbb8..4fb6817a39 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java
@@ -24,7 +24,6 @@ package org.onap.so.bpmn.infrastructure.workflow.serviceTask;
import java.util.Map;
-
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
@@ -50,9 +49,8 @@ public class SdncServiceTopologyOperationTask extends AbstractSdncOperationTask
private static final String URL = "/restconf/operations/GENERIC-RESOURCE-API:service-topology-operation";
@Override
- public void sendRestrequestAndHandleResponse(DelegateExecution execution,
- Map<String, String> inputs,
- GenericResourceApi genericResourceApiClient) throws Exception {
+ public void sendRestrequestAndHandleResponse(DelegateExecution execution, Map<String, String> inputs,
+ GenericResourceApi genericResourceApiClient) throws Exception {
logger.info("SdncServiceTopologyOperationTask.sendRestrequestAndHandleResponse begin!");
updateProgress(execution, null, null, "40", "sendRestrequestAndHandleResponse begin!");
ServiceRpcInputEntityBuilder builder = new ServiceRpcInputEntityBuilder();
@@ -60,10 +58,10 @@ public class SdncServiceTopologyOperationTask extends AbstractSdncOperationTask
updateProgress(execution, null, null, "50", "RequestBody build finished!");
RpcServiceTopologyOperationOutputEntity outputEntity;
if (!isSend2SdncDirectly()) {
- outputEntity = genericResourceApiClient.postServiceTopologyOperation
- (HeaderUtil.DefaulAuth, inputEntity).execute().body();
- updateProgress(execution, null, null, "90", "sendRestrequestAndHandleResponse finished!");
- saveOutput(execution, outputEntity);
+ outputEntity = genericResourceApiClient.postServiceTopologyOperation(HeaderUtil.DefaulAuth, inputEntity)
+ .execute().body();
+ updateProgress(execution, null, null, "90", "sendRestrequestAndHandleResponse finished!");
+ saveOutput(execution, outputEntity);
} else {
send2SdncDirectly(HeaderUtil.DefaulAuth, inputEntity);
}
@@ -71,8 +69,8 @@ public class SdncServiceTopologyOperationTask extends AbstractSdncOperationTask
}
- private void send2SdncDirectly(String defaulAuth,
- RpcServiceTopologyOperationInputEntity inputEntity) throws RouteException {
+ private void send2SdncDirectly(String defaulAuth, RpcServiceTopologyOperationInputEntity inputEntity)
+ throws RouteException {
logger.info("SdncServiceTopologyOperationTask.send2SdncDirectly begin!");
String url = getSdncHost() + URL;
HttpPost httpPost = new HttpPost(url);
@@ -85,7 +83,8 @@ public class SdncServiceTopologyOperationTask extends AbstractSdncOperationTask
logger.info("SdncServiceTopologyOperationTask.send2SdncDirectly end!");
}
- private void saveOutput(DelegateExecution execution, RpcServiceTopologyOperationOutputEntity output) throws Exception {
+ private void saveOutput(DelegateExecution execution, RpcServiceTopologyOperationOutputEntity output)
+ throws Exception {
logger.info("SdncServiceTopologyOperationTask.saveOutput begin!");
String responseCode = output.getOutput().getResponseCode();
if (!"200".equals(responseCode)) {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java
index f54d6692d6..001d8fb6c0 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java
@@ -23,7 +23,6 @@
package org.onap.so.bpmn.infrastructure.workflow.serviceTask;
import java.util.Map;
-
import org.apache.commons.lang3.StringUtils;
import org.onap.msb.sdk.httpclient.RestServiceCreater;
import org.onap.msb.sdk.httpclient.msb.MSBServiceClient;
@@ -46,33 +45,32 @@ public class SdncUnderlayVpnOperationClient {
private static Logger logger = LoggerFactory.getLogger(SdncUnderlayVpnOperationClient.class);
- public boolean excute(String msbIp,
- int msbPort,
- Map<String, String> inputs,
- String iServiceID,
- String iOperationID,
- String resourceTemplateUUID_i){
- ResourceOperationStatusId id = new ResourceOperationStatusId(iServiceID, iOperationID, resourceTemplateUUID_i);
+ public boolean excute(String msbIp, int msbPort, Map<String, String> inputs, String iServiceID, String iOperationID,
+ String resourceTemplateUUID_i) {
+ ResourceOperationStatusId id = new ResourceOperationStatusId(iServiceID, iOperationID, resourceTemplateUUID_i);
GenericResourceApi genericResourceApiClient = getGenericResourceApiClient(msbIp, msbPort);
updateProgress(id, RequestsDbConstant.Status.PROCESSING, null, "10", "execute begin!");
return sendRestrequestAndHandleResponse(id, inputs, genericResourceApiClient);
}
- public boolean sendRestrequestAndHandleResponse(ResourceOperationStatusId id, Map<String, String> inputs, GenericResourceApi genericResourceApiClient){
+ public boolean sendRestrequestAndHandleResponse(ResourceOperationStatusId id, Map<String, String> inputs,
+ GenericResourceApi genericResourceApiClient) {
updateProgress(id, null, null, "40", "sendRestrequestAndHandleResponse begin!");
NetworkRpcInputEntityBuilder builder = new NetworkRpcInputEntityBuilder();
RpcNetworkTopologyOperationInputEntity body = builder.build(null, inputs);
updateProgress(id, null, null, "50", "RequestBody build finished!");
- //RpcNetworkTopologyOperationOutputEntity networkRpcOutputEntiy = null;
+ // RpcNetworkTopologyOperationOutputEntity networkRpcOutputEntiy = null;
try {
- genericResourceApiClient.postNetworkTopologyOperation(HeaderUtil.DefaulAuth ,body).execute().body();
+ genericResourceApiClient.postNetworkTopologyOperation(HeaderUtil.DefaulAuth, body).execute().body();
} catch (Exception e) {
logger.debug("Exception: ", e);
- updateProgress(id, RequestsDbConstant.Status.ERROR, null, null, "sendRestrequestAndHandleResponse exception:" + e.getMessage());
+ updateProgress(id, RequestsDbConstant.Status.ERROR, null, null,
+ "sendRestrequestAndHandleResponse exception:" + e.getMessage());
return false;
}
updateProgress(id, null, null, "90", "sendRestrequestAndHandleResponse finished!");
- updateProgress(id, RequestsDbConstant.Status.FINISHED, null, RequestsDbConstant.Progress.ONE_HUNDRED, "execute finished!");
+ updateProgress(id, RequestsDbConstant.Status.FINISHED, null, RequestsDbConstant.Progress.ONE_HUNDRED,
+ "execute finished!");
return true;
}
@@ -88,13 +86,11 @@ public class SdncUnderlayVpnOperationClient {
return restServiceCreater.createService(GenericResourceApi.class);
}
- public void updateProgress(ResourceOperationStatusId id, String status,
- String errorCode,
- String progress,
- String statusDescription) {
-
-
- ResourceOperationStatus resourceOperationStatus = new ResourceOperationStatus();//rosRepo.getOne(id);
+ public void updateProgress(ResourceOperationStatusId id, String status, String errorCode, String progress,
+ String statusDescription) {
+
+
+ ResourceOperationStatus resourceOperationStatus = new ResourceOperationStatus();// rosRepo.getOne(id);
if (!StringUtils.isBlank(status)) {
resourceOperationStatus.setStatus(status);
}
@@ -107,7 +103,7 @@ public class SdncUnderlayVpnOperationClient {
if (!StringUtils.isBlank(statusDescription)) {
resourceOperationStatus.setStatusDescription(statusDescription);
}
- //rosRepo.save(resourceOperationStatus);
+ // rosRepo.save(resourceOperationStatus);
}
private void saveOutput() {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java
index 8bc9dce966..5b7f3bb432 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java
@@ -41,8 +41,13 @@ public class SdncUnderlayVpnPreprocessTask extends BaseTask {
serviceId = StringUtils.isBlank(serviceId) ? (String) execution.getVariable("serviceInstanceId") : serviceId;
String operationId = (String) execution.getVariable("operationId");
String resourceTemplateUUID = (String) execution.getVariable("resourceTemplateUUID");
- resourceTemplateUUID = StringUtils.isBlank(resourceTemplateUUID) ? (String) execution.getVariable("resourceTemplateId") : resourceTemplateUUID;
- ResourceOperationStatus resourceOperationStatus = new ResourceOperationStatus();//rosRepo.getOne(new ResourceOperationStatusId(serviceId, operationId, resourceTemplateUUID));
+ resourceTemplateUUID =
+ StringUtils.isBlank(resourceTemplateUUID) ? (String) execution.getVariable("resourceTemplateId")
+ : resourceTemplateUUID;
+ ResourceOperationStatus resourceOperationStatus = new ResourceOperationStatus();// rosRepo.getOne(new
+ // ResourceOperationStatusId(serviceId,
+ // operationId,
+ // resourceTemplateUUID));
return resourceOperationStatus.getOperType();
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/GenericResourceApi.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/GenericResourceApi.java
index a837782a2c..ca9269242c 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/GenericResourceApi.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/GenericResourceApi.java
@@ -34,15 +34,15 @@ public interface GenericResourceApi {
@POST("/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation")
Call<ResponseBody> postNetworkTopologyOperation(@Header("Authorization") String authorization,
- @Body RequestBody input);
+ @Body RequestBody input);
@POST("/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation")
- Call<RpcNetworkTopologyOperationOutputEntity> postNetworkTopologyOperation(@Header("Authorization") String authorization,
- @Body RpcNetworkTopologyOperationInputEntity input);
+ Call<RpcNetworkTopologyOperationOutputEntity> postNetworkTopologyOperation(
+ @Header("Authorization") String authorization, @Body RpcNetworkTopologyOperationInputEntity input);
@POST("/restconf/operations/GENERIC-RESOURCE-API:service-topology-operation")
- Call<RpcServiceTopologyOperationOutputEntity> postServiceTopologyOperation(@Header("Authorization") String authorization,
- @Body RpcServiceTopologyOperationInputEntity input);
+ Call<RpcServiceTopologyOperationOutputEntity> postServiceTopologyOperation(
+ @Header("Authorization") String authorization, @Body RpcServiceTopologyOperationInputEntity input);
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtil.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtil.java
index 696be02809..3da5b0de70 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtil.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtil.java
@@ -36,8 +36,7 @@ public class HeaderUtil {
private static String base64Encode(String str) {
String base64 = str;
try {
- base64 = Base64.getEncoder()
- .encodeToString(str.getBytes("utf-8"));
+ base64 = Base64.getEncoder().encodeToString(str.getBytes("utf-8"));
} catch (Exception ex) {
}
return base64;
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java
index 961b846ace..21b14c35f9 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java
@@ -24,7 +24,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
-
import org.apache.commons.lang3.StringUtils;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.OnapModelInformationEntity;
@@ -35,205 +34,206 @@ import org.onap.so.requestsdb.RequestsDbConstant;
public abstract class AbstractBuilder<I, O> {
- public static final String OPERATION_TYPE = "operationType";
- public static final String RESOURCE_TYPE = "resourceType";
-
- public enum RequestAction {
- CREATE_NETWORK_INSTANCE(0, "CreateNetworkInstance"),
- ACTIVATE_NETWORK_INSTANCE(1, "ActivateNetworkInstance"),
- CREATE_SERVICE_INSTANCE(2, "CreateServiceInstance"),
- DELETE_SERVICE_INSTANCE(3, "DeleteServiceInstance"),
- DELETE_NETWORK_INSTANCE(4, "DeleteNetworkInstance"),
- CREATE_VNF_INSTANCE(5, "CreateVnfInstance"),
- ACTIVATE_VNF_INSTANCE(6, "ActivateVnfInstance"),
- DELETE_VNF_INSTANCE(7, "DeleteVnfInstance"),
- CREATE_VF_MODULE_INSTANCE(8, "CreateVfModuleInstance"),
- ACTIVATE_VF_MODULE_INSTANCE(9, "ActivateVfModuleInstance"),
- DELETE_VF_MODULE_INSTANCE(10, "DeleteVfModuleInstance"),
- CREATE_CONTRAIL_ROUTE_INSTANCE(11, "CreateContrailRouteInstance"),
- DELETE_CONTRAIL_ROUTE_INSTANCE(12, "DeleteContrailRouteInstance"),
- CREATE_SECURITY_ZONE_INSTANCE(13, "CreateSecurityZoneInstance"),
- DELETE_SECURITY_ZONE_INSTANCE(14, "DeleteSecurityZoneInstance"),
- ACTIVATE_DCI_NETWORK_INSTANCE(15, "ActivateDCINetworkInstance"),
- DEACTIVATE_DCI_NETWORK_INSTANCE(16, "DeActivateDCINetworkInstance");
-
- String name;
- int value;
-
- private RequestAction(int value, String name) {
- this.value = value;
- this.name = name;
- }
-
- public String getName() {
- return this.name;
- }
-
- public int getIntValue() {
- return this.value;
- }
- }
-
- public enum SvcAction {
- RESERVE(0, "reserve"),
- ASSIGN(1, "assign"),
- ACTIVATE(2, "activate"),
- DELETE(3, "delete"),
- CHANGEASSIGN(4, "changeassign"),
- CHANGEDELETE(5, "changedelete"),
- ROLLBACK(6, "rollback"),
- DEACTIVATE(7, "deactivate"),
- UNASSIGN(8, "unassign"),
- CREATE(9, "create");
-
- String name;
- int value;
-
- private SvcAction(int value, String name) {
- this.value = value;
- this.name = name;
- }
-
- public String getName() {
- return this.name;
- }
-
- public int getIntValue() {
- return this.value;
- }
- }
-
- protected String requestId = null;
-
- abstract O build(DelegateExecution execution, I input) throws Exception;
-
- protected String getRequestAction(DelegateExecution execution) {
- String action = /*RequestInformation.*/RequestAction.CREATE_NETWORK_INSTANCE.getName();
- String operType = (String) execution.getVariable(OPERATION_TYPE);
- String resourceType = (String)execution.getVariable(RESOURCE_TYPE);
- if (!StringUtils.isBlank(operType)) {
- if (RequestsDbConstant.OperationType.DELETE.equalsIgnoreCase(operType)) {
- if (isOverlay(resourceType)) {
- action = /*RequestInformation.*/RequestAction.DEACTIVATE_DCI_NETWORK_INSTANCE.getName();
- } else if (isUnderlay(resourceType)) {
- action = /*RequestInformation.*/RequestAction.DELETE_NETWORK_INSTANCE.getName();
- } else {
- action = /*RequestInformation.*/RequestAction.DELETE_SERVICE_INSTANCE.getName();
- }
- } else if (RequestsDbConstant.OperationType.CREATE.equalsIgnoreCase(operType)) {
- if (isOverlay(resourceType)) {
- action = /*RequestInformation.*/RequestAction.ACTIVATE_DCI_NETWORK_INSTANCE.getName();
- } else if (isUnderlay(resourceType)) {
- action = /*RequestInformation.*/RequestAction.CREATE_NETWORK_INSTANCE.getName();
- } else {
- action = /*RequestInformation.*/RequestAction.CREATE_SERVICE_INSTANCE.getName();
- }
- }
- }
- return action;
- }
-
- private boolean isOverlay(String resourceType) {
- return !StringUtils.isBlank(resourceType) && resourceType.toLowerCase().contains("overlay");
- }
-
- private boolean isUnderlay(String resourceType) {
- return !StringUtils.isBlank(resourceType) && resourceType.toLowerCase().contains("underlay");
- }
-
- protected String getSvcAction(DelegateExecution execution) {
- String action = /*SdncRequestHeader.*/SvcAction.CREATE.getName();
- String operType = (String) execution.getVariable(OPERATION_TYPE);
- String resourceType = (String)execution.getVariable(RESOURCE_TYPE);
- if (!StringUtils.isBlank(operType)) {
- if (RequestsDbConstant.OperationType.DELETE.equalsIgnoreCase(operType)) {
- if (isOverlay(resourceType)) {
- action = /*SdncRequestHeader.*/SvcAction.DEACTIVATE.getName();
- } else if (isUnderlay(resourceType)) {
- action = /*SdncRequestHeader.*/SvcAction.DELETE.getName();
- } else {
- action = /*SdncRequestHeader.*/SvcAction.UNASSIGN.getName();
- }
- } else if (RequestsDbConstant.OperationType.CREATE.equalsIgnoreCase(operType)) {
- if (isOverlay(resourceType)) {
- action = /*SdncRequestHeader.*/SvcAction.ACTIVATE.getName();
- } else if (isUnderlay(resourceType)) {
- action = /*SdncRequestHeader.*/SvcAction.CREATE.getName();
- } else {
- action = /*SdncRequestHeader.*/SvcAction.ASSIGN.getName();
- }
- }
- }
- return action;
- }
-
- protected synchronized String getRequestId(DelegateExecution execution) {
- if (StringUtils.isBlank(requestId)) {
- requestId = (String) execution.getVariable("msoRequestId");
- if (StringUtils.isBlank(requestId)) {
- requestId = UUID.randomUUID().toString();
- }
- }
- return requestId;
- }
-
- protected OnapModelInformationEntity getOnapServiceModelInformationEntity(DelegateExecution execution) {
- OnapModelInformationEntity onapModelInformationEntity = new OnapModelInformationEntity();
- String modelInvariantUuid = (String) execution.getVariable("modelInvariantUuid");
- String modelVersion = (String) execution.getVariable("modelVersion");
- String modelUuid = (String) execution.getVariable("modelUuid");
- String modelName = (String) execution.getVariable("serviceModelName");
- onapModelInformationEntity.setModelInvariantUuid(modelInvariantUuid);
- onapModelInformationEntity.setModelVersion(modelVersion);
- onapModelInformationEntity.setModelUuid(modelUuid);
- onapModelInformationEntity.setModelName(modelName);
- return onapModelInformationEntity;
- }
-
- protected OnapModelInformationEntity getOnapNetworkModelInformationEntity(DelegateExecution execution) {
- OnapModelInformationEntity onapModelInformationEntity = new OnapModelInformationEntity();
- String modelInvariantUuid = (String) execution.getVariable("resourceInvariantUUID");
- String modelVersion = (String) execution.getVariable("modelVersion");
- String modelUuid = (String) execution.getVariable("resourceUUID");
- String modelName = (String) execution.getVariable(RESOURCE_TYPE);
- onapModelInformationEntity.setModelInvariantUuid(modelInvariantUuid);
- onapModelInformationEntity.setModelVersion(modelVersion);
- onapModelInformationEntity.setModelUuid(modelUuid);
- onapModelInformationEntity.setModelName(modelName);
- return onapModelInformationEntity;
+ public static final String OPERATION_TYPE = "operationType";
+ public static final String RESOURCE_TYPE = "resourceType";
+
+ public enum RequestAction {
+ CREATE_NETWORK_INSTANCE(0, "CreateNetworkInstance"), ACTIVATE_NETWORK_INSTANCE(1,
+ "ActivateNetworkInstance"), CREATE_SERVICE_INSTANCE(2,
+ "CreateServiceInstance"), DELETE_SERVICE_INSTANCE(3,
+ "DeleteServiceInstance"), DELETE_NETWORK_INSTANCE(4,
+ "DeleteNetworkInstance"), CREATE_VNF_INSTANCE(5,
+ "CreateVnfInstance"), ACTIVATE_VNF_INSTANCE(6,
+ "ActivateVnfInstance"), DELETE_VNF_INSTANCE(7,
+ "DeleteVnfInstance"), CREATE_VF_MODULE_INSTANCE(8,
+ "CreateVfModuleInstance"), ACTIVATE_VF_MODULE_INSTANCE(
+ 9,
+ "ActivateVfModuleInstance"), DELETE_VF_MODULE_INSTANCE(
+ 10,
+ "DeleteVfModuleInstance"), CREATE_CONTRAIL_ROUTE_INSTANCE(
+ 11,
+ "CreateContrailRouteInstance"), DELETE_CONTRAIL_ROUTE_INSTANCE(
+ 12,
+ "DeleteContrailRouteInstance"), CREATE_SECURITY_ZONE_INSTANCE(
+ 13,
+ "CreateSecurityZoneInstance"), DELETE_SECURITY_ZONE_INSTANCE(
+ 14,
+ "DeleteSecurityZoneInstance"), ACTIVATE_DCI_NETWORK_INSTANCE(
+ 15,
+ "ActivateDCINetworkInstance"), DEACTIVATE_DCI_NETWORK_INSTANCE(
+ 16,
+ "DeActivateDCINetworkInstance");
+
+ String name;
+ int value;
+
+ private RequestAction(int value, String name) {
+ this.value = value;
+ this.name = name;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public int getIntValue() {
+ return this.value;
+ }
+ }
+
+ public enum SvcAction {
+ RESERVE(0, "reserve"), ASSIGN(1, "assign"), ACTIVATE(2, "activate"), DELETE(3, "delete"), CHANGEASSIGN(4,
+ "changeassign"), CHANGEDELETE(5, "changedelete"), ROLLBACK(6,
+ "rollback"), DEACTIVATE(7, "deactivate"), UNASSIGN(8, "unassign"), CREATE(9, "create");
+
+ String name;
+ int value;
+
+ private SvcAction(int value, String name) {
+ this.value = value;
+ this.name = name;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public int getIntValue() {
+ return this.value;
+ }
+ }
+
+ protected String requestId = null;
+
+ abstract O build(DelegateExecution execution, I input) throws Exception;
+
+ protected String getRequestAction(DelegateExecution execution) {
+ String action = /* RequestInformation. */RequestAction.CREATE_NETWORK_INSTANCE.getName();
+ String operType = (String) execution.getVariable(OPERATION_TYPE);
+ String resourceType = (String) execution.getVariable(RESOURCE_TYPE);
+ if (!StringUtils.isBlank(operType)) {
+ if (RequestsDbConstant.OperationType.DELETE.equalsIgnoreCase(operType)) {
+ if (isOverlay(resourceType)) {
+ action = /* RequestInformation. */RequestAction.DEACTIVATE_DCI_NETWORK_INSTANCE.getName();
+ } else if (isUnderlay(resourceType)) {
+ action = /* RequestInformation. */RequestAction.DELETE_NETWORK_INSTANCE.getName();
+ } else {
+ action = /* RequestInformation. */RequestAction.DELETE_SERVICE_INSTANCE.getName();
+ }
+ } else if (RequestsDbConstant.OperationType.CREATE.equalsIgnoreCase(operType)) {
+ if (isOverlay(resourceType)) {
+ action = /* RequestInformation. */RequestAction.ACTIVATE_DCI_NETWORK_INSTANCE.getName();
+ } else if (isUnderlay(resourceType)) {
+ action = /* RequestInformation. */RequestAction.CREATE_NETWORK_INSTANCE.getName();
+ } else {
+ action = /* RequestInformation. */RequestAction.CREATE_SERVICE_INSTANCE.getName();
+ }
+ }
+ }
+ return action;
+ }
+
+ private boolean isOverlay(String resourceType) {
+ return !StringUtils.isBlank(resourceType) && resourceType.toLowerCase().contains("overlay");
+ }
+
+ private boolean isUnderlay(String resourceType) {
+ return !StringUtils.isBlank(resourceType) && resourceType.toLowerCase().contains("underlay");
+ }
+
+ protected String getSvcAction(DelegateExecution execution) {
+ String action = /* SdncRequestHeader. */SvcAction.CREATE.getName();
+ String operType = (String) execution.getVariable(OPERATION_TYPE);
+ String resourceType = (String) execution.getVariable(RESOURCE_TYPE);
+ if (!StringUtils.isBlank(operType)) {
+ if (RequestsDbConstant.OperationType.DELETE.equalsIgnoreCase(operType)) {
+ if (isOverlay(resourceType)) {
+ action = /* SdncRequestHeader. */SvcAction.DEACTIVATE.getName();
+ } else if (isUnderlay(resourceType)) {
+ action = /* SdncRequestHeader. */SvcAction.DELETE.getName();
+ } else {
+ action = /* SdncRequestHeader. */SvcAction.UNASSIGN.getName();
+ }
+ } else if (RequestsDbConstant.OperationType.CREATE.equalsIgnoreCase(operType)) {
+ if (isOverlay(resourceType)) {
+ action = /* SdncRequestHeader. */SvcAction.ACTIVATE.getName();
+ } else if (isUnderlay(resourceType)) {
+ action = /* SdncRequestHeader. */SvcAction.CREATE.getName();
+ } else {
+ action = /* SdncRequestHeader. */SvcAction.ASSIGN.getName();
+ }
+ }
+ }
+ return action;
+ }
+
+ protected synchronized String getRequestId(DelegateExecution execution) {
+ if (StringUtils.isBlank(requestId)) {
+ requestId = (String) execution.getVariable("msoRequestId");
+ if (StringUtils.isBlank(requestId)) {
+ requestId = UUID.randomUUID().toString();
+ }
+ }
+ return requestId;
+ }
+
+ protected OnapModelInformationEntity getOnapServiceModelInformationEntity(DelegateExecution execution) {
+ OnapModelInformationEntity onapModelInformationEntity = new OnapModelInformationEntity();
+ String modelInvariantUuid = (String) execution.getVariable("modelInvariantUuid");
+ String modelVersion = (String) execution.getVariable("modelVersion");
+ String modelUuid = (String) execution.getVariable("modelUuid");
+ String modelName = (String) execution.getVariable("serviceModelName");
+ onapModelInformationEntity.setModelInvariantUuid(modelInvariantUuid);
+ onapModelInformationEntity.setModelVersion(modelVersion);
+ onapModelInformationEntity.setModelUuid(modelUuid);
+ onapModelInformationEntity.setModelName(modelName);
+ return onapModelInformationEntity;
+ }
+
+ protected OnapModelInformationEntity getOnapNetworkModelInformationEntity(DelegateExecution execution) {
+ OnapModelInformationEntity onapModelInformationEntity = new OnapModelInformationEntity();
+ String modelInvariantUuid = (String) execution.getVariable("resourceInvariantUUID");
+ String modelVersion = (String) execution.getVariable("modelVersion");
+ String modelUuid = (String) execution.getVariable("resourceUUID");
+ String modelName = (String) execution.getVariable(RESOURCE_TYPE);
+ onapModelInformationEntity.setModelInvariantUuid(modelInvariantUuid);
+ onapModelInformationEntity.setModelVersion(modelVersion);
+ onapModelInformationEntity.setModelUuid(modelUuid);
+ onapModelInformationEntity.setModelName(modelName);
+ return onapModelInformationEntity;
}
- protected List<ParamEntity> getParamEntities(Map<String, String> inputs) {
- List<ParamEntity> paramEntityList = new ArrayList<>();
- if (inputs != null && !inputs.isEmpty()) {
- inputs.keySet().forEach(key -> {
- ParamEntity paramEntity = new ParamEntity();
- paramEntity.setName(key);
- paramEntity.setValue(inputs.get(key));
- paramEntityList.add(paramEntity);
- });
- }
- return paramEntityList;
- }
-
- protected RequestInformationEntity getRequestInformationEntity(DelegateExecution execution) {
- RequestInformationEntity requestInformationEntity = new RequestInformationEntity();
- requestInformationEntity.setRequestId(getRequestId(execution));
- requestInformationEntity.setRequestAction(getRequestAction(execution));
- return requestInformationEntity;
- }
-
- protected ServiceInformationEntity getServiceInformationEntity(DelegateExecution execution) {
- ServiceInformationEntity serviceInformationEntity = new ServiceInformationEntity();
- serviceInformationEntity.setServiceId((String) execution.getVariable("serviceInstanceId"));
- serviceInformationEntity.setSubscriptionServiceType((String) execution.getVariable("serviceType"));
- serviceInformationEntity.setOnapModelInformation(getOnapServiceModelInformationEntity(execution));
- serviceInformationEntity.setServiceInstanceId((String) execution.getVariable("serviceInstanceId"));
- serviceInformationEntity.setGlobalCustomerId((String) execution.getVariable("globalSubscriberId"));
- return serviceInformationEntity;
- }
-
- protected String getServiceInstanceName(DelegateExecution execution) {
- return (String) execution.getVariable("serviceInstanceName");
- }
+ protected List<ParamEntity> getParamEntities(Map<String, String> inputs) {
+ List<ParamEntity> paramEntityList = new ArrayList<>();
+ if (inputs != null && !inputs.isEmpty()) {
+ inputs.keySet().forEach(key -> {
+ ParamEntity paramEntity = new ParamEntity();
+ paramEntity.setName(key);
+ paramEntity.setValue(inputs.get(key));
+ paramEntityList.add(paramEntity);
+ });
+ }
+ return paramEntityList;
+ }
+
+ protected RequestInformationEntity getRequestInformationEntity(DelegateExecution execution) {
+ RequestInformationEntity requestInformationEntity = new RequestInformationEntity();
+ requestInformationEntity.setRequestId(getRequestId(execution));
+ requestInformationEntity.setRequestAction(getRequestAction(execution));
+ return requestInformationEntity;
+ }
+
+ protected ServiceInformationEntity getServiceInformationEntity(DelegateExecution execution) {
+ ServiceInformationEntity serviceInformationEntity = new ServiceInformationEntity();
+ serviceInformationEntity.setServiceId((String) execution.getVariable("serviceInstanceId"));
+ serviceInformationEntity.setSubscriptionServiceType((String) execution.getVariable("serviceType"));
+ serviceInformationEntity.setOnapModelInformation(getOnapServiceModelInformationEntity(execution));
+ serviceInformationEntity.setServiceInstanceId((String) execution.getVariable("serviceInstanceId"));
+ serviceInformationEntity.setGlobalCustomerId((String) execution.getVariable("globalSubscriberId"));
+ return serviceInformationEntity;
+ }
+
+ protected String getServiceInstanceName(DelegateExecution execution) {
+ return (String) execution.getVariable("serviceInstanceName");
+ }
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilder.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilder.java
index 547df2bb3a..4a2194ed3d 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilder.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilder.java
@@ -22,7 +22,6 @@ package org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder;
import java.util.List;
import java.util.Map;
-
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.NetworkInformationEntity;
import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.NetworkInputParametersEntity;
@@ -35,44 +34,53 @@ import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.RpcNet
import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.SdncRequestHeaderEntity;
import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.ServiceInformationEntity;
-public class NetworkRpcInputEntityBuilder extends AbstractBuilder<Map<String, String>, RpcNetworkTopologyOperationInputEntity> {
+public class NetworkRpcInputEntityBuilder
+ extends AbstractBuilder<Map<String, String>, RpcNetworkTopologyOperationInputEntity> {
@Override
public RpcNetworkTopologyOperationInputEntity build(DelegateExecution execution, Map<String, String> inputs) {
- RpcNetworkTopologyOperationInputEntity rpcNetworkTopologyOperationInputEntity = new RpcNetworkTopologyOperationInputEntity();
- NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity = getNetworkTopologyOperationInputEntity(execution, inputs);
+ RpcNetworkTopologyOperationInputEntity rpcNetworkTopologyOperationInputEntity =
+ new RpcNetworkTopologyOperationInputEntity();
+ NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity =
+ getNetworkTopologyOperationInputEntity(execution, inputs);
rpcNetworkTopologyOperationInputEntity.setInput(networkTopologyOperationInputEntity);
return rpcNetworkTopologyOperationInputEntity;
}
- private void loadNetwrokRequestInputEntity(Map<String, String> inputs, NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity) {
+ private void loadNetwrokRequestInputEntity(Map<String, String> inputs,
+ NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity) {
NetworkRequestInputEntity networkRequestInputEntity = new NetworkRequestInputEntity();
- NetworkInputParametersEntity networkInputParametersEntity = new NetworkInputParametersEntity();
+ NetworkInputParametersEntity networkInputParametersEntity = new NetworkInputParametersEntity();
List<ParamEntity> paramEntityList = getParamEntities(inputs);
networkInputParametersEntity.setParamList(paramEntityList);
- networkRequestInputEntity.setNetworkInputPaarameters(networkInputParametersEntity);
+ networkRequestInputEntity.setNetworkInputPaarameters(networkInputParametersEntity);
networkTopologyOperationInputEntity.setNetworkRequestInput(networkRequestInputEntity);
}
- private void loadRequestInformationEntity(NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity, DelegateExecution execution) {
+ private void loadRequestInformationEntity(NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity,
+ DelegateExecution execution) {
RequestInformationEntity requestInformationEntity = getRequestInformationEntity(execution);
networkTopologyOperationInputEntity.setRequestInformation(requestInformationEntity);
}
- private void loadSdncRequestHeaderEntity(NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity, DelegateExecution execution) {
+ private void loadSdncRequestHeaderEntity(NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity,
+ DelegateExecution execution) {
SdncRequestHeaderEntity sdncRequestHeaderEntity = new SdncRequestHeaderEntity();
sdncRequestHeaderEntity.setSvcRequestId(getRequestId(execution));
sdncRequestHeaderEntity.setSvcAction(getSvcAction(execution));
networkTopologyOperationInputEntity.setSdncRequestHeader(sdncRequestHeaderEntity);
}
- private void loadServiceInformation(NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity, DelegateExecution execution) {
+ private void loadServiceInformation(NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity,
+ DelegateExecution execution) {
ServiceInformationEntity serviceInformationEntity = getServiceInformationEntity(execution);
networkTopologyOperationInputEntity.setServiceInformation(serviceInformationEntity);
}
- private NetworkTopologyOperationInputEntity getNetworkTopologyOperationInputEntity(DelegateExecution execution, Map<String, String> inputs) {
- NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity = new NetworkTopologyOperationInputEntity();
+ private NetworkTopologyOperationInputEntity getNetworkTopologyOperationInputEntity(DelegateExecution execution,
+ Map<String, String> inputs) {
+ NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity =
+ new NetworkTopologyOperationInputEntity();
loadSdncRequestHeaderEntity(networkTopologyOperationInputEntity, execution);
loadRequestInformationEntity(networkTopologyOperationInputEntity, execution);
loadServiceInformation(networkTopologyOperationInputEntity, execution);
@@ -81,7 +89,8 @@ public class NetworkRpcInputEntityBuilder extends AbstractBuilder<Map<String, St
return networkTopologyOperationInputEntity;
}
- private void loadNetworkInformationEntity(DelegateExecution execution, NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity) {
+ private void loadNetworkInformationEntity(DelegateExecution execution,
+ NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity) {
NetworkInformationEntity networkInformationEntity = new NetworkInformationEntity();
OnapModelInformationEntity onapModelInformationEntity = getOnapNetworkModelInformationEntity(execution);
networkInformationEntity.setOnapModelInformation(onapModelInformationEntity);
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilder.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilder.java
index 466652edff..944802372b 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilder.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilder.java
@@ -21,7 +21,6 @@
package org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder;
import java.util.Map;
-
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.RequestInformationEntity;
import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.RpcServiceTopologyOperationInputEntity;
@@ -30,20 +29,26 @@ import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.Servic
import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.ServiceRequestInputEntity;
import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.ServiceTopologyOperationInputEntity;
-public class ServiceRpcInputEntityBuilder extends AbstractBuilder<Map<String, String>, RpcServiceTopologyOperationInputEntity> {
+public class ServiceRpcInputEntityBuilder
+ extends AbstractBuilder<Map<String, String>, RpcServiceTopologyOperationInputEntity> {
@Override
- public RpcServiceTopologyOperationInputEntity build(DelegateExecution execution, Map<String, String> inputs) throws Exception {
- RpcServiceTopologyOperationInputEntity rpcServiceTopologyOperationInputEntity = new RpcServiceTopologyOperationInputEntity();
- ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity = new ServiceTopologyOperationInputEntity();
+ public RpcServiceTopologyOperationInputEntity build(DelegateExecution execution, Map<String, String> inputs)
+ throws Exception {
+ RpcServiceTopologyOperationInputEntity rpcServiceTopologyOperationInputEntity =
+ new RpcServiceTopologyOperationInputEntity();
+ ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity =
+ new ServiceTopologyOperationInputEntity();
loadSdncRequestHeaderEntity(serviceTopologyOperationInputEntity, execution);
loadRequestInformationEntity(serviceTopologyOperationInputEntity, execution);
loadServiceInformation(serviceTopologyOperationInputEntity, execution);
loadServiceRequestInputEntity(serviceTopologyOperationInputEntity, execution);
- rpcServiceTopologyOperationInputEntity.setServiceTopologyOperationInputEntity(serviceTopologyOperationInputEntity);
+ rpcServiceTopologyOperationInputEntity
+ .setServiceTopologyOperationInputEntity(serviceTopologyOperationInputEntity);
return rpcServiceTopologyOperationInputEntity;
}
- private void loadServiceRequestInputEntity(ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity, DelegateExecution execution) {
+ private void loadServiceRequestInputEntity(ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity,
+ DelegateExecution execution) {
ServiceRequestInputEntity serviceRequestInputEntity = getServiceRequestInputEntity(execution);
serviceTopologyOperationInputEntity.setServiceRequestInput(serviceRequestInputEntity);
}
@@ -54,17 +59,20 @@ public class ServiceRpcInputEntityBuilder extends AbstractBuilder<Map<String, St
return serviceRequestInputEntity;
}
- private void loadServiceInformation(ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity, DelegateExecution execution) {
+ private void loadServiceInformation(ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity,
+ DelegateExecution execution) {
ServiceInformationEntity serviceInformationEntity = getServiceInformationEntity(execution);
serviceTopologyOperationInputEntity.setServiceInformation(serviceInformationEntity);
}
- private void loadRequestInformationEntity(ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity, DelegateExecution execution) {
+ private void loadRequestInformationEntity(ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity,
+ DelegateExecution execution) {
RequestInformationEntity requestInformationEntity = getRequestInformationEntity(execution);
serviceTopologyOperationInputEntity.setRequestInformation(requestInformationEntity);
}
- private void loadSdncRequestHeaderEntity(ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity, DelegateExecution execution) {
+ private void loadSdncRequestHeaderEntity(ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity,
+ DelegateExecution execution) {
SdncRequestHeaderEntity sdncRequestHeaderEntity = new SdncRequestHeaderEntity();
sdncRequestHeaderEntity.setSvcRequestId(getRequestId(execution));
sdncRequestHeaderEntity.setSvcAction(getSvcAction(execution));
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkInputParametersEntity.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkInputParametersEntity.java
index 0863917f21..847aa72469 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkInputParametersEntity.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkInputParametersEntity.java
@@ -21,13 +21,12 @@
package org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity;
import com.fasterxml.jackson.annotation.JsonProperty;
-
import java.util.List;
public class NetworkInputParametersEntity {
- @JsonProperty("GENERIC-RESOURCE-API:param")
+ @JsonProperty("GENERIC-RESOURCE-API:param")
private List<ParamEntity> paramList;
-
+
public List<ParamEntity> getParamList() {
return paramList;
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RequestInformationEntity.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RequestInformationEntity.java
index af448942cc..238a4f32c0 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RequestInformationEntity.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RequestInformationEntity.java
@@ -23,7 +23,7 @@ package org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity;
import com.fasterxml.jackson.annotation.JsonProperty;
public class RequestInformationEntity {
- @JsonProperty("GENERIC-RESOURCE-API:request-id")
+ @JsonProperty("GENERIC-RESOURCE-API:request-id")
private String requestId;
@JsonProperty("GENERIC-RESOURCE-API:request-action")
@@ -40,7 +40,7 @@ public class RequestInformationEntity {
@JsonProperty("GENERIC-RESOURCE-API:order-version")
private String orerVersion;
-
+
public String getRequestId() {
return requestId;
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationInputEntity.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationInputEntity.java
index 4e58a61750..76494f5585 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationInputEntity.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationInputEntity.java
@@ -23,9 +23,9 @@ package org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity;
import com.fasterxml.jackson.annotation.JsonProperty;
public class RpcNetworkTopologyOperationInputEntity {
- @JsonProperty("GENERIC-RESOURCE-API:input")
+ @JsonProperty("GENERIC-RESOURCE-API:input")
private NetworkTopologyOperationInputEntity input = null;
-
+
public NetworkTopologyOperationInputEntity getInput() {
return input;
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationOutputEntity.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationOutputEntity.java
index 915a8a5e39..c93b3f2ad9 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationOutputEntity.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationOutputEntity.java
@@ -23,9 +23,9 @@ package org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity;
import com.fasterxml.jackson.annotation.JsonProperty;
public class RpcNetworkTopologyOperationOutputEntity {
- @JsonProperty("GENERIC-RESOURCE-API:output")
+ @JsonProperty("GENERIC-RESOURCE-API:output")
private NetworkTopologyOperationOutputEntity output;
-
+
public NetworkTopologyOperationOutputEntity getOutput() {
return output;
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcServiceTopologyOperationInputEntity.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcServiceTopologyOperationInputEntity.java
index 145759e190..dbca00ae24 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcServiceTopologyOperationInputEntity.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcServiceTopologyOperationInputEntity.java
@@ -23,14 +23,15 @@ package org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity;
import com.fasterxml.jackson.annotation.JsonProperty;
public class RpcServiceTopologyOperationInputEntity {
- @JsonProperty("GENERIC-RESOURCE-API:input")
+ @JsonProperty("GENERIC-RESOURCE-API:input")
private ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity;
-
+
public ServiceTopologyOperationInputEntity getServiceTopologyOperationInputEntity() {
return serviceTopologyOperationInputEntity;
}
- public void setServiceTopologyOperationInputEntity(ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity) {
+ public void setServiceTopologyOperationInputEntity(
+ ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity) {
this.serviceTopologyOperationInputEntity = serviceTopologyOperationInputEntity;
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceInputParametersEntity.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceInputParametersEntity.java
index c1ba7dc614..5c199bd413 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceInputParametersEntity.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceInputParametersEntity.java
@@ -21,13 +21,12 @@
package org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity;
import com.fasterxml.jackson.annotation.JsonProperty;
-
import java.util.List;
public class ServiceInputParametersEntity {
- @JsonProperty("GENERIC-RESOURCE-API:param")
+ @JsonProperty("GENERIC-RESOURCE-API:param")
private List<ParamEntity> paramList;
-
+
public List<ParamEntity> getParamList() {
return paramList;
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstanceTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstanceTest.groovy
index ae40e9d7c6..101db4f021 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstanceTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstanceTest.groovy
@@ -41,9 +41,6 @@ import static org.mockito.Mockito.*
@RunWith(MockitoJUnitRunner.class)
class CreateCustomE2EServiceInstanceTest {
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
-
@Before
public void init() throws IOException {
MockitoAnnotations.initMocks(this);
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfraTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfraTest.groovy
index 77220da94f..c5fd377a72 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfraTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfraTest.groovy
@@ -44,9 +44,6 @@ class CreateVfModuleInfraTest {
def prefix = "CVFMI_"
def requestInfo = "<requestInfo><request-id>12345</request-id></requestInfo>"
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareServiceInstanceDataTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareServiceInstanceDataTest.groovy
new file mode 100644
index 0000000000..afbace76d6
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareServiceInstanceDataTest.groovy
@@ -0,0 +1,301 @@
+package org.onap.so.bpmn.infrastructure.scripts
+
+import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
+import org.junit.Before
+import org.junit.Test
+import org.mockito.ArgumentCaptor
+import org.mockito.Captor
+import org.mockito.Mockito
+import org.onap.aai.domain.yang.ServiceInstance
+import org.onap.so.bpmn.common.scripts.MsoGroovyTest
+import org.onap.so.bpmn.core.domain.Resource
+import org.onap.so.bpmn.core.domain.ServiceDecomposition
+
+import static com.shazam.shazamcrest.MatcherAssert.assertThat
+import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs
+import static org.mockito.Mockito.times
+import static org.mockito.Mockito.when
+/**
+ * Copyright 2018 ZTE Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+class DoCompareServiceInstanceDataTest extends MsoGroovyTest {
+
+
+ public static final String uuiSoString = "{\n" +
+ " \"service\":{\n" +
+ " \"name\":\"SiteService\",\n" +
+ " \"description\":\"SiteService\",\n" +
+ " \"serviceInvariantUuid\":\"5c13f3fb-2744-4635-9f1f-c59c92dc8f70\",\n" +
+ " \"serviceUuid\":\"3a76b1f5-fb0d-4b6b-82d5-0e8a4ebc3838\",\n" +
+ " \"globalSubscriberId\":\"test_custormer\",\n" +
+ " \"serviceType\":\"example-service-type\",\n" +
+ " \"parameters\":{\n" +
+ " \"locationConstraints\":[\n" +
+ "\n" +
+ " ],\n" +
+ " \"resources\":[\n" +
+ " {\n" +
+ " \"resourceIndex\":\"1\",\n" +
+ " \"resourceName\":\"sdwanvpnresource\",\n" +
+ " \"resourceInvariantUuid\":\"0c0e1cbe-6e01-4f9e-8c45-a9700ebc14df\",\n" +
+ " \"resourceUuid\":\"4ad2d390-5c51-45f5-9710-b467a4ec7a73\",\n" +
+ " \"resourceCustomizationUuid\":\"66590e07-0777-415c-af44-36347cf3ddd3\",\n" +
+ " \"parameters\":{\n" +
+ " \"locationConstraints\":[\n" +
+ "\n" +
+ " ],\n" +
+ " \"resources\":[\n" +
+ "\n" +
+ " ],\n" +
+ " \"requestInputs\":{\n" +
+ "\n" +
+ " }\n" +
+ " }\n" +
+ " },\n" +
+ " {\n" +
+ " \"resourceIndex\":\"1\",\n" +
+ " \"resourceName\":\"sdwansiteresource\",\n" +
+ " \"resourceInvariantUuid\":\"97a3e552-08c4-4697-aeeb-d8d3e09ce58e\",\n" +
+ " \"resourceUuid\":\"63d8e1af-32dc-4c71-891d-e3f7b6a976d2\",\n" +
+ " \"resourceCustomizationUuid\":\"205456e7-3dc0-40c4-8cb0-28e6c1877042\",\n" +
+ " \"parameters\":{\n" +
+ " \"locationConstraints\":[\n" +
+ "\n" +
+ " ],\n" +
+ " \"resources\":[\n" +
+ "\n" +
+ " ],\n" +
+ " \"requestInputs\":{\n" +
+ "\n" +
+ " }\n" +
+ " }\n" +
+ " },\n" +
+ " {\n" +
+ " \"resourceIndex\":\"2\",\n" +
+ " \"resourceName\":\"sdwansiteresource\",\n" +
+ " \"resourceInvariantUuid\":\"97a3e552-08c4-4697-aeeb-d8d3e09ce58e\",\n" +
+ " \"resourceUuid\":\"63d8e1af-32dc-4c71-891d-e3f7b6a976d2\",\n" +
+ " \"resourceCustomizationUuid\":\"205456e7-3dc0-40c4-8cb0-28e6c1877042\",\n" +
+ " \"parameters\":{\n" +
+ " \"locationConstraints\":[\n" +
+ "\n" +
+ " ],\n" +
+ " \"resources\":[\n" +
+ "\n" +
+ " ],\n" +
+ " \"requestInputs\":{\n" +
+ "\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " ],\n" +
+ " \"requestInputs\":{\n" +
+ " \"sdwanvpnresource_list\":[\n" +
+ " {\n" +
+ " \"sdwanvpn_topology\":\"hub_spoke\",\n" +
+ " \"sdwanvpn_name\":\"defaultvpn\",\n" +
+ " \"sdwansitelan_list\":[\n" +
+ " {\n" +
+ " \"role\":\"Hub\",\n" +
+ " \"portType\":\"GE\",\n" +
+ " \"portSwitch\":\"layer3-port\",\n" +
+ " \"vlanId\":\"\",\n" +
+ " \"ipAddress\":\"192.168.10.1\",\n" +
+ " \"deviceName\":\"vCPE\",\n" +
+ " \"portNumer\":\"0/0/1\"\n" +
+ " },\n" +
+ " {\n" +
+ " \"role\":\"Hub\",\n" +
+ " \"portType\":\"GE\",\n" +
+ " \"portSwitch\":\"layer2-port\",\n" +
+ " \"vlanId\":\"55\",\n" +
+ " \"ipAddress\":\"192.168.11.1\",\n" +
+ " \"deviceName\":\"CPE_Beijing\",\n" +
+ " \"portNumer\":\"0/0/1\"\n" +
+ " }\n" +
+ " ]\n" +
+ " }\n" +
+ " ],\n" +
+ " \"sdwansiteresource_list\":[\n" +
+ " {\n" +
+ " \"sdwansite_emails\":\"chenchuanyu@huawei.com\",\n" +
+ " \"sdwansite_address\":\"Huawei Public Cloud\",\n" +
+ " \"sdwansite_description\":\"DC Site\",\n" +
+ " \"sdwansite_role\":\"dsvpn_hub\",\n" +
+ " \"sdwansite_postcode\":\"20000\",\n" +
+ " \"sdwansite_type\":\"single_gateway\",\n" +
+ " \"sdwansite_latitude\":\"\",\n" +
+ " \"sdwansite_controlPoint\":\"\",\n" +
+ " \"sdwansite_longitude\":\"\",\n" +
+ " \"sdwansitewan_list\":[\n" +
+ " {\n" +
+ " \"providerIpAddress\":\"\",\n" +
+ " \"portType\":\"GE\",\n" +
+ " \"inputBandwidth\":\"1000\",\n" +
+ " \"ipAddress\":\"\",\n" +
+ " \"name\":\"10000\",\n" +
+ " \"transportNetworkName\":\"internet\",\n" +
+ " \"outputBandwidth\":\"10000\",\n" +
+ " \"deviceName\":\"vCPE\",\n" +
+ " \"portNumber\":\"0/0/0\",\n" +
+ " \"ipMode\":\"DHCP\",\n" +
+ " \"publicIP\":\"119.3.7.113\"\n" +
+ " }\n" +
+ " ],\n" +
+ " \"sdwandevice_list\":[\n" +
+ " {\n" +
+ " \"esn\":\"XXXXXXX\",\n" +
+ " \"vendor\":\"Huawei\",\n" +
+ " \"name\":\"vCPE\",\n" +
+ " \"type\":\"AR1000V\",\n" +
+ " \"version\":\"1.0\",\n" +
+ " \"class\":\"VNF\",\n" +
+ " \"systemIp\":\"20.20.20.1\"\n" +
+ " }\n" +
+ " ]\n" +
+ " },\n" +
+ " {\n" +
+ " \"sdwansite_emails\":\"chenchuanyu@huawei.com\",\n" +
+ " \"sdwansite_address\":\"Huawei Public Cloud\",\n" +
+ " \"sdwansite_description\":\"DC Site\",\n" +
+ " \"sdwansite_role\":\"dsvpn_hub\",\n" +
+ " \"sdwansite_postcode\":\"20000\",\n" +
+ " \"sdwansite_type\":\"single_gateway\",\n" +
+ " \"sdwansite_latitude\":\"\",\n" +
+ " \"sdwansite_controlPoint\":\"\",\n" +
+ " \"sdwansite_longitude\":\"\",\n" +
+ " \"sdwansitewan_list\":[\n" +
+ " {\n" +
+ " \"providerIpAddress\":\"\",\n" +
+ " \"portType\":\"GE\",\n" +
+ " \"inputBandwidth\":\"1000\",\n" +
+ " \"ipAddress\":\"172.18.1.2/24\",\n" +
+ " \"name\":\"10000\",\n" +
+ " \"transportNetworkName\":\"internet\",\n" +
+ " \"outputBandwidth\":\"10000\",\n" +
+ " \"deviceName\":\"CPE_Beijing\",\n" +
+ " \"portNumber\":\"0/0/0\",\n" +
+ " \"ipMode\":\"Static\",\n" +
+ " \"publicIP\":\"\"\n" +
+ " }\n" +
+ " ],\n" +
+ " \"sdwandevice_list\":[\n" +
+ " {\n" +
+ " \"esn\":\"XXXXXXX\",\n" +
+ " \"vendor\":\"Huawei\",\n" +
+ " \"name\":\"CPE_Beijing\",\n" +
+ " \"type\":\"AR161\",\n" +
+ " \"version\":\"1.0\",\n" +
+ " \"class\":\"PNF\",\n" +
+ " \"systemIp\":\"20.20.20.2\"\n" +
+ " }\n" +
+ " ]\n" +
+ " }\n" +
+ " ]\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}"
+
+ @Before
+ void setUp() {
+ super.init("DoCompareServiceInstanceData")
+ }
+
+ @Captor
+ static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
+
+ @Test
+ void testPreProcessRequest() {
+ mockData()
+ DoCompareServiceInstanceData csi = new DoCompareServiceInstanceData()
+ csi.preProcessRequest(mockExecution)
+ }
+
+ @Test(expected = BpmnError.class)
+ void testPreProcessRequestException() {
+ DoCompareServiceInstanceData csi = new DoCompareServiceInstanceData()
+ csi.preProcessRequest(mockExecution)
+ }
+
+ @Test
+ void testPrepareDecomposeService_Original() {
+ mockData()
+ DoCompareServiceInstanceData csi = new DoCompareServiceInstanceData()
+ csi.prepareDecomposeService_Original(mockExecution)
+ Mockito.verify(mockExecution, times(1)).setVariable(captor.capture(), captor.capture())
+ String serviceModelInfo = getServiceModelInfo()
+ assertThat(captor.getValue(), sameBeanAs(serviceModelInfo))
+ }
+
+ @Test
+ void testProcessDecomposition_Original() {
+ mockData()
+ DoCompareServiceInstanceData csi = new DoCompareServiceInstanceData()
+ csi.processDecomposition_Original(mockExecution)
+ Mockito.verify(mockExecution, times(1)).setVariable(captor.capture(), captor.capture())
+ ServiceDecomposition serviceDecomposition = getServiceDecomposition()
+ assertThat(captor.getValue(), sameBeanAs(serviceDecomposition))
+ }
+
+ @Test
+ void testDoCompareUuiRquestInput() {
+ mockData()
+ DoCompareServiceInstanceData csi = new DoCompareServiceInstanceData()
+ csi.doCompareUuiRquestInput(mockExecution)
+ Mockito.verify(mockExecution, times(4)).setVariable(captor.capture(), captor.capture())
+ }
+
+ private String getServiceModelInfo() {
+ String modelInvariantUuid = mockExecution.getVariable("model-invariant-id-original")
+ String modelUuid = mockExecution.getVariable("model-version-id-original")
+ String serviceModelInfo = """{
+ "modelInvariantUuid":"${modelInvariantUuid}",
+ "modelUuid":"${modelUuid}",
+ "modelVersion":""
+ }"""
+ serviceModelInfo
+ }
+
+ private void mockData() {
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("msoRequestId")).thenReturn("12345")
+ when(mockExecution.getVariable("model-version-id-original")).thenReturn("12345")
+ when(mockExecution.getVariable("model-invariant-id-original")).thenReturn("12345")
+ when(mockExecution.getVariable("uuiRequest")).thenReturn(uuiSoString)
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("1234")
+ when(mockExecution.getVariable("serviceInstanceData-original")).thenReturn(getExpectedServiceInstance())
+ when(mockExecution.getVariable("serviceDecomposition")).thenReturn(getServiceDecomposition())
+ when(mockExecution.getVariable("serviceDecomposition_Original")).thenReturn(getServiceDecomposition())
+ }
+
+ private ServiceDecomposition getServiceDecomposition() {
+ ServiceDecomposition decomposition = new ServiceDecomposition()
+ List<Resource> allSR_original = new ArrayList<>()
+ decomposition.setAllottedResources(allSR_original)
+ return decomposition
+ }
+
+ private ServiceInstance getExpectedServiceInstance() {
+ ServiceInstance expectedServiceInstanceData = new ServiceInstance()
+ expectedServiceInstanceData.setServiceInstanceId("1234")
+ expectedServiceInstanceData.setServiceInstanceName("volte-service")
+ expectedServiceInstanceData.setServiceType("E2E Service")
+ expectedServiceInstanceData.setServiceRole("E2E Service")
+ expectedServiceInstanceData.setInputParameters(uuiSoString)
+ return expectedServiceInstanceData
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy
index 5ee10bc931..9214b386eb 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy
@@ -55,10 +55,7 @@ import org.apache.commons.lang3.*
@RunWith(MockitoJUnitRunner.class)
class DoCreateNetworkInstanceRollbackTest {
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
-
- def utils = new MsoUtils()
+ def utils = new MsoUtils()
String Prefix="CRENWKIR_"
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceTest.groovy
index b246caf40e..90c7b71a07 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceTest.groovy
@@ -41,9 +41,6 @@ class DoCreateServiceInstanceTest extends MsoGroovyTest{
def prefix = "DCRESI_"
@Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
- @Rule
public ExpectedException thrown = ExpectedException.none()
@Before
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollbackTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollbackTest.groovy
index e7ebe23e75..dd18049b5f 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollbackTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollbackTest.groovy
@@ -62,9 +62,6 @@ class DoCreateVfModuleRollbackTest extends MsoGroovyTest{
@Spy
DoCreateVfModuleRollback doCreateVfModuleRollback
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
@@ -165,6 +162,7 @@ class DoCreateVfModuleRollbackTest extends MsoGroovyTest{
when(mockExecution.getVariable("prefix")).thenReturn(prefix)
when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
when(mockExecution.getVariable("DCVFM_cloudSiteId")).thenReturn("12345")
+ when(mockExecution.getVariable("DCVFM_cloudOwner")).thenReturn("CloudOwner")
when(mockExecution.getVariable("rollbackData")).thenReturn(new RollbackData())
List fqdnList = new ArrayList()
fqdnList.add("test")
@@ -194,6 +192,7 @@ class DoCreateVfModuleRollbackTest extends MsoGroovyTest{
when(mockExecution.getVariable("prefix")).thenReturn(prefix)
when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
when(mockExecution.getVariable("DCVFM_cloudSiteId")).thenReturn("12345")
+ when(mockExecution.getVariable("DCVFM_cloudOwner")).thenReturn("CloudOwner")
when(mockExecution.getVariable("rollbackData")).thenReturn(new RollbackData())
List fqdnList = new ArrayList()
fqdnList.add("test")
@@ -223,6 +222,7 @@ class DoCreateVfModuleRollbackTest extends MsoGroovyTest{
when(mockExecution.getVariable("prefix")).thenReturn(prefix)
when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
when(mockExecution.getVariable("DCVFM_cloudSiteId")).thenReturn("12345")
+ when(mockExecution.getVariable("DCVFM_cloudOwner")).thenReturn("CloudOwner")
when(mockExecution.getVariable("rollbackData")).thenReturn(new RollbackData())
List fqdnList = new ArrayList()
fqdnList.add("test")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy
index 30e3779b53..faa6a0e395 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy
@@ -47,9 +47,6 @@ import static org.mockito.Mockito.*
class DoCreateVfModuleTest {
def prefix = "DCVFM_"
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesTest.groovy
index 47db6b3b7b..a8c818e69c 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesTest.groovy
@@ -54,9 +54,6 @@ import static org.mockito.Mockito.*
@RunWith(MockitoJUnitRunner.class)
class DoCreateVnfAndModulesTest {
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfTest.groovy
index 9b421d8b63..d7ba10ad93 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfTest.groovy
@@ -44,9 +44,6 @@ import static org.mockito.Mockito.*
class DoCreateVnfTest {
def prefix = "DoCVNF_"
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstanceTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstanceTest.groovy
index a8bdfb0633..ea79e0eadd 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstanceTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstanceTest.groovy
@@ -46,9 +46,6 @@ import static org.mockito.Mockito.*
@RunWith(MockitoJUnitRunner.class)
class DoDeleteServiceInstanceTest {
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnfTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnfTest.groovy
index cfdeee2c32..f356845a1e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnfTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnfTest.groovy
@@ -54,9 +54,6 @@ import static org.mockito.Mockito.*
@RunWith(MockitoJUnitRunner.class)
class DoDeleteVfModuleFromVnfTest extends MsoGroovyTest {
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleTest.groovy
index 7776ab3fe6..b56e108faf 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleTest.groovy
@@ -61,9 +61,6 @@ class DoDeleteVfModuleTest extends MsoGroovyTest{
@Spy
DoDeleteVfModule doDeleteVfModule
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2Test.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2Test.groovy
index 94aec7a73f..2885d6919e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2Test.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2Test.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -26,21 +28,25 @@ import org.camunda.bpm.engine.RepositoryService
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
import org.camunda.bpm.engine.repository.ProcessDefinition
+import org.junit.After
+import org.junit.AfterClass
import org.junit.Assert
import org.junit.Before
-import org.junit.Ignore
+import org.junit.BeforeClass
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.ArgumentCaptor
import org.mockito.Captor
+import org.mockito.Mock
import org.mockito.Mockito
import org.mockito.MockitoAnnotations
import org.mockito.Spy
-import org.mockito.runners.MockitoJUnitRunner
+import org.mockito.junit.MockitoJUnitRunner
import org.onap.aai.domain.yang.VolumeGroup
import org.onap.so.bpmn.common.scripts.MsoGroovyTest
import org.onap.so.bpmn.common.scripts.utils.XmlComparator
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.mock.FileUtil
import org.onap.so.client.aai.AAIObjectType
@@ -48,75 +54,111 @@ import org.onap.so.client.aai.entities.AAIResultWrapper
import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.client.graphinventory.exceptions.GraphInventoryUriComputationException
+import org.springframework.core.env.Environment
+import org.springframework.mock.env.MockEnvironment
import javax.ws.rs.NotFoundException
import static com.github.tomakehurst.wiremock.client.WireMock.*
import static org.mockito.Mockito.*
-@RunWith(MockitoJUnitRunner.class)
+@RunWith(MockitoJUnitRunner.Silent.class)
class DoDeleteVfModuleVolumeV2Test extends MsoGroovyTest{
+
@Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
+ public WireMockRule wireMockRule = new WireMockRule(8090)
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
@Spy
- DoDeleteVfModuleVolumeV2 deleteVfModuleVolumeV2;
+ DoDeleteVfModuleVolumeV2 deleteVfModuleVolumeV2
+
+ @Mock
+ Environment mockEnvironment
+
+ private String Prefix = "DDVMV_"
+ private RepositoryService mockRepositoryService
+
+
+ @After
+ void cleanupEnv() {
+ UrnPropertiesReader urnPropertiesReader = new UrnPropertiesReader()
+ urnPropertiesReader.setEnvironment(null)
+ }
@Before
public void init() throws IOException {
super.init("DoDeleteVfModuleVolumeV2")
MockitoAnnotations.initMocks(this);
when(deleteVfModuleVolumeV2.getAAIClient()).thenReturn(client)
-
+ when(mockEnvironment.getProperty("mso.workflow.global.default.aai.version")).thenReturn("14")
+ when(mockEnvironment.getProperty("mso.workflow.global.default.aai.namespace")).thenReturn("defaultTestNamespace")
+ when(mockEnvironment.getProperty("aai.endpoint")).thenReturn("http://localhost:8090")
+ UrnPropertiesReader urnPropertiesReader = new UrnPropertiesReader()
+ urnPropertiesReader.setEnvironment(mockEnvironment)
}
@Test
public void testCallRESTQueryAAICloudRegion() {
ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn("DDVMV_")
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
when(mockExecution.getVariable("lcpCloudRegionId")).thenReturn("12345")
- when(mockExecution.getVariable("mso.workflow.DoDeleteVfModuleVolumeV2.aai.cloud-region.uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:28090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn("http://org.openecomp.aai.inventory/")
+ mockSuccessfulCloudData()
- mockData()
DoDeleteVfModuleVolumeV2 obj = new DoDeleteVfModuleVolumeV2()
obj.callRESTQueryAAICloudRegion(mockExecution, "true")
Mockito.verify(mockExecution).setVariable("DDVMV_queryCloudRegionReturnCode", "200")
Mockito.verify(mockExecution).setVariable("DDVMV_aicCloudRegion", "RDM2WAGPLCP")
}
- @Test
+ @Test(expected = GroovyRuntimeException.class)
public void testCallRESTQueryAAICloudRegionAAiEndpointNull() {
ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn("DDVMV_")
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
when(mockExecution.getVariable("lcpCloudRegionId")).thenReturn("12345")
- when(mockExecution.getVariable("mso.workflow.DoDeleteVfModuleVolumeV2.aai.cloud-region.uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn(null)
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn("http://org.openecomp.aai.inventory/")
+ when(mockEnvironment.getProperty("aai.endpoint")).thenReturn(null)
- mockData()
+ mockSuccessfulCloudData()
try {
DoDeleteVfModuleVolumeV2 obj = new DoDeleteVfModuleVolumeV2()
obj.callRESTQueryAAICloudRegion(mockExecution, "true")
} catch (Exception ex) {
- println " Test End - Handle catch-throw BpmnError()! "
+ println " Test End - Handle catch-throw Exception! "
+ Mockito.verify(mockExecution).getVariable(eq("lcpCloudRegionId"))
+ Assert.assertEquals(GroovyRuntimeException.class, ex.class)
+ throw ex
}
- Mockito.verify(mockExecution,atLeastOnce()).setVariable(captor.capture(),captor.capture())
- WorkflowException workflowException = captor.getValue()
- Assert.assertEquals(9999, workflowException.getErrorCode())
+ }
+
+ @Test
+ public void testCallRESTQueryAAICloudRegionNotFound() {
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("lcpCloudRegionId")).thenReturn("12345")
+ when(mockExecution.getVariable(Prefix + "queryCloudRegionReturnCode")).thenReturn("404")
+
+ wireMockRule.stubFor(
+ get(urlMatching(".*/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/12345"))
+ .willReturn(aResponse()
+ .withStatus(404)))
+
+ DoDeleteVfModuleVolumeV2 obj = new DoDeleteVfModuleVolumeV2()
+ obj.callRESTQueryAAICloudRegion(mockExecution, "true")
+
+ Mockito.verify(mockExecution).getVariable(eq("lcpCloudRegionId"))
+ Mockito.verify(mockExecution).setVariable(eq(Prefix + "queryCloudRegionReturnCode"), eq("404"))
+ Mockito.verify(mockExecution).setVariable(eq(Prefix + "aicCloudRegion"), eq("AAIAIC25"))
}
@Test
public void testPrepareVnfAdapterDeleteRequest() {
ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn("DDVMV_")
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix)
when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
when(mockExecution.getVariable("aicCloudRegion")).thenReturn("RegionOne")
when(mockExecution.getVariable("tenantId")).thenReturn("12345")
@@ -141,8 +183,10 @@ class DoDeleteVfModuleVolumeV2Test extends MsoGroovyTest{
when(mockExecution.getVariable("volumeGroupId")).thenReturn("VolumeGroup123")
when(mockExecution.getVariable("DDVMV_aicCloudRegion")).thenReturn("Region1")
AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP,CLOUD_OWNER, "Region1","VolumeGroup123")
- Optional<VolumeGroup> volumeGroup = getAAIObjectFromJson(VolumeGroup.class,"__files/aai/VolumeGroupWithTenant.json");
+ Optional<VolumeGroup> volumeGroup = getAAIObjectFromJson(VolumeGroup.class,"__files/AAI/VolumeGroupWithTenant.json");
when(client.get(VolumeGroup.class,resourceUri)).thenReturn(volumeGroup)
+ when(client.get(resourceUri)).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/AAI/VolumeGroupWithTenant.json")))
deleteVfModuleVolumeV2.callRESTQueryAAIForVolumeGroup(mockExecution,"true")
Mockito.verify(mockExecution).setVariable("DDVMV_queryAAIVolGrpResponse", volumeGroup.get())
Mockito.verify(mockExecution).setVariable("DDVMV_volumeGroupHeatStackId", volumeGroup.get().getHeatStackId())
@@ -169,7 +213,7 @@ class DoDeleteVfModuleVolumeV2Test extends MsoGroovyTest{
when(mockExecution.getVariable("volumeGroupId")).thenReturn("VolumeGroup123")
when(mockExecution.getVariable("DDVMV_aicCloudRegion")).thenReturn("Region1")
AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP,CLOUD_OWNER, "Region1","VolumeGroup123")
- Optional<VolumeGroup> volumeGroup = getAAIObjectFromJson(VolumeGroup.class,"__files/aai/VolumeGroupWithTenant.json");
+ Optional<VolumeGroup> volumeGroup = getAAIObjectFromJson(VolumeGroup.class,"__files/AAI/VolumeGroupWithTenant.json");
when(client.get(VolumeGroup.class,resourceUri)).thenReturn(volumeGroup)
try {
deleteVfModuleVolumeV2.callRESTQueryAAIForVolumeGroup(mockExecution, "true")
@@ -250,30 +294,20 @@ class DoDeleteVfModuleVolumeV2Test extends MsoGroovyTest{
private ExecutionEntity setupMock() {
- ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
- when(mockProcessDefinition.getKey()).thenReturn("DoDeleteVfModuleVolumeV2")
- RepositoryService mockRepositoryService = mock(RepositoryService.class)
- when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
- when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoDeleteVfModuleVolumeV2")
- when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100")
+ mockRepositoryService = mock(RepositoryService.class)
ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class)
- when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService)
+ when(mockProcessEngineServices.getRepositoryService()).thenReturn(this.mockRepositoryService)
ExecutionEntity mockExecution = mock(ExecutionEntity.class)
// Initialize prerequisite variables
-
- when(mockExecution.getId()).thenReturn("100")
- when(mockExecution.getProcessDefinitionId()).thenReturn("DoDeleteVfModuleVolumeV2")
- when(mockExecution.getProcessInstanceId()).thenReturn("DoDeleteVfModuleVolumeV2")
when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices)
- when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition)
return mockExecution
}
- private void mockData() {
- stubFor(get(urlMatching(".*/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/12345"))
+ private void mockSuccessfulCloudData() {
+ wireMockRule.stubFor(get(urlMatching(".*/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/12345"))
.willReturn(aResponse()
.withStatus(200).withHeader("Content-Type", "text/xml")
.withBodyFile("DoCreateVfModuleVolumeV2/cloudRegion_AAIResponse_Success.xml")))
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModulesTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModulesTest.groovy
index f98d454eb0..9e4ab6f757 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModulesTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModulesTest.groovy
@@ -50,9 +50,6 @@ import static org.mockito.Mockito.*
@RunWith(MockitoJUnitRunner.class)
public class DoDeleteVnfAndModulesTest extends MsoGroovyTest{
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy
index 0189d065df..7bc82c1ccc 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy
@@ -52,9 +52,6 @@ import org.apache.commons.lang3.*
@RunWith(MockitoJUnitRunner.class)
class DoUpdateNetworkInstanceRollbackTest {
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
-
def utils = new MsoUtils()
String Prefix="UPDNETIR_"
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy
index 68a9ed659e..19bb7c86b4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceTest.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -20,33 +22,34 @@
package org.onap.so.bpmn.infrastructure.scripts
-
-import static org.mockito.Mockito.*
-import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetNetworkByIdWithDepth;
-import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion;
-import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetNetworkCloudRegion_404;
-import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetNetworkVpnBinding;
-import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetNetworkTableReference;
-import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetNetworkPolicy;
-import static org.onap.so.bpmn.mock.StubResponseAAI.MockPutNetworkIdWithDepth;
+import com.github.tomakehurst.wiremock.client.WireMock
+import com.github.tomakehurst.wiremock.junit.WireMockRule
import org.camunda.bpm.engine.ProcessEngineServices
import org.camunda.bpm.engine.RepositoryService
+import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
import org.camunda.bpm.engine.repository.ProcessDefinition
-import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.junit.Before
-import org.junit.Rule
-import org.junit.Test
+import org.junit.*
import org.junit.runner.RunWith
import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
+import org.mockito.junit.MockitoJUnitRunner
+import org.onap.aai.domain.yang.*
import org.onap.so.bpmn.common.scripts.MsoUtils
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.bpmn.core.WorkflowException
-
-import com.github.tomakehurst.wiremock.client.WireMock
-import com.github.tomakehurst.wiremock.junit.WireMockRule
-import org.apache.commons.lang3.*
-
+import org.onap.so.bpmn.mock.FileUtil
+import org.onap.so.client.aai.entities.AAIResultWrapper
+import org.springframework.mock.env.MockEnvironment
+
+import static org.mockito.ArgumentMatchers.eq
+import static org.mockito.ArgumentMatchers.isA
+import static org.mockito.ArgumentMatchers.refEq
+import static org.mockito.Mockito.atLeast
+import static org.mockito.Mockito.mock
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.when
+import static org.onap.so.bpmn.mock.StubResponseAAI.*
@RunWith(MockitoJUnitRunner.class)
class DoUpdateNetworkInstanceTest {
@@ -200,24 +203,6 @@ String expectedNetworkInputMissingCloudRegion =
<sdncVersion>null</sdncVersion>
</network-inputs>"""
- String networkInputsMissingName =
- """<network-inputs xmlns="http://org.onap/so/infra/vnf-request/v1">
- <network-name/>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
- </network-inputs>"""
-
-String networkInputsMissingCloudRegion =
-"""<network-inputs xmlns="http://org.onap/so/infra/vnf-request/v1">
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region/>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
-</network-inputs>"""
-
// expectedNetworkRequest
String expectedNetworkRequest =
"""<network-request xmlns="http://www.w3.org/2001/XMLSchema">
@@ -384,619 +369,6 @@ String expectedNetworkInputsMissingNetworkId =
</vnfreq:network-params>
</vnfreq:network-request>"""
- // expectedNetworkRequest
- String expectedNetworkRequest_Outputs =
- """<vnfreq:network-request xmlns:vnfreq="http://org.onap/so/infra/vnf-request/v1">
- <vnfreq:request-info>
- <vnfreq:request-id>1ef47428-cade-45bd-a103-0751e8b2deb0</vnfreq:request-id>
- <vnfreq:action>UPDATE</vnfreq:action>
- <vnfreq:source>PORTAL</vnfreq:source>
- </vnfreq:request-info>
- <vnfreq:network-inputs>
- <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
- <vnfreq:network-type>CONTRAIL_EXTERNAL</vnfreq:network-type>
- <vnfreq:service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</vnfreq:service-id>
- <vnfreq:aic-cloud-region>RDM2WAGPLCP</vnfreq:aic-cloud-region>
- <vnfreq:tenant-id>7dd5365547234ee8937416c65507d266</vnfreq:tenant-id>
- </vnfreq:network-inputs>
- <vnfreq:network-outputs>
- <vnfreq:network-name>MNS-25180-L-01-dmz_direct_net_1</vnfreq:network-name>
- <vnfreq:network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</vnfreq:network-id>
- </vnfreq:network-outputs>
- <vnfreq:network-params>
- <param name="shared">1</param>
- <param name="external">0</param>
- </vnfreq:network-params>
-</vnfreq:network-request>"""
-
-
- String networkInputs =
- """<network-inputs xmlns="http://org.onap/so/infra/vnf-request/v1">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
- <tenant-id>e81d842d3e8b45c5a59f57cd76af3aaf</tenant-id>
-</network-inputs>"""
-
- String networkOutputs =
- """<network-outputs>
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- </network-outputs>"""
-
- String queryAAIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v3">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-delete</orchestration-status>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
- String queryIdAIIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <resource-version>l3-version</resource-version>
- <orchestration-status>pending-delete</orchestration-status>
- <heat-stack-id>ST_2Bindings_6006/55288ef0-595c-47d3-819e-cf93aaac6326</heat-stack-id>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-update</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <subnet-role>ECOMP</subnet-role>
- <ip-assignment-direction>true</ip-assignment-direction>
- <host-routes>
- <host-route>
- <host-route-id>400d286b-7e44-4514-b9b3-f70f7360ff32</host-route-id>
- <route-prefix>172.20.1.0/24</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857300987</resource-version>
- </host-route>
- <host-route>
- <host-route-id>6f038013-8b15-4eb8-914b-507489fbc8ee</host-route-id>
- <route-prefix>10.102.0.0/16</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857301151</resource-version>
- </host-route>
- <host-route>
- <host-route-id>8811c5f8-f1ed-4fa0-a505-e1be60396e28</host-route-id>
- <route-prefix>192.168.2.0/25</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <resource-version>1505857301954</resource-version>
- </host-route>
- </host-routes>
- <relationship-list/>
- </subnet>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <ip-assignment-direction>true</ip-assignment-direction>
- <host-routes>
- <host-route>
- <host-route-id>400d286b-7e44-4514-b9b3-f70f7360ff32</host-route-id>
- <route-prefix>172.20.1.0/24</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <resource-version>1505857300987</resource-version>
- </host-route>
- </host-routes>
- <relationship-list/>
- </subnet>
- </subnets>
- <segmentation-assignments>
- <segmentation-id>414</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <segmentation-assignments>
- <segmentation-id>415</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <ctag-assignments>
- <ctag-assignment>
- <vlan-id-inner>inner</vlan-id-inner>
- <resource-version>ctag-version</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSOTest1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
- </ctag-assignment>
- </ctag-assignments>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>network-policy</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
- <relationship-data>
- <relationship-key>network-policy.network-policy-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
- String queryIdAIIResponseTestScenario01 =
- """<?xml version="1.0" encoding="UTF-8"?>
-<l3-network xmlns="http://org.openecomp.aai.inventory/v7">
- <network-id>4da55fe4-7a9e-478c-a434-8a98d62265ab</network-id>
- <network-name>GN_EVPN_direct_net_0_ST1</network-name>
- <network-type>CONTRAIL30_BASIC</network-type>
- <network-role>GN_EVPN_direct</network-role>
- <network-technology>contrail</network-technology>
- <is-bound-to-vpn>false</is-bound-to-vpn>
- <service-id>9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <resource-version>1465398611</resource-version>
- <orchestration-status>pending-delete</orchestration-status>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>cb1a7b47-5428-44c9-89c2-8b17541c3228</subnet-id>
- <gateway-address>108.239.40.1</gateway-address>
- <network-start-address>108.239.40.0</network-start-address>
- <cidr-mask>28</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <dhcp-start>108.239.40.0</dhcp-start>
- <dhcp-end>108.239.40.0</dhcp-end>
- <resource-version>1465398611</resource-version>
- <subnet-name>subnetName</subnet-name>
- <relationship-list />
- </subnet>
- <subnet>
- <subnet-id>e2cc7c14-90f0-4205-840d-b4e07f04e621</subnet-id>
- <gateway-address>2606:ae00:2e01:604::1</gateway-address>
- <network-start-address>2606:ae00:2e01:604::</network-start-address>
- <cidr-mask>64</cidr-mask>
- <ip-version>6</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <dhcp-start>2606:ae00:2e01:604::</dhcp-start>
- <dhcp-end>2606:ae00:2e01:604::</dhcp-end>
- <resource-version>1465398611</resource-version>
- <subnet-name>subnetName</subnet-name>
- <relationship-list />
- </subnet>
- </subnets>
- <ctag-assignments />
- <segmentation-assignments>
- <segmentation-id>416</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <relationship-list>
- <relationship>
- <related-to>cloud-region</related-to>
- <related-link>https://localhost:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/AAIAIC25/
- </related-link>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>AAIAIC25</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>CloudOwner</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>cloud-region.owner-defined-type</property-key>
- <property-value></property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://localhost:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/AAIAIC25/tenants/tenant/4ae1d3446a4c48b2bec44b6cfba06d68/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>4ae1d3446a4c48b2bec44b6cfba06d68
- </relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-owner</relationship-key>
- <relationship-value>CloudOwner</relationship-value>
- </relationship-data>
- <relationship-data>
- <relationship-key>cloud-region.cloud-region-id</relationship-key>
- <relationship-value>AAIAIC25</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>Ruchira Contrail 3.0 test</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://localhost:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>9a7b327d9-287aa00-82c4b0-100001</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>GN_EVPN_direct_net_0_ST1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
-</l3-network>"""
-
- String queryIdAIIResponseVpnNotPresent =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-delete</orchestration-status>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-name>subnetName</subnet-name>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list/>
- </l3-network>
- </rest:payload>
-</rest:RESTResponse>"""
-
- String queryNameAIIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-delete</orchestration-status>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
- </rest:RESTResponse>"""
-
- String queryNameAIIResponseVpnNotPresent =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:502-132671"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v6>
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <orchestration-status>pending-delete</orchestration-status>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>pending-delete</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- </l3-network>
- </rest:payload>
- </rest:RESTResponse>"""
-
- String aaiVpnResponseStub =
- """<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- xmlns="http://org.openecomp.aai.inventory/v8"
- contentType="text/xml">
- <vpn-binding>
- <global-route-target/>
- </vpn-binding>
-</rest:payload>"""
-
- String queryVpnBindingAAIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Mon,14 Mar 2016 20:53:33 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID"
- value="localhost-20160314-20:53:33:487-134392"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <vpn-binding xmlns="http://org.openecomp.aai.inventory/v6">
- <vpn-id>9a7b327d9-287aa00-82c4b0-105757</vpn-id>
- <vpn-name>GN_EVPN_Test</vpn-name>
- <global-route-target>13979:105757</global-route-target>
- <relationship-list>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/689ec39e-c5fc-4462-8db2-4f760763ad28/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>689ec39e-c5fc-4462-8db2-4f760763ad28</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/1a49396b-19b3-40a4-8792-aa2fbd0f0704/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>1a49396b-19b3-40a4-8792-aa2fbd0f0704</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>l3-network</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v3/network/l3-networks/l3-network/774f3329-3c83-4771-86c7-9e6207cd50fd/</related-link>
- <relationship-data>
- <relationship-key>l3-network.network-id</relationship-key>
- <relationship-value>774f3329-3c83-4771-86c7-9e6207cd50fd</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </vpn-binding>
- </rest:payload>
-</rest:RESTResponse>"""
-
String updateNetworkRequest =
"""<updateNetworkRequest>
@@ -1172,271 +544,10 @@ String updateNetworkRequest_noPhysicalName =
</networkRollback>
</rollbackNetworkRequest>"""
- String updateNetworkResponse =
- """<ns2:updateNetworkContrailResponse xmlns:ns2="http://org.onap.so/network"
- xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <networkStackId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkStackId>
- <networkFqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</networkFqdn>
- <subnetIdMap>
- <entry>
- <key>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</key>
- <value>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</value>
- </entry>
- </subnetIdMap>
- <rollback>
- <cloudId>RDM2WAGPLCP</cloudId>
- <msoRequest>
- <requestId>1ef47428-cade-45bd-a103-0751e8b2deb0</requestId>
- <serviceInstanceId/>
- </msoRequest>
- <networkUpdated>true</networkUpdated>
- <networkId>MNS-25180-L-01-dmz_direct_net_1/2c88a3a9-69b9-43a7-ada6-1aca577c3641</networkId>
- <networkType>CONTRAIL_EXTERNAL</networkType>
- <networkUpdated>false</networkUpdated>
- <neutronNetworkId>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutronNetworkId>
- <tenantId>7dd5365547234ee8937416c65507d266</tenantId>
- </rollback>
-</ns2:updateNetworkContrailResponse>"""
-
- String updateContrailAAIPayloadRequest =
- """<l3-network xmlns="http://org.openecomp.aai.inventory/v9">
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>dmz_direct</network-role>
- <network-technology>contrail</network-technology>
- <neutron-network-id>c4f4e878-cde0-4b15-ae9a-bda857759cea</neutron-network-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <network-role-instance>0</network-role-instance>
- <resource-version>l3-version</resource-version>
- <orchestration-status>Active</orchestration-status>
- <heat-stack-id>ST_2Bindings_6006/55288ef0-595c-47d3-819e-cf93aaac6326</heat-stack-id>
- <contrail-network-fqdn>default-domain:MSOTest:GN_EVPN_direct_net_0_ST1</contrail-network-fqdn>
- <physical-network-name>networkName</physical-network-name>
- <is-provider-network>false</is-provider-network>
- <is-shared-network>true</is-shared-network>
- <is-external-network>false</is-external-network>
- <subnets>
- <subnet>
- <subnet-id>57e9a1ff-d14f-4071-a828-b19ae98eb2fc</subnet-id>
- <neutron-subnet-id>bd8e87c6-f4e2-41b8-b0bc-9596aa00cd73</neutron-subnet-id>
- <gateway-address>107.239.52.1</gateway-address>
- <network-start-address>107.239.52.0</network-start-address>
- <cidr-mask>24</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>Active</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <subnet-role>ECOMP</subnet-role>
- <resource-version>1505857300987</resource-version>
- <subnet-name>subnetName</subnet-name>
- <ip-assignment-direction>true</ip-assignment-direction>
- <host-routes>
- <host-route>
- <host-route-id>400d286b-7e44-4514-b9b3-f70f7360ff32</host-route-id>
- <route-prefix>172.20.1.0/24</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857300987</resource-version>
- </host-route>
- <host-route>
- <host-route-id>6f038013-8b15-4eb8-914b-507489fbc8ee</host-route-id>
- <route-prefix>10.102.0.0/16</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <next-hop-type>ip-address</next-hop-type>
- <resource-version>1505857301151</resource-version>
- </host-route>
- <host-route>
- <host-route-id>8811c5f8-f1ed-4fa0-a505-e1be60396e28</host-route-id>
- <route-prefix>192.168.2.0/25</route-prefix>
- <next-hop>10.102.200.1</next-hop>
- <next-hop-type/>
- <resource-version>1505857301954</resource-version>
- </host-route>
- </host-routes>
- </subnet>
- </subnets>
- <segmentation-assignments>
- <segmentation-id>414</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <segmentation-assignments>
- <segmentation-id>415</segmentation-id>
- <resource-version>4132176</resource-version>
- </segmentation-assignments>
- <ctag-assignments>
- <ctag-assignment>
- <vlan-id-inner>inner</vlan-id-inner>
- <resource-version>ctag-version</resource-version>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/897deadc2b954a6bac6d3c197fb3525e/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>897deadc2b954a6bac6d3c197fb3525e</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>tenant.tenant-name</property-key>
- <property-value>MSOTest1</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/a290b841-f672-44dd-b9cd-6f8c20d7d8c8/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>a290b841-f672-44dd-b9cd-6f8c20d7d8c8</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest2</property-value>
- </related-to-property>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-ext1.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value>
- </relationship-data>
- <related-to-property>
- <property-key>vpn-binding.vpn-name</property-key>
- <property-value>oam_protected_net_6_MTN5_msotest1</property-value>
- </related-to-property>
- </relationship>
- </relationship-list>
- </ctag-assignment>
- </ctag-assignments>
- <relationship-list>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>vpn-binding</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/</related-link>
- <relationship-data>
- <relationship-key>vpn-binding.vpn-id</relationship-key>
- <relationship-value>c980a6ef-3b88-49f0-9751-dbad8608d0a6</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/cloud-infrastructure/tenants/tenant/7dd5365547234ee8937416c65507d266/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>7dd5365547234ee8937416c65507d266</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>network-policy</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg</related-link>
- <relationship-data>
- <relationship-key>network-policy.network-policy-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0cg</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN1</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- <relationship>
- <related-to>route-table-reference</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v8/network/route-table-references/route-table-reference/refFQDN2</related-link>
- <relationship-data>
- <relationship-key>route-table-reference.route-table-reference-id</relationship-key>
- <relationship-value>cee6d136-e378-4678-a024-2cd15f0ee0hi</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
-</l3-network>"""
-
-
- String updateContrailAAIResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Date" value="Thu,10 Mar 2016 00:01:18 GMT"/>
- <rest:header name="Content-Length" value="0"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID" value="mtcnjv9aaas03-20160310-00:01:18:551-132672"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
-</rest:RESTResponse>"""
-
- String updateNetworkErrorResponse =
- """<updateNetworkError>
- <messageId>680bd458-5ec1-4a16-b77c-509022e53450</messageId><category>INTERNAL</category>
- <message>400 Bad Request: The server could not comply with the request since it is either malformed or otherwise incorrect., error.type=StackValidationFailed, error.message=Property error: : resources.network.properties: : Unknown Property network_ipam_refs_data</message>
- <rolledBack>true</rolledBack>
- </updateNetworkError>"""
-
String networkException500 =
"""<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:VersionMismatch</faultcode><faultstring>"http://org.onap.so/network", the namespace on the "updateNetworkContrail" element, is not a valid SOAP version.</faultstring></soap:Fault></soap:Body></soap:Envelope>"""
- String aaiResponse =
- """<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
- statusCode="200">
- <rest:headers>
- <rest:header name="Transfer-Encoding" value="chunked"/>
- <rest:header name="Date" value="Sat,30 Jan 2016 20:09:24 GMT"/>
- <rest:header name="Expires" value="Thu,01 Jan 1970 00:00:00 UTC"/>
- <rest:header name="X-AAI-TXID"
- value="localhost-20160130-20:09:24:814-165843"/>
- <rest:header name="Content-Type" value="application/xml"/>
- <rest:header name="Server" value="Apache-Coyote/1.1"/>
- <rest:header name="Cache-Control" value="private"/>
- </rest:headers>
- <rest:payload contentType="text/xml">
- <l3-network xmlns="http://org.openecomp.aai.inventory/v3">
- <network-id>bdc5efe8-404a-409b-85f6-0dcc9eebae30</network-id>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-role>HSL_direct</network-role>
- <network-technology>contrail</network-technology>
- <neutron-network-id>8bbd3edf-b835-4610-96a2-a5cafa029042</neutron-network-id>
- <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>
- <orchestration-status>active</orchestration-status>
- <heat-stack-id>MNS-25180-L-01-dmz_direct_net_1/57594a56-1c92-4a38-9caa-641c1fa3d4b6</heat-stack-id>
- <subnets>
- <subnet>
- <subnet-id>ea5f2a2c-604f-47ff-a9c5-253ee4f0ef0a</subnet-id>
- <neutron-subnet-id>5a77fdc2-7789-4649-a1b9-6eaf1db1813a</neutron-subnet-id>
- <gateway-address>172.16.34.1</gateway-address>
- <network-start-address>172.16.34.0</network-start-address>
- <cidr-mask>28</cidr-mask>
- <ip-version>4</ip-version>
- <orchestration-status>active</orchestration-status>
- <dhcp-enabled>true</dhcp-enabled>
- <relationship-list/>
- </subnet>
- </subnets>
- <relationship-list>
- <relationship>
- <related-to>tenant</related-to>
- <related-link>https://aai-app-e2e.test.com:8443/aai/v3/cloud-infrastructure/tenants/tenant/e81d842d3e8b45c5a59f57cd76af3aaf/</related-link>
- <relationship-data>
- <relationship-key>tenant.tenant-id</relationship-key>
- <relationship-value>e81d842d3e8b45c5a59f57cd76af3aaf</relationship-value>
- </relationship-data>
- </relationship>
- </relationship-list>
- </l3-network>
- </rest:payload>
- </rest:RESTResponse>"""
-
String changeAssignSDNCRequest =
"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
xmlns:ns5="http://org.onap/so/request/types/v1"
@@ -1465,8 +576,8 @@ String updateNetworkRequest_noPhysicalName =
</service-information>
<network-request-information>
<network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- <network-type>CONTRAIL_EXTERNAL</network-type>
- <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+ <network-type>CONTRAIL30_BASIC</network-type>
+ <network-name>vprobes_pktinternal_net_4_1806</network-name>
<tenant>7dd5365547234ee8937416c65507d266</tenant>
<aic-cloud-region>RDM2WAGPLCP</aic-cloud-region>
</network-request-information>
@@ -1545,42 +656,6 @@ String assignResponse =
</sdncadapterworkflow:response-data>
</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
- String expected_sdncAdapterWorkflowResponse_Error =
- """<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns="com:att:sdnctl:vnf"
- xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1"
- xmlns:tag0="http://org.onap.so/workflow/sdnc/adapter/schema/v1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <sdncadapterworkflow:response-data>
- <tag0:RequestData xsi:type="xs:string">
- <output>
- <response-code>400</response-code>
- <response-message>Error writing to l3-netework</response-message>
- <ack-final-indicator>Y</ack-final-indicator>
- <svc-request-id>c79240d8-34b5-4853-af69-2021928dba00</svc-request-id>
- </output>
- </tag0:RequestData>
- </sdncadapterworkflow:response-data>
-</sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
-
- String sdncAdapterWorkflowFormattedResponse =
- """<aetgt:SDNCAdapterWorkflowResponse xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
- xmlns="com:att:sdnctl:vnf">
- <aetgt:response-data>
- <output>
- <svc-request-id>00703dc8-71ff-442d-a4a8-3adc5beef6a9</svc-request-id>
- <response-code>200</response-code>
- <ack-final-indicator>Y</ack-final-indicator>
- <network-information>
- <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
- </network-information>
- <service-information>
- <service-type>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-type>
- <service-instance-id>f70e927b-6087-4974-9ef8-c5e4d5847ca4</service-instance-id>
- <subscriber-name>notsurewecare</subscriber-name>
- </service-information>
- </output>
- </aetgt:response-data>
-</aetgt:SDNCAdapterWorkflowResponse>"""
String rollbackSDNCRequest =
"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
@@ -1649,6 +724,22 @@ String rollbackNetworkRequest =
// - - - - - - - -
+ @BeforeClass
+ static void initEnv() {
+ MockEnvironment mockEnvironment = mock(MockEnvironment.class)
+ when(mockEnvironment.getProperty("mso.workflow.global.default.aai.version")).thenReturn("14")
+ when(mockEnvironment.getProperty("mso.workflow.global.default.aai.namespace")).thenReturn("defaultTestNamespace")
+ when(mockEnvironment.getProperty("aai.endpoint")).thenReturn("http://localhost:8090")
+ UrnPropertiesReader urnPropertiesReader = new UrnPropertiesReader()
+ urnPropertiesReader.setEnvironment(mockEnvironment)
+ }
+
+ @AfterClass
+ static void cleanupEnv() {
+ UrnPropertiesReader urnPropertiesReader = new UrnPropertiesReader()
+ urnPropertiesReader.setEnvironment(null)
+ }
+
@Before
public void init()
{
@@ -1743,117 +834,126 @@ String rollbackNetworkRequest =
}
- @Test
- //@Ignore
- public void preProcessRequest_NetworkRequest() {
-
- println "************ preProcessRequest_Payload ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("isBaseVfModule")).thenReturn(true)
- when(mockExecution.getVariable("recipeTimeout")).thenReturn(0)
- when(mockExecution.getVariable("requestAction")).thenReturn("UPDATE")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("vnfId")).thenReturn("")
- when(mockExecution.getVariable("volumeGroupId")).thenReturn("")
- when(mockExecution.getVariable("networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4")
- when(mockExecution.getVariable("serviceType")).thenReturn("MOG")
- when(mockExecution.getVariable("networkType")).thenReturn("modelName")
- when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest)
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1610")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("mso.adapters.po.auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.rollback")).thenReturn("true")
- when(mockExecution.getVariable("disableRollback")).thenReturn("true")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.preProcessRequest(mockExecution)
-
-// verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix + "")
-
- //verify variable initialization
- initializeVariables(mockExecution)
-
- // Authentications
- verify(mockExecution).setVariable("action", "UPDATE")
- verify(mockExecution).setVariable(Prefix + "networkRequest", expectedNetworkRequest)
- verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
- verify(mockExecution).setVariable(Prefix + "networkInputs", expectedNetworkInputs)
- verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable(Prefix + "networkOutputs", "")
-
- }
-
- @Test
- //@Ignore
- public void preProcessRequest_vPERNetworkRequest() {
-
- String networkModelInfo = """{"modelUuid": "sn5256d1-5a33-55df-13ab-12abad84e111",
+ @Test
+ public void preProcessRequest_NetworkRequest() {
+
+ println "************ preProcessRequest_Payload ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("requestAction")).thenReturn("UPDATE")
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4")
+ when(mockExecution.getVariable("bpmnRequest")).thenReturn(jsonIncomingRequest)
+ when(mockExecution.getVariable("sdncVersion")).thenReturn("1610")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("mso.adapters.po.auth")).
+ thenReturn("5E12ACACBD552A415E081E29F2C4772F9835792A51C766CCFDD7433DB5220B59969CB2798C")
+ when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.preProcessRequest(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+
+ //verify variable initialization
+ initializeVariables(mockExecution)
+
+ // Authentications
+ verify(mockExecution).setVariable("action", "UPDATE")
+ verify(mockExecution).setVariable(Prefix + "networkRequest", expectedNetworkRequest)
+ verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
+ verify(mockExecution).setVariable(Prefix + "networkInputs", expectedNetworkInputs)
+ verify(mockExecution).setVariable(Prefix + "messageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ verify(mockExecution).setVariable(Prefix + "source", "VID")
+ verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic dGVzdDp0ZXN0")
+ verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic dGVzdDp0ZXN0")
+ verify(mockExecution).setVariable(Prefix + "serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ verify(mockExecution).setVariable(Prefix + "networkOutputs", """<network-outputs>
+\t <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+\t <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+\t </network-outputs>""")
+ verify(mockExecution).setVariable(Prefix + "networkId", "49c86598-f766-46f8-84f8-8d1c1b10f9b4")
+ verify(mockExecution).setVariable(Prefix + "networkName", "MNS-25180-L-01-dmz_direct_net_1")
+ }
+
+ @Test
+ public void preProcessRequest_vPERNetworkRequest() {
+
+ String networkModelInfo = """{"modelUuid": "sn5256d1-5a33-55df-13ab-12abad84e111",
"modelName": "CONTRAIL_EXTERNAL",
- "modelType": "CONTRAIL_EXTERNAL",
- "modelVersion": "1",
- "modelCustomizationUuid": "sn5256d1-5a33-55df-13ab-12abad84e222",
- "modelInvariantUuid": "sn5256d1-5a33-55df-13ab-12abad84e764"
- }""".trim()
-
- println "************ preProcessRequest_Payload ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("disableRollback")).thenReturn("true")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable("networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4") // optional
- when(mockExecution.getVariable("networkName")).thenReturn("MNS-25180-L-01-dmz_direct_net_1") // optional
- when(mockExecution.getVariable("productFamilyId")).thenReturn("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb")
- when(mockExecution.getVariable("networkModelInfo")).thenReturn("CONTRAIL_EXTERNAL")
- when(mockExecution.getVariable("lcpCloudRegionId")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable("tenantId")).thenReturn("7dd5365547234ee8937416c65507d266")
- when(mockExecution.getVariable("failIfExists")).thenReturn("false")
- when(mockExecution.getVariable("networkModelInfo")).thenReturn(networkModelInfo)
- when(mockExecution.getVariable("sdncVersion")).thenReturn("1702")
- when(mockExecution.getVariable("action")).thenReturn("UPDATE")
- when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("MSO-dev-service-type")
- when(mockExecution.getVariable("globalSubscriberId")).thenReturn("globalId_45678905678")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
-
- when(mockExecution.getVariable("mso.adapters.po.auth")).thenReturn("3141634BF7E070AA289CF2892C986C0B")
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
-
- when(mockExecution.getVariable("mso.rollback")).thenReturn("true")
- when(mockExecution.getVariable("mso.adapters.sdnc.endpoint")).thenReturn("http://localhost:8090/SDNCAdapter")
- when(mockExecution.getVariable("mso.adapters.network.rest.endpoint")).thenReturn("http://localhost:8090/networks/NetworkAdapter")
- when(mockExecution.getVariable("mso.adapters.sdnc.resource.endpoint")).thenReturn("http://localhost:8090/SDNCAdapterRpc")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.preProcessRequest(mockExecution)
-
-// verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix + "")
-
- //verify variable initialization
- initializeVariables(mockExecution)
-
- // Authentications
- verify(mockExecution).setVariable("action", "UPDATE")
- verify(mockExecution).setVariable(Prefix + "networkRequest", expectedVperNetworkRequest)
- verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
- verify(mockExecution).setVariable(Prefix + "networkInputs", expectedVperNetworkInputs)
- verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic cGFzc3dvcmQ=")
- verify(mockExecution).setVariable(Prefix + "networkOutputs", "")
-
- }
-
- @Test
+ "modelType": "CONTRAIL_EXTERNAL",
+ "modelVersion": "1",
+ "modelCustomizationUuid": "sn5256d1-5a33-55df-13ab-12abad84e222",
+ "modelInvariantUuid": "sn5256d1-5a33-55df-13ab-12abad84e764"
+ }""".trim()
+
+ println "************ preProcessRequest_Payload ************* "
+
+ ExecutionEntity mockExecution = setupMock()
+
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("msoRequestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("action")).thenReturn("UPDATE")
+
+ when(mockExecution.getVariable("disableRollback")).thenReturn("true")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable("networkId")).thenReturn("49c86598-f766-46f8-84f8-8d1c1b10f9b4") // optional
+ when(mockExecution.getVariable("networkName")).thenReturn("MNS-25180-L-01-dmz_direct_net_1") // optional
+ when(mockExecution.getVariable("productFamilyId")).thenReturn("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb")
+ when(mockExecution.getVariable("networkModelInfo")).thenReturn("CONTRAIL_EXTERNAL")
+ when(mockExecution.getVariable("lcpCloudRegionId")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable("tenantId")).thenReturn("7dd5365547234ee8937416c65507d266")
+ when(mockExecution.getVariable("failIfExists")).thenReturn("false")
+ when(mockExecution.getVariable("networkModelInfo")).thenReturn(networkModelInfo)
+ when(mockExecution.getVariable("sdncVersion")).thenReturn("1702")
+
+ when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("MSO-dev-service-type")
+ when(mockExecution.getVariable("globalSubscriberId")).thenReturn("globalId_45678905678")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+
+ when(mockExecution.getVariable("mso.adapters.po.auth")).
+ thenReturn("5E12ACACBD552A415E081E29F2C4772F9835792A51C766CCFDD7433DB5220B59969CB2798C")
+ when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+
+ when(mockExecution.getVariable("mso.rollback")).thenReturn("true")
+ when(mockExecution.getVariable("mso.adapters.sdnc.endpoint")).
+ thenReturn("http://localhost:8090/SDNCAdapter")
+ when(mockExecution.getVariable("mso.adapters.network.rest.endpoint")).
+ thenReturn("http://localhost:8090/networks/NetworkAdapter")
+ when(mockExecution.getVariable("mso.adapters.sdnc.resource.endpoint")).
+ thenReturn("http://localhost:8090/SDNCAdapterRpc")
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.preProcessRequest(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+
+ //verify variable initialization
+ initializeVariables(mockExecution)
+
+ // Authentications
+ verify(mockExecution).setVariable("action", "UPDATE")
+ verify(mockExecution).setVariable(Prefix + "networkRequest", expectedVperNetworkRequest)
+ verify(mockExecution).setVariable(Prefix + "rollbackEnabled", false)
+ verify(mockExecution).setVariable(Prefix + "networkInputs", expectedVperNetworkInputs)
+ verify(mockExecution).setVariable(Prefix + "messageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ verify(mockExecution).setVariable(Prefix + "source", "VID")
+ verify(mockExecution).setVariable("BasicAuthHeaderValuePO", "Basic dGVzdDp0ZXN0")
+ verify(mockExecution).setVariable("BasicAuthHeaderValueSDNC", "Basic dGVzdDp0ZXN0")
+ verify(mockExecution).setVariable(Prefix + "serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ verify(mockExecution).setVariable(eq(Prefix + "networkOutputs"), eq("""<network-outputs>
+\t <network-id>49c86598-f766-46f8-84f8-8d1c1b10f9b4</network-id>
+\t <network-name>MNS-25180-L-01-dmz_direct_net_1</network-name>
+\t </network-outputs>"""))
+
+ verify(mockExecution).setVariable(Prefix + "networkId", "49c86598-f766-46f8-84f8-8d1c1b10f9b4")
+ verify(mockExecution).setVariable(Prefix + "networkName", "MNS-25180-L-01-dmz_direct_net_1")
+ }
+
+ @Test
//@Ignore
public void preProcessRequest_MissingNetworkId() {
@@ -1968,107 +1068,88 @@ String rollbackNetworkRequest =
}
- @Test
- //@Ignore
- public void prepareUpdateNetworkRequest() {
-
- println "************ prepareNetworkRequest ************* "
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedVperNetworkRequest)
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
- when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
- //when(mockExecution.getVariable(Prefix + "queryVpnBindingAAIResponse")).thenReturn(queryVpnBindingAAIResponse)
- when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
- when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
- when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("<routeTableFqdns>refFQDN1</routeTableFqdns><routeTableFqdns>refFQDN2</routeTableFqdns>")
- when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.prepareUpdateNetworkRequest(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix + "")
-
- verify(mockExecution).setVariable(Prefix + "updateNetworkRequest", updateNetworkRequest)
-
- }
-
-
- @Test
- //@Ignore
- public void prepareUpdateNetworkRequest_NoPhysicalname() {
-
- println "************ prepareNetworkRequest ************* "
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(NetworkRequest_noPhysicalName)
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
- when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
- //when(mockExecution.getVariable(Prefix + "queryVpnBindingAAIResponse")).thenReturn(queryVpnBindingAAIResponse)
- when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
- when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
- when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("")
- when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- //when(mockExecution.getVariable("URN_?????")).thenReturn("") // notificationUrl, //TODO - is this coming from URN? What variable/value to use?
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.prepareUpdateNetworkRequest(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix + "")
-
- verify(mockExecution).setVariable(Prefix + "updateNetworkRequest", updateNetworkRequest_noPhysicalName)
-
- }
-
- @Test
- //@Ignore
- public void prepareSDNCRequest() {
-
- println "************ prepareSDNCRequest ************* "
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
- when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
- when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(aaiResponse)
- when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
- when(mockExecution.getVariable("mso.workflow.sdncadapter.callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn("https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/")
-
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.prepareSDNCRequest(mockExecution)
-
- // verify set prefix = Prefix + ""
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "changeAssignSDNCRequest", changeAssignSDNCRequest)
-
- }
+ @Test
+ public void prepareUpdateNetworkRequest() {
+
+ println "************ prepareNetworkRequest ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedVperNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(getContrailL3Network())
+ when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
+ when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
+ when(mockExecution.getVariable(Prefix + "routeCollection")).
+ thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
+ when(mockExecution.getVariable(Prefix + "networkCollection")).
+ thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
+ when(mockExecution.getVariable(Prefix + "tableRefCollection")).
+ thenReturn("<routeTableFqdns>refFQDN1</routeTableFqdns><routeTableFqdns>refFQDN2</routeTableFqdns>")
+ when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.prepareUpdateNetworkRequest(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "updateNetworkRequest", updateNetworkRequest)
+ }
+
+
+ @Test
+ public void prepareUpdateNetworkRequest_NoPhysicalname() {
+
+ println "************ prepareNetworkRequest ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "requestId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("messageId_generated")
+ when(mockExecution.getVariable(Prefix + "source")).thenReturn("VID")
+
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(NetworkRequest_noPhysicalName)
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).
+ thenReturn(getContrailL3Network())
+ when(mockExecution.getVariable(Prefix + "cloudRegionPo")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "rollbackEnabled")).thenReturn("true")
+
+ when(mockExecution.getVariable(Prefix + "routeCollection")).thenReturn("<routeTargets>13979:105757</routeTargets><routeTargets>13979:105757</routeTargets>")
+ when(mockExecution.getVariable(Prefix + "networkCollection")).thenReturn("<policyFqdns>GN_EVPN_Test</policyFqdns>")
+ when(mockExecution.getVariable(Prefix + "tableRefCollection")).thenReturn("")
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.prepareUpdateNetworkRequest(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "updateNetworkRequest", updateNetworkRequest_noPhysicalName)
+ }
+
+ @Test
+ public void prepareSDNCRequest() {
+
+ println "************ prepareSDNCRequest ************* "
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "cloudRegionSdnc")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(Prefix + "serviceInstanceId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4")
+ when(mockExecution.getVariable(Prefix + "queryIdAAIResponse")).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json")))
+ when(mockExecution.getVariable("mso-request-id")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("testMessageId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56")
+ when(mockExecution.getVariable("mso.workflow.sdncadapter.callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("GENGSI_siResourceLink")).thenReturn(
+ "https://aai-int1.test.com:8443/aai/v8/business/customers/customer/MSO_1610_dev/service-subscriptions/service-subscription/MSO-dev-service-type/service-instances/service-instance/6d4eb22a-82f1-4257-9f80-4176262cfe69/")
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.prepareSDNCRequest(mockExecution)
+
+ // verify set prefix = Prefix + ""
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "changeAssignSDNCRequest", changeAssignSDNCRequest)
+ }
@Test
//@Ignore
@@ -2101,614 +1182,412 @@ String rollbackNetworkRequest =
}
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkId_200() {
+ @Test
+ public void callRESTQueryAAINetworkId_200() {
+
+ println "************ callRESTQueryAAINetworkId ************* "
+
+ WireMock.reset();
+ MockGetNetworkByIdWithDepth(wireMockRule, "49c86598-f766-46f8-84f8-8d1c1b10f9b4",
+ "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "1");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkId(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "aaiIdReturnCode", "200")
+ verify(mockExecution).setVariable(eq(Prefix + "queryIdAAIResponse"), isA(AAIResultWrapper.class))
+ }
+
+ @Test
+ public void callRESTQueryAAICloudRegion30_200() {
+
+ println "************ callRESTQueryAAICloudRegion30_200 ************* "
+
+ WireMock.reset();
+ MockGetNetworkCloudRegion(wireMockRule, "CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml", "RDM2WAGPLCP");
+
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
+ when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
+ when(mockExecution.getVariable("mso.workflow.default.aai.v8.cloud-region.uri")).
+ thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
+ when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+ when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
+
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
+ verify(mockExecution, atLeast(2)).setVariable(Prefix + "queryCloudRegionReturnCode", "200")
+ verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
+ }
+
+ @Test
+ public void callRESTQueryAAICloudRegion25_200() {
- println "************ callRESTQueryAAINetworkId ************* "
+ println "************ callRESTQueryAAICloudRegion25_200 ************* "
- WireMock.reset();
- MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "all");
+ WireMock.reset();
+ MockGetNetworkCloudRegion(wireMockRule, "CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.DoUpdateNetworkInstance.aai.l3-network.uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkId(mockExecution)
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
+ when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
+ when(mockExecution.getVariable("mso.workflow.default.aai.v8.cloud-region.uri")).
+ thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
+ when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+ when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "queryIdAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all")
- verify(mockExecution).setVariable(Prefix + "aaiIdReturnCode", "200")
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
+ }
- }
+ @Test
+ public void callRESTQueryAAICloudRegion_NotFound() {
- @Test
- //@Ignore
- public void callRESTQueryAAICloudRegion30_200() {
+ println "************ callRESTQueryAAICloudRegionFake ************* "
- println "************ callRESTQueryAAICloudRegion30_200 ************* "
+ WireMock.reset();
+ MockGetNetworkCloudRegion_404(wireMockRule, "MDTWNJ21");
- WireMock.reset();
- MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml", "RDM2WAGPLCP");
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(vnfRequestFakeRegion)
+ when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
+ when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
+ when(mockExecution.getVariable("mso.workflow.default.aai.v8.cloud-region.uri")).
+ thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner")
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
+ when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
+ when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.cloud-region.uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
+ verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
+ verify(mockExecution, atLeast(1)).setVariable(Prefix + "queryCloudRegionReturnCode", "404")
+ verify(mockExecution).setVariable(Prefix + "cloudRegionPo", "MDTWNJ21")
+ verify(mockExecution).setVariable(Prefix + "cloudRegionSdnc", "AAIAIC25")
+ verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
+ }
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "queryCloudRegionReturnCode", "200")
- verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
+ @Test
+ public void callRESTQueryAAINetworkVpnBinding_200() {
- }
+ println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
- @Test
- public void callRESTQueryAAICloudRegion25_200() {
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/BuildingBlocks/Network/queryAAIResponseEmptyUri.json")))
- println "************ callRESTQueryAAICloudRegion25_200 ************* "
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
+ verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIResponse",
+ """<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ xmlns="defaultTestNamespacev14"\n contentType="text/xml">\n <vpn-binding>
+ <global-route-target/>\n </vpn-binding>\n</rest:payload>""")
+ verify(mockExecution).setVariable(Prefix + "routeCollection", "<routeTargets/>")
+ }
+
+ @Test
+ public void callRESTQueryAAINetworkVpnBindingList_200() {
+
+ println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
- WireMock.reset();
- MockGetNetworkCloudRegion("CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml", "RDM2WAGPLCP");
+ WireMock.reset();
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.cloud-region.uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
-
- }
-
- @Test
- //@Ignore
- public void callRESTQueryAAICloudRegion_NotFound() {
-
- println "************ callRESTQueryAAICloudRegionFake ************* "
-
- WireMock.reset();
- MockGetNetworkCloudRegion_404("MDTWNJ21");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable(Prefix + "networkInputs")).thenReturn(vnfRequestFakeRegion)
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.cloud-region.uri")).thenReturn("/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAICloudRegion(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution, atLeast(1)).setVariable("prefix", Prefix + "")
- verify(mockExecution, atLeast(1)).setVariable(Prefix + "queryCloudRegionReturnCode", "404")
- verify(mockExecution).setVariable(Prefix + "cloudRegionPo", "MDTWNJ21")
- verify(mockExecution).setVariable(Prefix + "cloudRegionSdnc", "AAIAIC25")
- verify(mockExecution).setVariable(Prefix + "isCloudRegionGood", true)
-
- }
+ MockGetNetworkVpnBindingWithDepth(wireMockRule,
+ "BuildingBlocks/Network/queryAAIVpnBindingTestResponseWithRoutes.json",
+ "13e94b71-3ce1-4988-ab0e-61208fc91f1c", "2")
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBinding_200() {
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json")))
- println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
- WireMock.reset();
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "routeCollection", """<routeTargets>
+ <routeTarget>2001:051111</routeTarget>\n <routeTargetRole>EXPORT</routeTargetRole>\n</routeTargets>
+<routeTargets>\n <routeTarget>1000:051113</routeTarget>\n <routeTargetRole>IMPORT</routeTargetRole>\n</routeTargets>\n""")
+ }
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse) // v6
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.vpn-binding.uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+ @Test
+ public void callRESTQueryAAINetworkVpnBinding_200_URN_Uri() {
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
+ println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "vpnCount", 2)
- verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/', '/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
+ WireMock.reset();
+ MockGetNetworkVpnBindingWithDepth(wireMockRule,
+ "BuildingBlocks/Network/queryAAIVpnBindingTestResponseWithRoutes.json",
+ "13e94b71-3ce1-4988-ab0e-61208fc91f1c", "2");
- }
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json")))
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBindingList_200() {
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
- println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "routeCollection",
+ """<routeTargets>\n <routeTarget>2001:051111</routeTarget>\n <routeTargetRole>EXPORT</routeTargetRole>
+</routeTargets>\n<routeTargets>\n <routeTarget>1000:051113</routeTarget>\n <routeTargetRole>IMPORT</routeTargetRole>
+</routeTargets>\n""")
+ }
- WireMock.reset();
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBindingList_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBindingList_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
+ @Test
+ public void callRESTQueryAAINetworkVpnBinding_NotPresent() {
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse) // v6
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.vpn-binding.uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+ println "************ callRESTQueryAAINetworkVpnBinding_NotPresent ************* "
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+ WireMock.reset();
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "vpnCount", 2)
- verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/', '/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
+ MockGetNetworkVpnBindingWithDepth(wireMockRule,
+ "BuildingBlocks/Network/queryAAIVpnBindingTestResponse.json",
+ "13e94b71-3ce1-4988-ab0e-61208fc91f1c", "2")
- }
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json")))
-
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBinding_TestScenario01_200() {
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
- println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "routeCollection", "")
+ }
- WireMock.reset();
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponseTestScenario01)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.vpn-binding.uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+ @Test
+ public void callRESTQueryAAINetworkTableRef_200() {
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
+ println "************ callRESTQueryAAINetworkTableRef_200 ************* "
+ WireMock.reset();
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "vpnCount", 1)
- verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all")
- verify(mockExecution).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json")))
- }
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkTableRef(mockExecution)
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBinding_200_URN_Uri() {
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "networkTableRefCount", 0)
+ verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "200")
+ verify(mockExecution).setVariable(Prefix + "queryNetworkTableRefAAIResponse",
+ """<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ xmlns="defaultTestNamespacev14"\n contentType="text/xml">\n <route-table-references>
+ <route-table-reference-fqdn/>\n </route-table-references>\n</rest:payload>""")
+ verify(mockExecution).setVariable(Prefix + "tableRefCollection", "<routeTableFqdns/>")
+ }
- println "************ callRESTQueryAAINetworkVpnBinding_200 ************* "
+ @Test
+ public void callRESTQueryAAINetworkPolicy_200() {
- WireMock.reset();
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "c980a6ef-3b88-49f0-9751-dbad8608d0a6");
+ println "************ callRESTQueryAAINetworkPolicy_200 ************* "
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.vpn-binding.uri")).thenReturn("/aai/v8/network/vpn-bindings/vpn-binding")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+ WireMock.reset();
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json")))
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTQueryAAINetworkPolicy(mockExecution)
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "vpnCount", 2)
- verify(mockExecution).setVariable(Prefix + "vpnBindings", ['/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/', '/aai/v8/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIRequest", "http://localhost:8090/aai/v8/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017?depth=all")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "networkPolicyCount", 0)
+ verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "200")
+ verify(mockExecution).setVariable(Prefix + "queryNetworkPolicyAAIResponse",
+ """<rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
+ xmlns="defaultTestNamespacev14"\n contentType="text/xml">\n <network-policy>
+ <network-policy-fqdn/>\n </network-policy>\n</rest:payload>""")
+ verify(mockExecution).setVariable(Prefix + "networkCollection", "<policyFqdns/>")
+ }
- }
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkVpnBinding_NotPresent() {
+ @Test
+ public void callRESTReQueryAAINetworkId_200() {
- println "************ callRESTQueryAAINetworkVpnBinding_NotPresent ************* "
+ println "************ callRESTReQueryAAINetworkId ************* "
- WireMock.reset();
- MockGetNetworkVpnBinding("UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml", "85f015d0-2e32-4c30-96d2-87a1a27f8017");
+ WireMock.reset();
+ MockGetNetworkByIdWithDepth(wireMockRule, "49c86598-f766-46f8-84f8-8d1c1b10f9b4",
+ "BuildingBlocks/Network/queryAAINetworkTestResponse.json", "1");
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponseVpnNotPresent)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.l3-network.uri")).thenReturn("/aai/v8/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTReQueryAAINetworkId(mockExecution)
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkVpnBinding(mockExecution)
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "aaiRequeryIdReturnCode", "200")
+ verify(mockExecution).setVariable(eq(Prefix + "requeryIdAAIResponse"), isA(AAIResultWrapper.class))
+ verify(mockExecution).setVariable(Prefix + "networkOutputs", """<network-outputs>
+ <network-id>467e3349-bec1-4922-bcb1-d0bb041bce30</network-id>
+ <network-name>vprobes_pktinternal_net_4_1806</network-name>
+ </network-outputs>""")
+ }
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "aaiQqueryVpnBindingReturnCode", "200")
- verify(mockExecution).setVariable(Prefix + "vpnCount", 0)
- verify(mockExecution).setVariable(Prefix + "queryVpnBindingAAIResponse", aaiVpnResponseStub)
+ @Test
+ public void callRESTUpdateContrailAAINetworkREST_200() {
- }
+ println "************ callRESTUpdateContrailAAINetwork ************* "
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkTableRef_200() {
+ WireMock.reset();
+ MockPostNetwork(wireMockRule, "49c86598-f766-46f8-84f8-8d1c1b10f9b4")
+ MockPostNetworkSubnet(wireMockRule, "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "209f62cf-cf0c-42f8-b13c-f038b92ef108")
+ MockPostNetworkSubnet(wireMockRule, "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "971bc608-1aff-47c0-923d-92e43b699f01")
- println "************ callRESTQueryAAINetworkTableRef_200 ************* "
+ ExecutionEntity mockExecution = setupMock()
+ when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
+ when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(
+ new AAIResultWrapper(FileUtil.readResourceFile("__files/BuildingBlocks/Network/queryAAIResponseEmptyUri.json")))
+ when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(updateNetworkResponseREST)
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.callRESTUpdateContrailAAINetwork(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "isPONR", true)
+ }
- WireMock.reset();
- MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef1_AAIResponse_Success.xml", "refFQDN1");
- MockGetNetworkTableReference("UpdateNetworkV2/updateNetwork_queryNetworkTableRef2_AAIResponse_Success.xml", "refFQDN2");
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.default.aai.network-table-reference.uri")).thenReturn("")
- when(mockExecution.getVariable("mso.workflow.DoUpdateNetworkInstance.aai.route-table-reference.uri")).thenReturn("/aai/v8/network/route-table-references/route-table-reference")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+ @Test
+ public void validateUpdateNetworkResponseREST() {
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkTableRef(mockExecution)
+ println "************ validateNetworkResponse ************* "
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(updateNetworkResponseREST)
+ when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('200')
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.validateUpdateNetworkResponse(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution).setVariable(Prefix + "updateNetworkResponse", updateNetworkResponseREST)
+ verify(mockExecution).setVariable(Prefix + "isNetworkRollbackNeeded", true)
+ verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", updateRollbackNetworkRequest)
+ }
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
+ @Test
+ public void validateUpdateNetworkResponseREST_Error() {
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "networkTableRefCount", 2)
- verify(mockExecution).setVariable(Prefix + "networkTableRefUriList", ['/aai/v8/network/route-table-references/route-table-reference/refFQDN1','/aai/v8/network/route-table-references/route-table-reference/refFQDN2'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryNetworkTableRefAAIRequest", "http://localhost:8090/aai/v8/network/route-table-references/route-table-reference/refFQDN1?depth=all")
- verify(mockExecution, atLeast(2)).setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "200")
+ println "************ validateNetworkResponse ************* "
- }
+ WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
- @Test
- //@Ignore
- public void callRESTQueryAAINetworkPolicy_200() {
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(networkException500)
+ when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('500')
- println "************ callRESTQueryAAINetworkPolicy_200 ************* "
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ try {
+ DoUpdateNetworkInstance.validateUpdateNetworkResponse(mockExecution)
+ } catch (Exception ex) {
+ println " Test End - Handle catch-throw BpmnError()! "
+ }
- WireMock.reset();
- MockGetNetworkPolicy("UpdateNetworkV2/updateNetwork_queryNetworkPolicy_AAIResponse_Success.xml", "cee6d136-e378-4678-a024-2cd15f0ee0cg");
+ verify(mockExecution).setVariable("prefix", Prefix + "")
+ verify(mockExecution, atLeast(1)).setVariable(eq("WorkflowException"), refEq(workflowException))
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.version")).thenReturn("8")
- when(mockExecution.getVariable("mso.workflow.default.aai.v8.network-policy.uri")).thenReturn("/aai/v8/network/network-policies/network-policy")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
+ }
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTQueryAAINetworkPolicy(mockExecution)
+ @Test
+ public void validateSDNCResponse() {
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
+ println "************ validateSDNCResponse ************* "
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "networkPolicyCount", 1)
- verify(mockExecution).setVariable(Prefix + "networkPolicyUriList", ['/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg'])
- // the last vpnBinding value is saved.
- verify(mockExecution).setVariable(Prefix + "queryNetworkPolicyAAIRequest", "http://localhost:8090/aai/v8/network/network-policies/network-policy/cee6d136-e378-4678-a024-2cd15f0ee0cg?depth=all")
- verify(mockExecution).setVariable(Prefix + "aaiQqueryNetworkPolicyReturnCode", "200")
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse)
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
+ when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
+ when(mockExecution.getVariable(Prefix + "sdncResponseSuccess")).thenReturn(true)
- }
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.validateSDNCResponse(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", false)
+ verify(mockExecution).setVariable(Prefix + "sdncRequestDataResponseCode", "200")
+ verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", true)
+ verify(mockExecution).setVariable(Prefix + "changeAssignSDNCResponse", sdncAdapterWorkflowResponse)
+ verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
+ }
+
+ @Test(expected = BpmnError.class)
+ public void validateSDNCResponse_Error() {
-
- @Test
- //@Ignore
- public void callRESTReQueryAAINetworkId_200() {
-
- println "************ callRESTReQueryAAINetworkId ************* "
-
- WireMock.reset();
- MockGetNetworkByIdWithDepth("49c86598-f766-46f8-84f8-8d1c1b10f9b4", "UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml", "all");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowFormattedResponse)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.DoUpdateNetworkInstance.aai.l3-network.uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTReQueryAAINetworkId(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "requeryIdAAIRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all")
- verify(mockExecution).setVariable(Prefix + "aaiRequeryIdReturnCode", "200")
-
- }
-
-
- @Test
- //@Ignore
- public void callRESTUpdateContrailAAINetworkREST_200() {
-
- println "************ callRESTUpdateContrailAAINetwork ************* "
-
- WireMock.reset();
- MockPutNetworkIdWithDepth("UpdateNetworkV2/updateNetwork_updateContrail_AAIResponse_Success.xml", "49c86598-f766-46f8-84f8-8d1c1b10f9b4", "all");
-
- ExecutionEntity mockExecution = setupMock()
- when(mockExecution.getVariable(Prefix + "networkRequest")).thenReturn(expectedNetworkRequest)
- when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowFormattedResponse)
- when(mockExecution.getVariable(Prefix + "requeryIdAAIResponse")).thenReturn(queryIdAIIResponse)
- when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(updateNetworkResponseREST)
- when(mockExecution.getVariable(Prefix + "messageId")).thenReturn("e8ebf6a0-f8ea-4dc0-8b99-fe98a87722d6")
- when(mockExecution.getVariable("aai.endpoint")).thenReturn("http://localhost:8090")
- when(mockExecution.getVariable("mso.workflow.DoUpdateNetworkInstance.aai.l3-network.uri")).thenReturn("/aai/v9/network/l3-networks/l3-network")
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn('http://org.openecomp.aai.inventory/')
- when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
- when(mockExecution.getVariable("aai.auth")).thenReturn("757A94191D685FD2092AC1490730A4FC")
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.callRESTUpdateContrailAAINetwork(mockExecution)
-
- // check the sequence of variable invocation
- //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl()
- //preDebugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "updateContrailAAIUrlRequest", "http://localhost:8090/aai/v9/network/l3-networks/l3-network/49c86598-f766-46f8-84f8-8d1c1b10f9b4"+"?depth=all")
- verify(mockExecution).setVariable(Prefix + "updateContrailAAIPayloadRequest", updateContrailAAIPayloadRequest)
- verify(mockExecution).setVariable(Prefix + "aaiUpdateContrailReturnCode", "200")
- //verify(mockExecution).setVariable(Prefix + "updateContrailAAIResponse", updateContrailAAIResponse)
- verify(mockExecution).setVariable(Prefix + "isPONR", true)
-
- }
-
-
-
- @Test
- //@Ignore
- public void validateUpdateNetworkResponseREST() {
-
- println "************ validateNetworkResponse ************* "
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(updateNetworkResponseREST)
- when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('200')
-
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.validateUpdateNetworkResponse(mockExecution)
-
- //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
- //debugger.printInvocations(mockExecution)
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution).setVariable(Prefix + "updateNetworkResponse", updateNetworkResponseREST)
- verify(mockExecution).setVariable(Prefix + "isNetworkRollbackNeeded", true)
- verify(mockExecution).setVariable(Prefix + "rollbackNetworkRequest", updateRollbackNetworkRequest)
-
- }
-
- @Test
- //@Ignore
- public void validateUpdateNetworkResponseREST_Error() {
-
- println "************ validateNetworkResponse ************* "
-
- WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "updateNetworkResponse")).thenReturn(networkException500)
- when(mockExecution.getVariable(Prefix + "networkReturnCode")).thenReturn('500')
-
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- try {
- DoUpdateNetworkInstance.validateUpdateNetworkResponse(mockExecution)
- } catch (Exception ex) {
- println " Test End - Handle catch-throw BpmnError()! "
- }
-
- verify(mockExecution).setVariable("prefix", Prefix + "")
- verify(mockExecution, atLeast(1)).setVariable("WorkflowException", refEq(workflowException, any(WorkflowException.class)))
-
- }
-
- @Test
- //@Ignore
- public void validateSDNCResponse() {
-
- println "************ validateSDNCResponse ************* "
-
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse)
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
- when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
- when(mockExecution.getVariable(Prefix + "isResponseGood")).thenReturn(true)
-
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- try {
- DoUpdateNetworkInstance.validateSDNCResponse(mockExecution)
- verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
- verify(mockExecution).setVariable(Prefix + "rollbackSDNCRequest", "")
-
- } catch (Exception ex) {
- println " Graceful Exit - " + ex.getMessage()
- }
- //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
- //debugger.printInvocations(mockExecution)
-
- //verify(mockExecution).setVariable(Prefix + "isSdncRollbackNeeded", true)
-
- }
-
- @Test
- //@Ignore
- public void validateSDNCResponse_Error() {
-
- println "************ validateSDNCResponse ************* "
- //ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- ExecutionEntity mockExecution = setupMock()
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse_Error)
- when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
- when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(false)
- when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
- when(mockExecution.getVariable(Prefix + "isResponseGood")).thenReturn(true)
-
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- try {
- DoUpdateNetworkInstance.validateSDNCResponse(mockExecution)
- } catch (Exception ex) {
- println " Graceful Exit! - " + ex.getMessage()
- }
- //MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
- //debugger.printInvocations(mockExecution)
-
- // verify set prefix = Prefix + ""
- //verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", false)
-
- }
-
- @Test
- //@Ignore
- public void prepareRollbackData() {
-
- println "************ prepareRollbackData() ************* "
-
-
-
- WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
-
- ExecutionEntity mockExecution = mock(ExecutionEntity.class)
- // Initialize prerequisite variables
- when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
- when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn(rollbackSDNCRequest)
- when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(rollbackNetworkRequest)
- when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException)
-
- // preProcessRequest(DelegateExecution execution)
- DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
- DoUpdateNetworkInstance.prepareRollbackData(mockExecution)
-
-// verify(mockExecution).getVariable("isDebugLogEnabled")
- verify(mockExecution).setVariable("prefix", Prefix)
-
- }
+ println "************ validateSDNCResponse ************* "
+ ExecutionEntity mockExecution = setupMock()
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "changeAssignSDNCResponse")).thenReturn(sdncAdapterWorkflowResponse_Error)
+ when(mockExecution.getVariable("prefix")).thenReturn(Prefix + "")
+ when(mockExecution.getVariable("SDNCA_SuccessIndicator")).thenReturn(false)
+ when(mockExecution.getVariable(Prefix + "sdncReturnCode")).thenReturn("200")
+ when(mockExecution.getVariable(Prefix + "isResponseGood")).thenReturn(true)
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ try {
+ DoUpdateNetworkInstance.validateSDNCResponse(mockExecution)
+ } catch (BpmnError ex) {
+ verify(mockExecution).setVariable(Prefix + "sdncResponseSuccess", false)
+ println " Graceful Exit! - " + ex.getMessage()
+ throw ex
+ }
+ }
+
+ @Test
+ public void prepareRollbackData() {
+
+ println "************ prepareRollbackData() ************* "
+
+ WorkflowException workflowException = new WorkflowException("DoUpdateNetworkInstance", 2500, "Received error from Network Adapter: JBWEB000065: HTTP Status 500.")
+
+ ExecutionEntity mockExecution = mock(ExecutionEntity.class)
+ // Initialize prerequisite variables
+ when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
+ when(mockExecution.getVariable(Prefix + "rollbackSDNCRequest")).thenReturn(rollbackSDNCRequest)
+ when(mockExecution.getVariable(Prefix + "rollbackNetworkRequest")).thenReturn(rollbackNetworkRequest)
+ when(mockExecution.getVariable("WorkflowException")).thenReturn(workflowException)
+
+ DoUpdateNetworkInstance DoUpdateNetworkInstance = new DoUpdateNetworkInstance()
+ DoUpdateNetworkInstance.prepareRollbackData(mockExecution)
+
+ verify(mockExecution).setVariable("prefix", Prefix)
+ }
@Test
//@Ignore
@@ -2735,6 +1614,37 @@ String rollbackNetworkRequest =
}
+ private static L3Network getContrailL3Network() {
+
+ HostRoutes routes1 = new HostRoutes()
+ routes1.getHostRoute().add(new HostRoute(routePrefix: "172.20.1.0/24", nextHop: "10.102.200.1"))
+ routes1.getHostRoute().add(new HostRoute(routePrefix: "10.102.0.0/16", nextHop: "10.102.200.1"))
+ routes1.getHostRoute().add(new HostRoute(routePrefix: "192.168.2.0/25", nextHop: "10.102.200.1"))
+
+ Subnet subnet1 = new Subnet(networkStartAddress: "107.239.52.0", cidrMask: "24", dhcpEnabled: true,
+ gatewayAddress: "107.239.52.1", ipVersion: "4", subnetId: "57e9a1ff-d14f-4071-a828-b19ae98eb2fc",
+ subnetName: "subnetName", ipAssignmentDirection: "true", hostRoutes: routes1)
+ Subnets subnets = new Subnets()
+ subnets.getSubnet().add(subnet1)
+
+ SegmentationAssignments segments = new SegmentationAssignments()
+ segments.getSegmentationAssignment().add(new SegmentationAssignment(segmentationId: "414"))
+ segments.getSegmentationAssignment().add(new SegmentationAssignment(segmentationId: "415"))
+
+ return new L3Network(
+ networkName: "MNS-25180-L-01-dmz_direct_net_1",
+ networkType: "CONTRAIL_EXTERNAL",
+ networkTechnology: "Contrail",
+ networkId: "49c86598-f766-46f8-84f8-8d1c1b10f9b4",
+ orchestrationStatus: "pending-create",
+ physicalNetworkName: "networkName",
+ heatStackId: "ST_2Bindings_6006/55288ef0-595c-47d3-819e-cf93aaac6326",
+ isSharedNetwork: true,
+ subnets: subnets,
+ segmentationAssignments: segments
+ )
+ }
+
private ExecutionEntity setupMock() {
ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class)
@@ -2742,16 +1652,13 @@ String rollbackNetworkRequest =
RepositoryService mockRepositoryService = mock(RepositoryService.class)
when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition)
when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("DoUpdateNetworkInstance")
- when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100")
ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class)
when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService)
ExecutionEntity mockExecution = mock(ExecutionEntity.class)
// Initialize prerequisite variables
- when(mockExecution.getId()).thenReturn("100")
when(mockExecution.getProcessDefinitionId()).thenReturn("DoUpdateNetworkInstance")
- when(mockExecution.getProcessInstanceId()).thenReturn("DoUpdateNetworkInstance")
when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices)
when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModuleTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModuleTest.groovy
index d635b2311a..f16bc575a4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModuleTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModuleTest.groovy
@@ -57,9 +57,6 @@ class DoUpdateVfModuleTest extends MsoGroovyTest{
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
@Spy
DoUpdateVfModule doUpdateVfModule
@@ -182,6 +179,7 @@ class DoUpdateVfModuleTest extends MsoGroovyTest{
ExecutionEntity mockExecution = setupMock()
when(mockExecution.getVariable("prefix")).thenReturn(prefix)
when(mockExecution.getVariable(prefix + "aicCloudRegion")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(prefix + "cloudRegion")).thenReturn("CloudOwner")
when(mockExecution.getVariable(prefix + "vfModuleId")).thenReturn("cb510af0-5b21-4bc7-86d9-323cb396ce32")
when(mockExecution.getVariable(prefix + "volumeGroupStackId")).thenReturn("12345")
when(mockExecution.getVariable(prefix + "vfModuleName")).thenReturn("PCRF::module-0-2")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModulesTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModulesTest.groovy
index a86029ea30..8e81e91228 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModulesTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModulesTest.groovy
@@ -47,9 +47,6 @@ class DoUpdateVnfAndModulesTest {
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
-
@Before
public void init() {
MockitoAnnotations.initMocks(this)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1Test.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1Test.groovy
index 06ae576307..80e2c863e8 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1Test.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1Test.groovy
@@ -4,7 +4,9 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -32,7 +34,7 @@ import org.junit.runner.RunWith
import org.mockito.ArgumentCaptor
import org.mockito.Captor
import org.mockito.MockitoAnnotations
-import org.mockito.runners.MockitoJUnitRunner
+import org.mockito.junit.MockitoJUnitRunner
import org.onap.aai.domain.yang.GenericVnf
import org.onap.aai.domain.yang.VfModule
import org.onap.aai.domain.yang.VolumeGroup
@@ -48,23 +50,23 @@ import javax.ws.rs.core.UriBuilder
import static org.mockito.Mockito.*
-@RunWith(MockitoJUnitRunner.class)
+@RunWith(MockitoJUnitRunner.Silent.class)
class UpdateVfModuleVolumeInfraV1Test extends MsoGroovyTest{
-
+
def prefix = "UPDVfModVol_"
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
@Rule
public ExpectedException thrown = ExpectedException.none()
-
- @Before
- public void init(){
+
+ @Before
+ public void init() {
super.init("UpdateVfModuleVolumeInfraV1")
- MockitoAnnotations.initMocks(this)
+ MockitoAnnotations.initMocks(this)
}
-
+
@Test
void testQueryAAIForVfModule() {
ExecutionEntity mockExecution = setupMock()
@@ -143,6 +145,7 @@ class UpdateVfModuleVolumeInfraV1Test extends MsoGroovyTest{
when(mockExecution.getVariable("prefix")).thenReturn(prefix)
when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
when(mockExecution.getVariable(prefix + "aicCloudRegion")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(prefix + "cloudOwner")).thenReturn("CloudOwner")
when(mockExecution.getVariable(prefix + "tenantId")).thenReturn("")
VolumeGroup volumeGroup = new VolumeGroup();
volumeGroup.setHeatStackId("heatStackId")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy
index 41a862e00e..5c3521f5ba 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy
@@ -238,8 +238,8 @@ class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initUpdateAaiAROrchStatus(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
- MockPatchAllottedResource(CUST, SVC, INST, ARID)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
+ MockPatchAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
DoCreateAllottedResourceBRGRollback.updateAaiAROrchStatus(mex, "success")
@@ -265,8 +265,8 @@ class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initUpdateAaiAROrchStatus(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
- MockPatchAllottedResource(CUST, SVC, INST, ARID)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
+ MockPatchAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
when(mex.getVariable("aaiARPath")).thenReturn(null)
@@ -354,8 +354,8 @@ class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex)
@@ -366,8 +366,8 @@ class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenReturn("")
@@ -381,8 +381,8 @@ class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenThrow(new BpmnError("expected exception"))
@@ -396,8 +396,8 @@ class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenThrow(new RuntimeException("expected exception"))
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy
index f094ef25fa..09244bedc4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy
@@ -94,7 +94,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
@Test
@Ignore
public void getAaiAR() {
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
ExecutionEntity mex = setupMock()
initGetAaiAR(mex)
@@ -107,7 +107,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
@Test
public void getAaiAR_Duplicate() {
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
ExecutionEntity mex = setupMock()
initGetAaiAR(mex)
@@ -122,7 +122,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
@Test
public void getAaiAR_NotActive() {
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
ExecutionEntity mex = setupMock()
initGetAaiAR(mex)
@@ -138,7 +138,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
@Test
@Ignore
public void getAaiAR_NoStatus() {
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
ExecutionEntity mex = setupMock()
initGetAaiAR(mex)
@@ -205,7 +205,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
when(mex.getVariable("PSI_resourceLink")).thenReturn(null)
- MockPutAllottedResource(CUST, SVC, INST, ARID)
+ MockPutAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
@@ -217,7 +217,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initCreateAaiAr(mex)
- MockPutAllottedResource_500(CUST, SVC, INST, ARID)
+ MockPutAllottedResource_500(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
@@ -231,7 +231,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
when(mex.getVariable("aai.endpoint")).thenThrow(new BpmnError("expected exception"))
- MockPutAllottedResource(CUST, SVC, INST, ARID)
+ MockPutAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
@@ -245,7 +245,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
when(mex.getVariable("aai.endpoint")).thenThrow(new RuntimeException("expected exception"))
- MockPutAllottedResource(CUST, SVC, INST, ARID)
+ MockPutAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
@@ -621,7 +621,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
@Test
@Ignore
public void updateAaiAROrchStatus() {
- MockPatchAllottedResource(CUST, SVC, INST, ARID)
+ MockPatchAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
ExecutionEntity mex = setupMock()
initUpdateAaiAROrchStatus(mex)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy
index a877ce42e7..e25f43f796 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy
@@ -238,8 +238,8 @@ class DoCreateAllottedResourceTXCRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initUpdateAaiAROrchStatus(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
- MockPatchAllottedResource(CUST, SVC, INST, ARID)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
+ MockPatchAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback()
DoCreateAllottedResourceTXCRollback.updateAaiAROrchStatus(mex, "success")
@@ -265,8 +265,8 @@ class DoCreateAllottedResourceTXCRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initUpdateAaiAROrchStatus(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
- MockPatchAllottedResource(CUST, SVC, INST, ARID)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
+ MockPatchAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
when(mex.getVariable("aaiARPath")).thenReturn(null)
@@ -354,8 +354,8 @@ class DoCreateAllottedResourceTXCRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback()
DoCreateAllottedResourceTXCRollback.deleteAaiAR(mex)
@@ -366,8 +366,8 @@ class DoCreateAllottedResourceTXCRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenReturn("")
@@ -381,8 +381,8 @@ class DoCreateAllottedResourceTXCRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenThrow(new BpmnError("expected exception"))
@@ -396,8 +396,8 @@ class DoCreateAllottedResourceTXCRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenThrow(new RuntimeException("expected exception"))
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy
index b53e5fce21..901bdaf7b3 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy
@@ -93,7 +93,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
@Test
@Ignore
public void getAaiAR() {
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
ExecutionEntity mex = setupMock()
initGetAaiAR(mex)
@@ -107,7 +107,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
@Test
public void getAaiAR_Duplicate() {
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
ExecutionEntity mex = setupMock()
initGetAaiAR(mex)
@@ -122,7 +122,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
@Test
public void getAaiAR_NotActive() {
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
ExecutionEntity mex = setupMock()
initGetAaiAR(mex)
@@ -138,7 +138,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
@Test
@Ignore
public void getAaiAR_NoStatus() {
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
ExecutionEntity mex = setupMock()
initGetAaiAR(mex)
@@ -177,7 +177,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
when(mex.getVariable("PSI_resourceLink")).thenReturn(null)
- MockPutAllottedResource(CUST, SVC, INST, ARID)
+ MockPutAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC()
@@ -189,7 +189,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initCreateAaiAr(mex)
- MockPutAllottedResource_500(CUST, SVC, INST, ARID)
+ MockPutAllottedResource_500(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC()
@@ -203,7 +203,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
when(mex.getVariable("aai.endpoint")).thenThrow(new BpmnError("expected exception"))
- MockPutAllottedResource(CUST, SVC, INST, ARID)
+ MockPutAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC()
@@ -217,7 +217,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
when(mex.getVariable("aai.endpoint")).thenThrow(new RuntimeException("expected exception"))
- MockPutAllottedResource(CUST, SVC, INST, ARID)
+ MockPutAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC()
@@ -559,7 +559,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
@Test
@Ignore
public void updateAaiAROrchStatus() {
- MockPatchAllottedResource(CUST, SVC, INST, ARID)
+ MockPatchAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
ExecutionEntity mex = setupMock()
initUpdateAaiAROrchStatus(mex)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy
index e77c1dd9ed..ab9be8217d 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy
@@ -132,7 +132,7 @@ class DoDeleteAllottedResourceBRGTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initUpdateAaiAROrchStatus(mex)
- MockPatchAllottedResource(CUST, SVC, INST, ARID)
+ MockPatchAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
DoDeleteAllottedResourceBRG.updateAaiAROrchStatus(mex, "success")
@@ -412,8 +412,8 @@ class DoDeleteAllottedResourceBRGTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
DoDeleteAllottedResourceBRG.deleteAaiAR(mex)
@@ -424,8 +424,8 @@ class DoDeleteAllottedResourceBRGTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenReturn("")
@@ -439,8 +439,8 @@ class DoDeleteAllottedResourceBRGTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenThrow(new BpmnError("expected exception"))
@@ -454,8 +454,8 @@ class DoDeleteAllottedResourceBRGTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenThrow(new RuntimeException("expected exception"))
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy
index 23115874a2..6a75c145ff 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy
@@ -132,7 +132,7 @@ class DoDeleteAllottedResourceTXCTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initUpdateAaiAROrchStatus(mex)
- MockPatchAllottedResource(CUST, SVC, INST, ARID)
+ MockPatchAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC()
DoDeleteAllottedResourceTXC.updateAaiAROrchStatus(mex, "success")
@@ -412,8 +412,8 @@ class DoDeleteAllottedResourceTXCTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC()
DoDeleteAllottedResourceTXC.deleteAaiAR(mex)
@@ -424,8 +424,8 @@ class DoDeleteAllottedResourceTXCTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenReturn("")
@@ -439,8 +439,8 @@ class DoDeleteAllottedResourceTXCTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenThrow(new BpmnError("expected exception"))
@@ -454,8 +454,8 @@ class DoDeleteAllottedResourceTXCTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenThrow(new RuntimeException("expected exception"))
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllBPMNTestSuites.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllBPMNTestSuites.java
index 0f77e41120..03d9b37522 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllBPMNTestSuites.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllBPMNTestSuites.java
@@ -19,14 +19,14 @@
*/
package org.onap.so.bpmn;
-import org.junit.runner.RunWith;
+import org.junit.runner.RunWith;
import com.googlecode.junittoolbox.SuiteClasses;
import com.googlecode.junittoolbox.WildcardPatternSuite;
@RunWith(WildcardPatternSuite.class)
@SuiteClasses({"**/service/*Test.class", "**/process/*Test.class", "**/subprocess/*Test.class"})
public class AllBPMNTestSuites {
- // the class remains empty,
- // used only as a holder for the above annotations
+ // the class remains empty,
+ // used only as a holder for the above annotations
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllTasksTestsTestSuite.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllTasksTestsTestSuite.java
index 57d842f8b5..7f86709432 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllTasksTestsTestSuite.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllTasksTestsTestSuite.java
@@ -19,14 +19,14 @@
*/
package org.onap.so.bpmn;
-import org.junit.runner.RunWith;
+import org.junit.runner.RunWith;
import com.googlecode.junittoolbox.SuiteClasses;
import com.googlecode.junittoolbox.WildcardPatternSuite;
@RunWith(WildcardPatternSuite.class)
-@SuiteClasses({"**/tasks/*Test.class","**/infrastructure/aai/*Test.class"})
+@SuiteClasses({"**/tasks/*Test.class", "**/infrastructure/aai/*Test.class"})
public class AllTasksTestsTestSuite {
- // the class remains empty,
- // used only as a holder for the above annotations
+ // the class remains empty,
+ // used only as a holder for the above annotations
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllTestsTestSuite.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllTestsTestSuite.java
index 01f37ad655..7123567247 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllTestsTestSuite.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllTestsTestSuite.java
@@ -23,15 +23,16 @@
package org.onap.so.bpmn;
import org.junit.runner.RunWith;
-
import com.googlecode.junittoolbox.SuiteClasses;
import com.googlecode.junittoolbox.WildcardPatternSuite;
@RunWith(WildcardPatternSuite.class)
-@SuiteClasses({"!**/service/*Test.class", "!**/subprocess/*Test.class", "!**/process/*Test.class",
- "!**/tasks/*Test.class", "!**/infrastructure/aai/*Test.class",
- "!**/infrastructure/scripts/*Test.class", "**/*Test.class"})
+@SuiteClasses({"!**/service/*Test.class", "!**/subprocess/*Test.class", "!**/process/*Test.class",
+ "!**/tasks/*Test.class", "!**/infrastructure/aai/*Test.class", "!**/infrastructure/scripts/*Test.class",
+ "**/infrastructure/scripts/DoDeleteVfModuleVolumeV2Test.class",
+ "**/infrastructure/scripts/DoUpdateNetworkInstanceTest.class",
+ "**/infrastructure/scripts/UpdateVfModuleVolumeInfraV1Test.class", "**/*Test.class"})
public class AllTestsTestSuite {
- // the class remains empty,
- // used only as a holder for the above annotations
+ // the class remains empty,
+ // used only as a holder for the above annotations
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/BeansTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/BeansTest.java
index f69521fd76..1c4074cae1 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/BeansTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/BeansTest.java
@@ -21,7 +21,6 @@
package org.onap.so.bpmn.infrastructure;
import org.junit.Test;
-
import com.openpojo.validation.Validator;
import com.openpojo.validation.ValidatorBuilder;
import com.openpojo.validation.rule.impl.GetterMustExistRule;
@@ -38,35 +37,31 @@ import com.openpojo.reflection.filters.FilterPackageInfo;
public class BeansTest {
- private PojoClassFilter filterTestClasses = new FilterTestClasses();
-
- private PojoClassFilter enumFilter = new FilterEnum();
-
+ private PojoClassFilter filterTestClasses = new FilterTestClasses();
+
+ private PojoClassFilter enumFilter = new FilterEnum();
+
+
+ @Test
+ public void pojoStructure() {
+ test("org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity");
+ }
+
+ private void test(String pojoPackage) {
+ Validator validator = ValidatorBuilder.create().with(new GetterMustExistRule()).with(new SetterMustExistRule())
+
+ .with(new SetterTester()).with(new GetterTester()).with(new SetterTester()).with(new GetterTester())
- @Test
- public void pojoStructure() {
- test("org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity");
- }
+ .build();
- private void test(String pojoPackage) {
- Validator validator = ValidatorBuilder.create()
- .with(new GetterMustExistRule())
- .with(new SetterMustExistRule())
-
- .with(new SetterTester())
- .with(new GetterTester())
- .with(new SetterTester())
- .with(new GetterTester())
-
- .build();
+ validator.validate(pojoPackage, new FilterPackageInfo(), filterTestClasses, enumFilter,
+ new FilterNonConcrete());
+ }
- validator.validate(pojoPackage, new FilterPackageInfo(), filterTestClasses,enumFilter,new FilterNonConcrete());
- }
-
- private static class FilterTestClasses implements PojoClassFilter {
- public boolean include(PojoClass pojoClass) {
- return !pojoClass.getSourcePath().contains("/test-classes/");
- }
- }
+ private static class FilterTestClasses implements PojoClassFilter {
+ public boolean include(PojoClass pojoClass) {
+ return !pojoClass.getSourcePath().contains("/test-classes/");
+ }
+ }
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/WebSecurityConfigImpl.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/WebSecurityConfigImpl.java
index ad9e210452..c2af155d51 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/WebSecurityConfigImpl.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/WebSecurityConfigImpl.java
@@ -31,22 +31,19 @@ import org.springframework.util.StringUtils;
@EnableWebSecurity
public class WebSecurityConfigImpl extends WebSecurityConfig {
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.csrf().disable()
- .authorizeRequests()
- .antMatchers("/manage/health","/manage/info").permitAll()
- .antMatchers("/async/services/**", "/workflow/services/*", "/SDNCAdapterCallbackService", "/WorkflowMessage", "/vnfAdapterNotify", "/vnfAdapterRestNotify")
- .hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(),",").toString())
- .and()
- .httpBasic();
- }
-
- @Override
- public void configure(WebSecurity web) throws Exception {
- super.configure(web);
- StrictHttpFirewall firewall = new MSOSpringFirewall();
- web.httpFirewall(firewall);
- }
+ @Override
+ protected void configure(HttpSecurity http) throws Exception {
+ http.csrf().disable().authorizeRequests().antMatchers("/manage/health", "/manage/info").permitAll()
+ .antMatchers("/async/services/**", "/workflow/services/*", "/SDNCAdapterCallbackService",
+ "/WorkflowMessage", "/vnfAdapterNotify", "/vnfAdapterRestNotify")
+ .hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(), ",").toString()).and().httpBasic();
+ }
+
+ @Override
+ public void configure(WebSecurity web) throws Exception {
+ super.configure(web);
+ StrictHttpFirewall firewall = new MSOSpringFirewall();
+ web.httpFirewall(firewall);
+ }
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResourcesTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResourcesTest.java
index 2e588b7078..289d97108f 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResourcesTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResourcesTest.java
@@ -28,10 +28,8 @@ import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-
import java.util.HashMap;
import java.util.Optional;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -48,150 +46,157 @@ import org.onap.so.client.aai.entities.uri.AAIUriFactory;
@RunWith(MockitoJUnitRunner.class)
public class AAICreateResourcesTest {
-
- private AAICreateResources aaiCreateResources;
-
- private String projectName;
- private String serviceInstanceId;
- private String owningEntityId;
- private String owningEntityName;
- private String platformName;
- private String vnfId;
- private String lineOfBusiness;
- private String globalCustomerId;
- private String serviceType;
-
- @Spy
- private AAIResourcesClient aaiResourcesClient;
-
- @Before
- public void before() {
-
-
- aaiCreateResources = new AAICreateResources();
- aaiCreateResources.setAaiClient(aaiResourcesClient);
-
- projectName = "projectName";
- serviceInstanceId = "serviceInstanceId";
- owningEntityId = "owningEntityId";
- owningEntityName = "owningEntityName";
- platformName = "platformName";
- vnfId = "vnfId";
- lineOfBusiness = "lineOfBusiness";
- globalCustomerId = "globalCustomerId";
- serviceType = "serviceType";
- }
-
- @Test
- public void createAAIProjectTest() {
- doReturn(aaiResourcesClient).when(aaiResourcesClient).createIfNotExists(isA(AAIResourceUri.class), isA(Optional.class));
- doNothing().when(aaiResourcesClient).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
-
-
- aaiCreateResources.createAAIProject(projectName, serviceInstanceId);
-
- AAIResourceUri projectURI = AAIUriFactory.createResourceUri(AAIObjectType.PROJECT, projectName);
-
- verify(aaiResourcesClient, times(1)).createIfNotExists(projectURI, Optional.empty());
- verify(aaiResourcesClient, times(1)).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
- }
-
- @Test
- public void createAAIOwningEntityTest() {
- doReturn(aaiResourcesClient).when(aaiResourcesClient).createIfNotExists(isA(AAIResourceUri.class), isA(Optional.class));
- doNothing().when(aaiResourcesClient).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
-
- aaiCreateResources.createAAIOwningEntity(owningEntityId, owningEntityName, serviceInstanceId);
-
- HashMap<String, String> owningEntityMap = new HashMap<>();
- owningEntityMap.put("owning-entity-name", owningEntityName);
- AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
-
- verify(aaiResourcesClient, times(1)).createIfNotExists(owningEntityURI, Optional.of(owningEntityMap));
- verify(aaiResourcesClient, times(1)).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
- }
-
- @Test
- public void existsOwningEntityTest() {
- doReturn(true).when(aaiResourcesClient).exists(isA(AAIResourceUri.class));
-
- boolean expectedBoolean = aaiCreateResources.existsOwningEntity(owningEntityId);
-
- AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
-
- verify(aaiResourcesClient, times(1)).exists(owningEntityURI);
- assertTrue(expectedBoolean);
- }
-
- @Test
- public void connectOwningEntityandServiceInstanceTest() {
- doNothing().when(aaiResourcesClient).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
-
- aaiCreateResources.connectOwningEntityandServiceInstance(owningEntityId, serviceInstanceId);
-
- verify(aaiResourcesClient, times(1)).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
- }
-
- @Test
- public void createAAIPlatformTest() {
- doReturn(aaiResourcesClient).when(aaiResourcesClient).createIfNotExists(isA(AAIResourceUri.class), isA(Optional.class));
- doNothing().when(aaiResourcesClient).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
-
- aaiCreateResources.createAAIPlatform(platformName, vnfId);
-
- AAIResourceUri platformURI = AAIUriFactory.createResourceUri(AAIObjectType.PLATFORM, platformName);
-
- verify(aaiResourcesClient, times(1)).createIfNotExists(platformURI, Optional.empty());
- verify(aaiResourcesClient, times(1)).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
- }
-
- @Test
- public void createAAILineOfBusinessTest() {
- doReturn(aaiResourcesClient).when(aaiResourcesClient).createIfNotExists(isA(AAIResourceUri.class), isA(Optional.class));
- doNothing().when(aaiResourcesClient).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
-
- aaiCreateResources.createAAILineOfBusiness(lineOfBusiness, vnfId);
-
- AAIResourceUri lineOfBusinessURI = AAIUriFactory.createResourceUri(AAIObjectType.LINE_OF_BUSINESS, lineOfBusiness);
-
- verify(aaiResourcesClient, times(1)).createIfNotExists(lineOfBusinessURI, Optional.empty());
- verify(aaiResourcesClient, times(1)).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
- }
-
- @Test
- public void createAAIServiceInstanceTest() {
- doReturn(aaiResourcesClient).when(aaiResourcesClient).createIfNotExists(isA(AAIResourceUri.class), isA(Optional.class));
-
- aaiCreateResources.createAAIServiceInstance(globalCustomerId, serviceType, serviceInstanceId);
-
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustomerId,serviceType,serviceInstanceId);
-
- verify(aaiResourcesClient, times(1)).createIfNotExists(serviceInstanceURI, Optional.empty());
- }
-
- @Test
- public void getVnfInstanceTest() {
- AAIResultWrapper aaiResultWrapper = new AAIResultWrapper("vnfUriAaiResponse");
-
- doReturn(aaiResultWrapper).when(aaiResourcesClient).get(isA(AAIResourceUri.class));
-
- Optional<GenericVnf> actualVnf = aaiCreateResources.getVnfInstance(vnfId);
-
- AAIResourceUri vnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
-
- verify(aaiResourcesClient, times(1)).get(vnfURI);
- assertEquals(actualVnf, aaiResultWrapper.asBean(GenericVnf.class));
- }
-
- @Test
- public void getVnfInstanceExceptionTest() {
- doThrow(RuntimeException.class).when(aaiResourcesClient).get(isA(AAIResourceUri.class));
-
- Optional<GenericVnf> actualVnf = aaiCreateResources.getVnfInstance(vnfId);
-
- AAIResourceUri vnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
-
- verify(aaiResourcesClient, times(1)).get(vnfURI);
- assertEquals(actualVnf, Optional.empty());
- }
+
+ private AAICreateResources aaiCreateResources;
+
+ private String projectName;
+ private String serviceInstanceId;
+ private String owningEntityId;
+ private String owningEntityName;
+ private String platformName;
+ private String vnfId;
+ private String lineOfBusiness;
+ private String globalCustomerId;
+ private String serviceType;
+
+ @Spy
+ private AAIResourcesClient aaiResourcesClient;
+
+ @Before
+ public void before() {
+
+
+ aaiCreateResources = new AAICreateResources();
+ aaiCreateResources.setAaiClient(aaiResourcesClient);
+
+ projectName = "projectName";
+ serviceInstanceId = "serviceInstanceId";
+ owningEntityId = "owningEntityId";
+ owningEntityName = "owningEntityName";
+ platformName = "platformName";
+ vnfId = "vnfId";
+ lineOfBusiness = "lineOfBusiness";
+ globalCustomerId = "globalCustomerId";
+ serviceType = "serviceType";
+ }
+
+ @Test
+ public void createAAIProjectTest() {
+ doReturn(aaiResourcesClient).when(aaiResourcesClient).createIfNotExists(isA(AAIResourceUri.class),
+ isA(Optional.class));
+ doNothing().when(aaiResourcesClient).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
+
+
+ aaiCreateResources.createAAIProject(projectName, serviceInstanceId);
+
+ AAIResourceUri projectURI = AAIUriFactory.createResourceUri(AAIObjectType.PROJECT, projectName);
+
+ verify(aaiResourcesClient, times(1)).createIfNotExists(projectURI, Optional.empty());
+ verify(aaiResourcesClient, times(1)).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
+ }
+
+ @Test
+ public void createAAIOwningEntityTest() {
+ doReturn(aaiResourcesClient).when(aaiResourcesClient).createIfNotExists(isA(AAIResourceUri.class),
+ isA(Optional.class));
+ doNothing().when(aaiResourcesClient).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
+
+ aaiCreateResources.createAAIOwningEntity(owningEntityId, owningEntityName, serviceInstanceId);
+
+ HashMap<String, String> owningEntityMap = new HashMap<>();
+ owningEntityMap.put("owning-entity-name", owningEntityName);
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+
+ verify(aaiResourcesClient, times(1)).createIfNotExists(owningEntityURI, Optional.of(owningEntityMap));
+ verify(aaiResourcesClient, times(1)).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
+ }
+
+ @Test
+ public void existsOwningEntityTest() {
+ doReturn(true).when(aaiResourcesClient).exists(isA(AAIResourceUri.class));
+
+ boolean expectedBoolean = aaiCreateResources.existsOwningEntity(owningEntityId);
+
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+
+ verify(aaiResourcesClient, times(1)).exists(owningEntityURI);
+ assertTrue(expectedBoolean);
+ }
+
+ @Test
+ public void connectOwningEntityandServiceInstanceTest() {
+ doNothing().when(aaiResourcesClient).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
+
+ aaiCreateResources.connectOwningEntityandServiceInstance(owningEntityId, serviceInstanceId);
+
+ verify(aaiResourcesClient, times(1)).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
+ }
+
+ @Test
+ public void createAAIPlatformTest() {
+ doReturn(aaiResourcesClient).when(aaiResourcesClient).createIfNotExists(isA(AAIResourceUri.class),
+ isA(Optional.class));
+ doNothing().when(aaiResourcesClient).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
+
+ aaiCreateResources.createAAIPlatform(platformName, vnfId);
+
+ AAIResourceUri platformURI = AAIUriFactory.createResourceUri(AAIObjectType.PLATFORM, platformName);
+
+ verify(aaiResourcesClient, times(1)).createIfNotExists(platformURI, Optional.empty());
+ verify(aaiResourcesClient, times(1)).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
+ }
+
+ @Test
+ public void createAAILineOfBusinessTest() {
+ doReturn(aaiResourcesClient).when(aaiResourcesClient).createIfNotExists(isA(AAIResourceUri.class),
+ isA(Optional.class));
+ doNothing().when(aaiResourcesClient).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
+
+ aaiCreateResources.createAAILineOfBusiness(lineOfBusiness, vnfId);
+
+ AAIResourceUri lineOfBusinessURI =
+ AAIUriFactory.createResourceUri(AAIObjectType.LINE_OF_BUSINESS, lineOfBusiness);
+
+ verify(aaiResourcesClient, times(1)).createIfNotExists(lineOfBusinessURI, Optional.empty());
+ verify(aaiResourcesClient, times(1)).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
+ }
+
+ @Test
+ public void createAAIServiceInstanceTest() {
+ doReturn(aaiResourcesClient).when(aaiResourcesClient).createIfNotExists(isA(AAIResourceUri.class),
+ isA(Optional.class));
+
+ aaiCreateResources.createAAIServiceInstance(globalCustomerId, serviceType, serviceInstanceId);
+
+ AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
+ globalCustomerId, serviceType, serviceInstanceId);
+
+ verify(aaiResourcesClient, times(1)).createIfNotExists(serviceInstanceURI, Optional.empty());
+ }
+
+ @Test
+ public void getVnfInstanceTest() {
+ AAIResultWrapper aaiResultWrapper = new AAIResultWrapper("vnfUriAaiResponse");
+
+ doReturn(aaiResultWrapper).when(aaiResourcesClient).get(isA(AAIResourceUri.class));
+
+ Optional<GenericVnf> actualVnf = aaiCreateResources.getVnfInstance(vnfId);
+
+ AAIResourceUri vnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
+
+ verify(aaiResourcesClient, times(1)).get(vnfURI);
+ assertEquals(actualVnf, aaiResultWrapper.asBean(GenericVnf.class));
+ }
+
+ @Test
+ public void getVnfInstanceExceptionTest() {
+ doThrow(RuntimeException.class).when(aaiResourcesClient).get(isA(AAIResourceUri.class));
+
+ Optional<GenericVnf> actualVnf = aaiCreateResources.getVnfInstance(vnfId);
+
+ AAIResourceUri vnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
+
+ verify(aaiResourcesClient, times(1)).get(vnfURI);
+ assertEquals(actualVnf, Optional.empty());
+ }
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstanceTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstanceTest.java
index a540a6d2cc..1aca331a17 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstanceTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstanceTest.java
@@ -26,7 +26,6 @@ import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.junit.Before;
@@ -38,47 +37,47 @@ import org.mockito.MockitoAnnotations;
import org.onap.so.client.aai.AAIResourcesClient;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
-public class AAIDeleteServiceInstanceTest {
- private AAIDeleteServiceInstance aaiDeleteServiceInstance;
- @Mock
- private DelegateExecution execution;
-
- @Mock
- private AAIResourcesClient aaiResourcesClient;
-
- @Rule
- public ExpectedException expectedException = ExpectedException.none();
-
-
- @Before
- public void before() {
- MockitoAnnotations.initMocks(this);
-
- aaiDeleteServiceInstance = new AAIDeleteServiceInstance();
- aaiDeleteServiceInstance.setAaiClient(aaiResourcesClient);
- }
-
- @Test
- public void executeTest() throws Exception {
- doReturn("serviceInstanceId").when(execution).getVariable("serviceInstanceId");
- doNothing().when(aaiResourcesClient).delete(isA(AAIResourceUri.class));
- doNothing().when(execution).setVariable(isA(String.class), isA(Boolean.class));
-
- aaiDeleteServiceInstance.execute(execution);
-
- verify(execution, times(1)).getVariable("serviceInstanceId");
- verify(aaiResourcesClient, times(1)).delete(isA(AAIResourceUri.class));
- verify(execution, times(1)).setVariable("GENDS_SuccessIndicator", true);
- }
-
- @Test
- public void executeExceptionTest() throws Exception {
- expectedException.expect(BpmnError.class);
-
- doReturn("testProcessKey").when(execution).getVariable("testProcessKey");
- doReturn("serviceInstanceId").when(execution).getVariable("serviceInstanceId");
- doThrow(RuntimeException.class).when(aaiResourcesClient).delete(isA(AAIResourceUri.class));
-
- aaiDeleteServiceInstance.execute(execution);
- }
+public class AAIDeleteServiceInstanceTest {
+ private AAIDeleteServiceInstance aaiDeleteServiceInstance;
+ @Mock
+ private DelegateExecution execution;
+
+ @Mock
+ private AAIResourcesClient aaiResourcesClient;
+
+ @Rule
+ public ExpectedException expectedException = ExpectedException.none();
+
+
+ @Before
+ public void before() {
+ MockitoAnnotations.initMocks(this);
+
+ aaiDeleteServiceInstance = new AAIDeleteServiceInstance();
+ aaiDeleteServiceInstance.setAaiClient(aaiResourcesClient);
+ }
+
+ @Test
+ public void executeTest() throws Exception {
+ doReturn("serviceInstanceId").when(execution).getVariable("serviceInstanceId");
+ doNothing().when(aaiResourcesClient).delete(isA(AAIResourceUri.class));
+ doNothing().when(execution).setVariable(isA(String.class), isA(Boolean.class));
+
+ aaiDeleteServiceInstance.execute(execution);
+
+ verify(execution, times(1)).getVariable("serviceInstanceId");
+ verify(aaiResourcesClient, times(1)).delete(isA(AAIResourceUri.class));
+ verify(execution, times(1)).setVariable("GENDS_SuccessIndicator", true);
+ }
+
+ @Test
+ public void executeExceptionTest() throws Exception {
+ expectedException.expect(BpmnError.class);
+
+ doReturn("testProcessKey").when(execution).getVariable("testProcessKey");
+ doReturn("serviceInstanceId").when(execution).getVariable("serviceInstanceId");
+ doThrow(RuntimeException.class).when(aaiResourcesClient).delete(isA(AAIResourceUri.class));
+
+ aaiDeleteServiceInstance.execute(execution);
+ }
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstanceTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstanceTest.java
index e17d3f8fb5..90576c9566 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstanceTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstanceTest.java
@@ -26,7 +26,11 @@ import org.junit.Test;
public class AAIServiceInstanceTest {
- AAIServiceInstance test = new AAIServiceInstance("serviceInstanceName","serviceType","serviceRole","orchestrationStatus","modelInvariantUuid","modelVersionId","environmentContext","workloadContext");
+ AAIServiceInstance test = new AAIServiceInstance.AAIServiceInstanceBuilder()
+ .setServiceInstanceName("serviceInstanceName").setServiceType("serviceType").setServiceRole("serviceRole")
+ .setOrchestrationStatus("orchestrationStatus").setModelInvariantUuid("modelInvariantUuid")
+ .setModelVersionId("modelVersionId").setEnvironmentContext("environmentContext")
+ .setWorkloadContext("workloadContext").createAAIServiceInstance();
@Test
public void getServiceInstanceNameTest() throws Exception {
@@ -48,7 +52,6 @@ public class AAIServiceInstanceTest {
test.setServiceType("serviceType");
}
-
@Test
public void getServiceRoleTest() throws Exception {
test.getServiceRole();
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGeneratorTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGeneratorTest.java
index ebcce191e9..9030fa8328 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGeneratorTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGeneratorTest.java
@@ -22,7 +22,6 @@ package org.onap.so.bpmn.infrastructure.common.name.generation;
import static org.junit.Assert.assertEquals;
-
import org.junit.Before;
import org.junit.Test;
import org.mockito.MockitoAnnotations;
@@ -34,25 +33,25 @@ import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoInstanceGroup;
public class AAIObjectInstanceNameGeneratorTest {
- @Before
- public void before() {
- }
-
- @Test
- public void generateInstanceGroupNameTest() throws Exception {
-
- ModelInfoInstanceGroup modelVnfc = new ModelInfoInstanceGroup();
- modelVnfc.setFunction("vre");
- modelVnfc.setType("VNFC");
-
- InstanceGroup instanceGroup = new InstanceGroup();
- instanceGroup.setId("test-001");
- instanceGroup.setModelInfoInstanceGroup(modelVnfc);
- GenericVnf vnf = new GenericVnf();
- vnf.setVnfId("vnf-123");
- vnf.setVnfName("test-vnf");
-
- assertEquals("test-vnf_vre", new AAIObjectInstanceNameGenerator().generateInstanceGroupName(instanceGroup, vnf));
- }
-
+ @Before
+ public void before() {}
+
+ @Test
+ public void generateInstanceGroupNameTest() throws Exception {
+
+ ModelInfoInstanceGroup modelVnfc = new ModelInfoInstanceGroup();
+ modelVnfc.setFunction("vre");
+ modelVnfc.setType("VNFC");
+
+ InstanceGroup instanceGroup = new InstanceGroup();
+ instanceGroup.setId("test-001");
+ instanceGroup.setModelInfoInstanceGroup(modelVnfc);
+ GenericVnf vnf = new GenericVnf();
+ vnf.setVnfId("vnf-123");
+ vnf.setVnfName("test-vnf");
+
+ assertEquals("test-vnf_vre",
+ new AAIObjectInstanceNameGenerator().generateInstanceGroupName(instanceGroup, vnf));
+ }
+
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscriptionTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscriptionTest.java
index b0ff82e3aa..c67b44e44a 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscriptionTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscriptionTest.java
@@ -22,7 +22,6 @@ package org.onap.so.bpmn.infrastructure.pnf.delegate;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.junit.Test;
-
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
@@ -37,7 +36,8 @@ public class CancelDmaapSubscriptionTest {
DmaapClientTestImpl dmaapClientTest = new DmaapClientTestImpl();
delegate.setDmaapClient(dmaapClientTest);
DelegateExecution delegateExecution = mock(DelegateExecution.class);
- when(delegateExecution.getVariable(eq(ExecutionVariableNames.PNF_CORRELATION_ID))).thenReturn("testPnfCorrelationId");
+ when(delegateExecution.getVariable(eq(ExecutionVariableNames.PNF_CORRELATION_ID)))
+ .thenReturn("testPnfCorrelationId");
when(delegateExecution.getProcessBusinessKey()).thenReturn("testBusinessKey");
dmaapClientTest.registerForUpdate("testPnfCorrelationId", () -> {
});
@@ -46,4 +46,4 @@ public class CancelDmaapSubscriptionTest {
// then
assertThat(dmaapClientTest.haveRegisteredConsumer()).isFalse();
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegateTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegateTest.java
index 6a0aaf776e..4206d796f6 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegateTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForPnfCorrelationIdDelegateTest.java
@@ -29,7 +29,6 @@ import static org.onap.so.bpmn.infrastructure.pnf.delegate.PnfManagementTestImpl
import static org.onap.so.bpmn.infrastructure.pnf.delegate.PnfManagementTestImpl.ID_WITH_ENTRY;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.AAI_CONTAINS_INFO_ABOUT_PNF;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
-
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.junit.Before;
@@ -46,9 +45,9 @@ public class CheckAaiForPnfCorrelationIdDelegateTest {
public static class ConnectionOkTests {
private CheckAaiForPnfCorrelationIdDelegate delegate;
-
+
@Rule
- public ExpectedException expectedException = ExpectedException.none();
+ public ExpectedException expectedException = ExpectedException.none();
@Before
public void setUp() {
@@ -94,9 +93,9 @@ public class CheckAaiForPnfCorrelationIdDelegateTest {
public static class NoConnectionTests {
private CheckAaiForPnfCorrelationIdDelegate delegate;
-
+
@Rule
- public ExpectedException expectedException = ExpectedException.none();
+ public ExpectedException expectedException = ExpectedException.none();
@Before
public void setUp() {
@@ -116,4 +115,4 @@ public class CheckAaiForPnfCorrelationIdDelegateTest {
verify(execution).setVariable(eq("WorkflowException"), any(WorkflowException.class));
}
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegateTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegateTest.java
new file mode 100644
index 0000000000..5000ca017c
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ConfigCheckerDelegateTest.java
@@ -0,0 +1,139 @@
+/*
+ * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix
+ * Foundation. ================================================================================ Licensed under the
+ * Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may
+ * obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific language governing permissions and limitations under the
+ * License.
+ *
+ * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.pnf.delegate;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.fail;
+import static org.mockito.BDDMockito.given;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.MODEL_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_BLUEPRINT_NAME;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_BLUEPRINT_VERSION;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_CUSTOMIZATION_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_INSTANCE_NAME;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_MODEL_INFO;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SKIP_POST_INSTANTIATION_CONFIGURATION;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.camunda.bpm.engine.ProcessEngineConfiguration;
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.so.bpmn.core.WorkflowException;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.db.catalog.beans.PnfResourceCustomization;
+import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(classes = {CatalogDbClient.class, ExceptionBuilder.class, ConfigCheckerDelegate.class,
+ ProcessEngineConfiguration.class})
+public class ConfigCheckerDelegateTest {
+
+ private static String TEST_PROCESS_KEY = "processKey1";
+ private static String TEST_PNF_RESOURCE_INSTANCE_NAME = "PNF_demo_resource";
+ private static String TEST_PNF_RESOURCE_BLUEPRINT_NAME = "blueprintOnap";
+ private static String TEST_PNF_RESOURCE_BLUEPRINT_VERSION = "1.0.1";
+ private static String TEST_PNF_RESOURCE_CUSTOMIZATION_UUID = "9acb3a83-8a52-412c-9a45-901764938144";
+
+ /**
+ * Service model info json.
+ */
+ private static String TEST_SERVICE_MODEL_INFO = "{\n" + " \"modelType\":\"service\",\n"
+ + " \"modelInvariantUuid\":\"539b7a2f-9524-4dbf-9eee-f2e05521df3f\",\n"
+ + " \"modelInvariantId\":\"539b7a2f-9524-4dbf-9eee-f2e05521df3f\",\n"
+ + " \"modelUuid\":\"f2daaac6-5017-4e1e-96c8-6a27dfbe1421\",\n"
+ + " \"modelName\":\"PNF_demo_resource\",\n" + " \"modelVersion\":\"1.0\"\n" + " }";
+
+ /**
+ * Testing model UUID, should be the same as specified in the TEST_SERVICE_MODEL_INFO.
+ */
+ private static String TEST_MODEL_UUID = "f2daaac6-5017-4e1e-96c8-6a27dfbe1421";
+
+ @MockBean
+ private CatalogDbClient catalogDbClient;
+
+ @MockBean
+ private ProcessEngineConfiguration processEngineConfiguration;
+
+ @Autowired
+ private ConfigCheckerDelegate configCheckerDelegate;
+
+ private DelegateExecution execution = new DelegateExecutionFake();
+
+ @Before
+ public void setUp() {
+ List<PnfResourceCustomization> pnfResourceCustomizations = new ArrayList<>();
+ pnfResourceCustomizations.add(buildPnfResourceCustomization());
+ given(catalogDbClient.getPnfResourceCustomizationByModelUuid(TEST_MODEL_UUID))
+ .willReturn(pnfResourceCustomizations);
+ execution.setVariable("testProcessKey", TEST_PROCESS_KEY);
+ execution.setVariable(SERVICE_MODEL_INFO, TEST_SERVICE_MODEL_INFO);
+ }
+
+ private PnfResourceCustomization buildPnfResourceCustomization() {
+ PnfResourceCustomization pnfResourceCustomization = new PnfResourceCustomization();
+ pnfResourceCustomization.setSkipPostInstConf(true);
+ pnfResourceCustomization.setBlueprintName(TEST_PNF_RESOURCE_BLUEPRINT_NAME);
+ pnfResourceCustomization.setBlueprintVersion(TEST_PNF_RESOURCE_BLUEPRINT_VERSION);
+ pnfResourceCustomization.setModelInstanceName(TEST_PNF_RESOURCE_INSTANCE_NAME);
+ pnfResourceCustomization.setModelCustomizationUUID(TEST_PNF_RESOURCE_CUSTOMIZATION_UUID);
+ return pnfResourceCustomization;
+ }
+
+ @Test
+ public void testExecution_validCatalogdb_skipVariableSet() {
+ try {
+ configCheckerDelegate.execute(execution);
+ assertThat(execution.getVariable(MODEL_UUID)).isEqualTo(TEST_MODEL_UUID);
+ assertThat(execution.getVariable(SKIP_POST_INSTANTIATION_CONFIGURATION)).isEqualTo(Boolean.TRUE);
+ assertThat(execution.getVariable(PRC_BLUEPRINT_NAME)).isEqualTo(TEST_PNF_RESOURCE_BLUEPRINT_NAME);
+ assertThat(execution.getVariable(PRC_BLUEPRINT_VERSION)).isEqualTo(TEST_PNF_RESOURCE_BLUEPRINT_VERSION);
+ assertThat(execution.getVariable(PRC_CUSTOMIZATION_UUID)).isEqualTo(TEST_PNF_RESOURCE_CUSTOMIZATION_UUID);
+ assertThat(execution.getVariable(PRC_INSTANCE_NAME)).isEqualTo(TEST_PNF_RESOURCE_INSTANCE_NAME);
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("Exception thrown" + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testExecution_EmptyPnfResourceCustomization_exceptionThrown() {
+ given(catalogDbClient.getPnfResourceCustomizationByModelUuid("f2daaac6-5017-4e1e-96c8-6a27dfbe1421"))
+ .willReturn(Collections.EMPTY_LIST);
+
+ assertThatThrownBy(() -> configCheckerDelegate.execute(execution)).isInstanceOf(BpmnError.class);
+ assertThat(execution.getVariable("WorkflowExceptionErrorMessage")).asString()
+ .contains("Unable to find the PNF resource customizations of model service UUID")
+ .contains("f2daaac6-5017-4e1e-96c8-6a27dfbe1421");
+ assertThat(execution.getVariable("WorkflowException")).isInstanceOf(WorkflowException.class);
+ }
+
+ @Test
+ public void testExecution_NonExistingServiceModelInfo_exceptionThrown() {
+ execution.removeVariable("serviceModelInfo");
+ assertThatThrownBy(() -> configCheckerDelegate.execute(execution)).isInstanceOf(BpmnError.class);
+ assertThat(execution.getVariable("WorkflowExceptionErrorMessage")).asString()
+ .contains("Unable to find parameter serviceModelInfo");
+ assertThat(execution.getVariable("WorkflowException")).isInstanceOf(WorkflowException.class);
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegateTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegateTest.java
index 986edfeecf..c90235b103 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegateTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreatePnfEntryInAaiDelegateTest.java
@@ -27,7 +27,6 @@ import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
-
import java.util.UUID;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.junit.Test;
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelationTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelationTest.java
index c743ee7018..85a9a5c166 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelationTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelationTest.java
@@ -23,7 +23,6 @@ package org.onap.so.bpmn.infrastructure.pnf.delegate;
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
-
import java.io.IOException;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/GeneratePnfUuidDelegateTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/GeneratePnfUuidDelegateTest.java
index 8a1cdfa4c0..597d111e2c 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/GeneratePnfUuidDelegateTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/GeneratePnfUuidDelegateTest.java
@@ -22,7 +22,6 @@ package org.onap.so.bpmn.infrastructure.pnf.delegate;
import static org.assertj.core.api.Assertions.assertThat;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
-
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
import org.junit.Test;
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClientTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClientTest.java
index eb9f657d4f..96c3db0ccc 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClientTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClientTest.java
@@ -27,13 +27,14 @@ import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder;
import org.junit.Before;
import org.junit.Test;
import org.mockito.InOrder;
-
+import org.onap.so.bpmn.infrastructure.pnf.PnfNotificationEvent;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.*;
public class InformDmaapClientTest {
+
@Before
public void setUp() throws Exception {
informDmaapClient = new InformDmaapClient();
@@ -72,9 +73,23 @@ public class InformDmaapClientTest {
inOrder.verify(messageCorrelationBuilder).correlateWithResult();
}
+ @Test
+ public void onApplicationEvent_validPnfNotificationEvent_expectedOutput() {
+
+ PnfNotificationEvent pnfNotificationEvent = new PnfNotificationEvent(this, "testPnfCorrelationId");
+
+ informDmaapClient.execute(delegateExecution);
+ informDmaapClient.onApplicationEvent(pnfNotificationEvent);
+
+ InOrder inOrder = inOrder(messageCorrelationBuilder);
+ inOrder.verify(messageCorrelationBuilder).processInstanceBusinessKey("testBusinessKey");
+ inOrder.verify(messageCorrelationBuilder).correlateWithResult();
+ }
+
private DelegateExecution mockDelegateExecution() {
DelegateExecution delegateExecution = mock(DelegateExecution.class);
- when(delegateExecution.getVariable(eq(ExecutionVariableNames.PNF_CORRELATION_ID))).thenReturn("testPnfCorrelationId");
+ when(delegateExecution.getVariable(eq(ExecutionVariableNames.PNF_CORRELATION_ID)))
+ .thenReturn("testPnfCorrelationId");
when(delegateExecution.getProcessBusinessKey()).thenReturn("testBusinessKey");
ProcessEngineServices processEngineServices = mock(ProcessEngineServices.class);
when(delegateExecution.getProcessEngineServices()).thenReturn(processEngineServices);
@@ -85,4 +100,4 @@ public class InformDmaapClientTest {
when(messageCorrelationBuilder.processInstanceBusinessKey(any())).thenReturn(messageCorrelationBuilder);
return delegateExecution;
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java
index 001815b206..6c8716cbd7 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputsTest.java
@@ -24,7 +24,6 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_INSTANCE_ID;
-
import java.util.UUID;
import org.apache.commons.lang3.StringUtils;
import org.camunda.bpm.engine.delegate.BpmnError;
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementTestImpl.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementTestImpl.java
index 3a9d6d0055..8577d9555b 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementTestImpl.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfManagementTestImpl.java
@@ -22,7 +22,6 @@ package org.onap.so.bpmn.infrastructure.pnf.delegate;
import org.onap.aai.domain.yang.Pnf;
import org.onap.so.bpmn.infrastructure.pnf.management.PnfManagement;
-
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@@ -51,8 +50,7 @@ public class PnfManagementTestImpl implements PnfManagement {
}
@Override
- public void createRelation(String serviceInstanceId, String pnfName) {
- }
+ public void createRelation(String serviceInstanceId, String pnfName) {}
public Map<String, Pnf> getCreated() {
return created;
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigAssignDelegateTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigAssignDelegateTest.java
new file mode 100644
index 0000000000..110ee2146c
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigAssignDelegateTest.java
@@ -0,0 +1,130 @@
+/*
+ * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix
+ * Foundation. ================================================================================ Licensed under the
+ * Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may
+ * obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific language governing permissions and limitations under the
+ * License.
+ *
+ * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.pnf.delegate;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.fail;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.EXECUTION_OBJECT;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.MODEL_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.MSO_REQUEST_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_BLUEPRINT_NAME;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_BLUEPRINT_VERSION;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_CUSTOMIZATION_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_INSTANCE_NAME;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_INSTANCE_ID;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.so.bpmn.core.WorkflowException;
+import org.onap.so.client.cds.beans.AbstractCDSPropertiesBean;
+import org.onap.so.client.cds.beans.ConfigAssignPropertiesForPnf;
+import org.onap.so.client.cds.beans.ConfigAssignRequestPnf;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(classes = {ExceptionBuilder.class, PrepareConfigAssignDelegate.class})
+public class PrepareConfigAssignDelegateTest {
+
+ private static String TEST_MODEL_UUID = "6bc0b04d-1873-4721-b53d-6615225b2a28";
+ private static String TEST_SERVICE_INSTANCE_ID = "test_service_id";
+ private static String TEST_PROCESS_KEY = "processKey1";
+ private static String TEST_PNF_RESOURCE_INSTANCE_NAME = "PNF_demo_resource";
+ private static String TEST_PNF_CORRELATION_ID = "PNFDemo";
+ private static String TEST_PNF_RESOURCE_BLUEPRINT_NAME = "blueprintOnap";
+ private static String TEST_PNF_RESOURCE_BLUEPRINT_VERSION = "1.0.1";
+ private static String TEST_PNF_RESOURCE_CUSTOMIZATION_UUID = "9acb3a83-8a52-412c-9a45-901764938144";
+ private static String TEST_MSO_REQUEST_ID = "ff874603-4222-11e7-9252-005056850d2e";
+ private static String TEST_PNF_UUID = "5df8b6de-2083-11e7-93ae-92361f002671";
+
+ @Autowired
+ private PrepareConfigAssignDelegate prepareConfigAssignDelegate;
+
+ private DelegateExecution execution = new DelegateExecutionFake();
+
+ @Before
+ public void setUp() {
+ execution.setVariable("testProcessKey", TEST_PROCESS_KEY);
+ execution.setVariable(PNF_CORRELATION_ID, TEST_PNF_CORRELATION_ID);
+ execution.setVariable(MODEL_UUID, TEST_MODEL_UUID);
+ execution.setVariable(SERVICE_INSTANCE_ID, TEST_SERVICE_INSTANCE_ID);
+ execution.setVariable(MSO_REQUEST_ID, TEST_MSO_REQUEST_ID);
+ execution.setVariable(PNF_UUID, TEST_PNF_UUID);
+ execution.setVariable(PRC_INSTANCE_NAME, TEST_PNF_RESOURCE_INSTANCE_NAME);
+ execution.setVariable(PRC_CUSTOMIZATION_UUID, TEST_PNF_RESOURCE_CUSTOMIZATION_UUID);
+ execution.setVariable(PRC_BLUEPRINT_NAME, TEST_PNF_RESOURCE_BLUEPRINT_NAME);
+ execution.setVariable(PRC_BLUEPRINT_VERSION, TEST_PNF_RESOURCE_BLUEPRINT_VERSION);
+ }
+
+ @Test
+ public void testExecution_validPnf_executionObjectCreated() {
+ try {
+ prepareConfigAssignDelegate.execute(execution);
+ Object executionObject = execution.getVariable(EXECUTION_OBJECT);
+ assertThat(executionObject).isNotNull();
+ assertThat(executionObject).isInstanceOf(AbstractCDSPropertiesBean.class);
+ checkCDSPropertiesBean((AbstractCDSPropertiesBean) executionObject);
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("Exception thrown" + e.getMessage());
+ }
+ }
+
+ private void checkCDSPropertiesBean(AbstractCDSPropertiesBean executionObject) {
+ assertThat(executionObject.getBlueprintName()).matches(TEST_PNF_RESOURCE_BLUEPRINT_NAME);
+ assertThat(executionObject.getBlueprintVersion()).matches(TEST_PNF_RESOURCE_BLUEPRINT_VERSION);
+ assertThat(executionObject.getRequestId()).matches(TEST_MSO_REQUEST_ID);
+ assertThat(executionObject.getSubRequestId()).matches(TEST_PNF_UUID);
+ assertThat(executionObject.getMode()).matches("sync");
+ assertThat(executionObject.getActionName()).matches("config-assign");
+ assertThat(executionObject.getOriginatorId()).matches("SO");
+
+ assertThat(executionObject.getRequestObject()).isNotNull();
+ String requestObject = executionObject.getRequestObject();
+
+ checkRequestJson(requestObject);
+ }
+
+ private void checkRequestJson(String requestObject) {
+ try {
+ ObjectMapper mapper = new ObjectMapper();
+ JsonNode tree = mapper.readTree(requestObject);
+ ConfigAssignRequestPnf configAssignRequestPnf =
+ mapper.treeToValue(tree.at("/config-assign-request"), ConfigAssignRequestPnf.class);
+ assertThat(configAssignRequestPnf.getResolutionKey()).matches(TEST_PNF_CORRELATION_ID);
+
+ ConfigAssignPropertiesForPnf properties = configAssignRequestPnf.getConfigAssignPropertiesForPnf();
+ assertThat(properties.getServiceInstanceId()).matches(TEST_SERVICE_INSTANCE_ID);
+ assertThat(properties.getPnfName()).matches(TEST_PNF_CORRELATION_ID);
+ assertThat(properties.getPnfId()).matches(TEST_PNF_UUID);
+ assertThat(properties.getPnfCustomizationUuid()).matches(TEST_PNF_RESOURCE_CUSTOMIZATION_UUID);
+ assertThat(properties.getServiceModelUuid()).matches(TEST_MODEL_UUID);
+ } catch (IOException e) {
+ e.printStackTrace();
+ fail("Check request body is json message" + e.getMessage());
+ }
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigDeployDelegateTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigDeployDelegateTest.java
new file mode 100644
index 0000000000..8d19d9e563
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PrepareConfigDeployDelegateTest.java
@@ -0,0 +1,183 @@
+/*
+ * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix
+ * Foundation. ================================================================================ Licensed under the
+ * Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may
+ * obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific language governing permissions and limitations under the
+ * License.
+ *
+ * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.pnf.delegate;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.fail;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.EXECUTION_OBJECT;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.MODEL_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.MSO_REQUEST_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_CORRELATION_ID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_BLUEPRINT_NAME;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_BLUEPRINT_VERSION;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_CUSTOMIZATION_UUID;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_INSTANCE_NAME;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_INSTANCE_ID;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import java.util.Optional;
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.aai.domain.yang.Pnf;
+import org.onap.so.bpmn.core.WorkflowException;
+import org.onap.so.bpmn.infrastructure.pnf.management.PnfManagement;
+import org.onap.so.client.cds.beans.AbstractCDSPropertiesBean;
+import org.onap.so.client.cds.beans.ConfigDeployPropertiesForPnf;
+import org.onap.so.client.cds.beans.ConfigDeployRequestPnf;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(classes = {ExceptionBuilder.class, PrepareConfigDeployDelegate.class})
+public class PrepareConfigDeployDelegateTest {
+
+ private static String TEST_MODEL_UUID = "6bc0b04d-1873-4721-b53d-6615225b2a28";
+ private static String TEST_SERVICE_INSTANCE_ID = "test_service_id";
+ private static String TEST_PROCESS_KEY = "processKey1";
+ private static String TEST_PNF_RESOURCE_INSTANCE_NAME = "PNF_demo_resource";
+ private static String TEST_PNF_CORRELATION_ID = "PNFDemo";
+ private static String TEST_PNF_RESOURCE_BLUEPRINT_NAME = "blueprintOnap";
+ private static String TEST_PNF_RESOURCE_BLUEPRINT_VERSION = "1.0.1";
+ private static String TEST_PNF_RESOURCE_CUSTOMIZATION_UUID = "9acb3a83-8a52-412c-9a45-901764938144";
+ private static String TEST_MSO_REQUEST_ID = "ff874603-4222-11e7-9252-005056850d2e";
+ private static String TEST_PNF_UUID = "5df8b6de-2083-11e7-93ae-92361f002671";
+ private static String TEST_IPV4_ADDRESS = "1.1.1.1";
+ private static String TEST_IPV6_ADDRESS = "::1/128";
+
+ @Autowired
+ private PrepareConfigDeployDelegate prepareConfigDeployDelegate;
+
+ @MockBean
+ private PnfManagement pnfManagement;
+
+ private DelegateExecution execution = new DelegateExecutionFake();
+
+ @Before
+ public void setUp() throws IOException {
+ execution.setVariable("testProcessKey", TEST_PROCESS_KEY);
+ execution.setVariable(PNF_CORRELATION_ID, TEST_PNF_CORRELATION_ID);
+ execution.setVariable(MODEL_UUID, TEST_MODEL_UUID);
+ execution.setVariable(SERVICE_INSTANCE_ID, TEST_SERVICE_INSTANCE_ID);
+ execution.setVariable(MSO_REQUEST_ID, TEST_MSO_REQUEST_ID);
+ execution.setVariable(PNF_UUID, TEST_PNF_UUID);
+ execution.setVariable(PRC_INSTANCE_NAME, TEST_PNF_RESOURCE_INSTANCE_NAME);
+ execution.setVariable(PRC_CUSTOMIZATION_UUID, TEST_PNF_RESOURCE_CUSTOMIZATION_UUID);
+ execution.setVariable(PRC_BLUEPRINT_NAME, TEST_PNF_RESOURCE_BLUEPRINT_NAME);
+ execution.setVariable(PRC_BLUEPRINT_VERSION, TEST_PNF_RESOURCE_BLUEPRINT_VERSION);
+ mockAai();
+ }
+
+ private void mockAai() throws IOException {
+ Pnf pnf = new Pnf();
+ pnf.setIpaddressV4Oam(TEST_IPV4_ADDRESS);
+ pnf.setIpaddressV6Oam(TEST_IPV6_ADDRESS);
+ when(pnfManagement.getEntryFor(TEST_PNF_CORRELATION_ID)).thenReturn(Optional.of(pnf));
+ }
+
+ @Test
+ public void testExecution_validPnf_executionObjectCreated() {
+ try {
+ prepareConfigDeployDelegate.execute(execution);
+ Object executionObject = execution.getVariable(EXECUTION_OBJECT);
+ assertThat(executionObject).isNotNull();
+ assertThat(executionObject).isInstanceOf(AbstractCDSPropertiesBean.class);
+ checkCDSPropertiesBean((AbstractCDSPropertiesBean) executionObject);
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("Exception thrown" + e.getMessage());
+ }
+ }
+
+ @Test
+ public void testExecution_failedAaiConnection_exceptionThrown() {
+ try {
+ /**
+ * Mock the IOException from AAI.
+ */
+ when(pnfManagement.getEntryFor(TEST_PNF_CORRELATION_ID)).thenThrow(new IOException("Connection failed"));
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ assertThatThrownBy(() -> prepareConfigDeployDelegate.execute(execution)).isInstanceOf(BpmnError.class);
+ assertThat(execution.getVariable("WorkflowExceptionErrorMessage")).asString()
+ .contains("Unable to fetch from AAI");
+ assertThat(execution.getVariable("WorkflowException")).isInstanceOf(WorkflowException.class);
+ }
+
+ @Test
+ public void testExecution_aaiEntryNotExist_exceptionThrown() {
+ try {
+ /**
+ * Mock the AAI without PNF.
+ */
+ when(pnfManagement.getEntryFor(TEST_PNF_CORRELATION_ID)).thenReturn(Optional.empty());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ assertThatThrownBy(() -> prepareConfigDeployDelegate.execute(execution)).isInstanceOf(BpmnError.class);
+ assertThat(execution.getVariable("WorkflowExceptionErrorMessage")).asString()
+ .contains("AAI entry for PNF: " + TEST_PNF_CORRELATION_ID + " does not exist");
+ assertThat(execution.getVariable("WorkflowException")).isInstanceOf(WorkflowException.class);
+ }
+
+ private void checkCDSPropertiesBean(AbstractCDSPropertiesBean executionObject) {
+ assertThat(executionObject.getBlueprintName()).matches(TEST_PNF_RESOURCE_BLUEPRINT_NAME);
+ assertThat(executionObject.getBlueprintVersion()).matches(TEST_PNF_RESOURCE_BLUEPRINT_VERSION);
+ assertThat(executionObject.getRequestId()).matches(TEST_MSO_REQUEST_ID);
+ assertThat(executionObject.getSubRequestId()).matches(TEST_PNF_UUID);
+ assertThat(executionObject.getMode()).matches("async");
+ assertThat(executionObject.getActionName()).matches("config-deploy");
+ assertThat(executionObject.getOriginatorId()).matches("SO");
+
+ assertThat(executionObject.getRequestObject()).isNotNull();
+ String requestObject = executionObject.getRequestObject();
+
+ checkRequestJson(requestObject);
+ }
+
+ private void checkRequestJson(String requestObject) {
+ try {
+ ObjectMapper mapper = new ObjectMapper();
+ JsonNode tree = mapper.readTree(requestObject);
+ ConfigDeployRequestPnf configDeployRequestPnf =
+ mapper.treeToValue(tree.at("/config-deploy-request"), ConfigDeployRequestPnf.class);
+ assertThat(configDeployRequestPnf.getResolutionKey()).matches(TEST_PNF_CORRELATION_ID);
+
+ ConfigDeployPropertiesForPnf properties = configDeployRequestPnf.getConfigDeployPropertiesForPnf();
+ assertThat(properties.getServiceInstanceId()).matches(TEST_SERVICE_INSTANCE_ID);
+ assertThat(properties.getPnfName()).matches(TEST_PNF_CORRELATION_ID);
+ assertThat(properties.getPnfId()).matches(TEST_PNF_UUID);
+ assertThat(properties.getPnfCustomizationUuid()).matches(TEST_PNF_RESOURCE_CUSTOMIZATION_UUID);
+ assertThat(properties.getServiceModelUuid()).matches(TEST_MODEL_UUID);
+ assertThat(properties.getPnfIpV4Address()).matches(TEST_IPV4_ADDRESS);
+ assertThat(properties.getPnfIpV6Address()).matches(TEST_IPV6_ADDRESS);
+ } catch (IOException e) {
+ e.printStackTrace();
+ fail("Check request body is json message" + e.getMessage());
+ }
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationIdTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationIdTest.java
index 17a6ee09d8..8741208d26 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationIdTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForPnfCorrelationIdTest.java
@@ -23,7 +23,6 @@
package org.onap.so.bpmn.infrastructure.pnf.dmaap;
import static org.assertj.core.api.Assertions.assertThat;
-
import java.util.List;
import org.junit.Test;
@@ -41,12 +40,12 @@ public class JsonUtilForPnfCorrelationIdTest {
@Test
public void parseJsonSuccessful() {
- List<String> expectedResult = JsonUtilForPnfCorrelationId
- .parseJsonToGelAllPnfCorrelationId(JSON_EXAMPLE_WITH_PNF_CORRELATION_ID);
+ List<String> expectedResult =
+ JsonUtilForPnfCorrelationId.parseJsonToGelAllPnfCorrelationId(JSON_EXAMPLE_WITH_PNF_CORRELATION_ID);
assertThat(expectedResult).containsExactly("corrTest1", "corrTest2");
- List<String> expectedResult2 = JsonUtilForPnfCorrelationId
- .parseJsonToGelAllPnfCorrelationId(JSON_WITH_ONE_PNF_CORRELATION_ID);
+ List<String> expectedResult2 =
+ JsonUtilForPnfCorrelationId.parseJsonToGelAllPnfCorrelationId(JSON_WITH_ONE_PNF_CORRELATION_ID);
assertThat(expectedResult2).containsExactly("corrTest3");
}
@@ -59,8 +58,8 @@ public class JsonUtilForPnfCorrelationIdTest {
@Test
public void parseJson_emptyListReturnedWhenNothingFound() {
- List<String> expectedResult = JsonUtilForPnfCorrelationId
- .parseJsonToGelAllPnfCorrelationId(JSON_WITH_NO_PNF_CORRELATION_ID);
+ List<String> expectedResult =
+ JsonUtilForPnfCorrelationId.parseJsonToGelAllPnfCorrelationId(JSON_WITH_NO_PNF_CORRELATION_ID);
assertThat(expectedResult).isEmpty();
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java
index 60f51ff783..9f31e2a5df 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClientTest.java
@@ -25,19 +25,19 @@ package org.onap.so.bpmn.infrastructure.pnf.dmaap;
import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyObject;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
-
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledThreadPoolExecutor;
-
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.ProtocolVersion;
@@ -49,10 +49,14 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.bpmn.infrastructure.pnf.PnfNotificationEvent;
import org.onap.so.bpmn.infrastructure.pnf.dmaap.PnfEventReadyDmaapClient.DmaapTopicListenerThread;
+import org.springframework.context.ApplicationEventPublisher;
import org.springframework.core.env.Environment;
+
@RunWith(MockitoJUnitRunner.class)
public class PnfEventReadyDmaapClientTest {
@@ -81,10 +85,13 @@ public class PnfEventReadyDmaapClientTest {
private Runnable threadMockToNotifyCamundaFlow;
private ScheduledThreadPoolExecutor executorMock;
+ @Mock
+ private ApplicationEventPublisher applicationEventPublisher;
+
@Before
public void init() throws NoSuchFieldException, IllegalAccessException {
- when(env.getProperty(eq("pnf.dmaap.port"), eq(Integer.class))).thenReturn(PORT);
- when(env.getProperty(eq("pnf.dmaap.host"))).thenReturn(HOST);
+ when(env.getProperty(eq("pnf.dmaap.port"), eq(Integer.class))).thenReturn(PORT);
+ when(env.getProperty(eq("pnf.dmaap.host"))).thenReturn(HOST);
when(env.getProperty(eq("pnf.dmaap.protocol"))).thenReturn(PROTOCOL);
when(env.getProperty(eq("pnf.dmaap.uriPathPrefix"))).thenReturn(URI_PATH_PREFIX);
when(env.getProperty(eq("pnf.dmaap.topicName"))).thenReturn(EVENT_TOPIC_TEST);
@@ -92,7 +99,7 @@ public class PnfEventReadyDmaapClientTest {
when(env.getProperty(eq("pnf.dmaap.consumerGroup"))).thenReturn(CONSUMER_GROUP);
when(env.getProperty(eq("pnf.dmaap.topicListenerDelayInSeconds"), eq(Integer.class)))
.thenReturn(TOPIC_LISTENER_DELAY_IN_SECONDS);
- testedObject = new PnfEventReadyDmaapClient(env);
+ testedObject = new PnfEventReadyDmaapClient(env, applicationEventPublisher);
testedObjectInnerClassThread = testedObject.new DmaapTopicListenerThread();
httpClientMock = mock(HttpClient.class);
threadMockToNotifyCamundaFlow = mock(Runnable.class);
@@ -102,56 +109,63 @@ public class PnfEventReadyDmaapClientTest {
/**
* Test run method, where the are following conditions:
- * <p> - DmaapThreadListener is running, flag is set to true
- * <p> - map is filled with one entry with the key that we get from response
- * <p> run method should invoke thread from map to notify camunda process, remove element from the map (map is
- * empty) and shutdown the executor because of empty map
+ * <p>
+ * - DmaapThreadListener is running, flag is set to true
+ * <p>
+ * - map is filled with one entry with the key that we get from response
+ * <p>
+ * run method should invoke thread from map to notify camunda process, remove element from the map (map is empty)
+ * and shutdown the executor because of empty map
*/
@Test
- public void pnfCorrelationIdIsFoundInHttpResponse_notifyAboutPnfReady()
- throws IOException {
- when(httpClientMock.execute(any(HttpGet.class))).
- thenReturn(createResponse(String.format(JSON_EXAMPLE_WITH_PNF_CORRELATION_ID, PNF_CORRELATION_ID)));
+ public void pnfCorrelationIdIsFoundInHttpResponse_notifyAboutPnfReady() throws IOException {
+ when(httpClientMock.execute(any(HttpGet.class)))
+ .thenReturn(createResponse(String.format(JSON_EXAMPLE_WITH_PNF_CORRELATION_ID, PNF_CORRELATION_ID)));
testedObjectInnerClassThread.run();
ArgumentCaptor<HttpGet> captor1 = ArgumentCaptor.forClass(HttpGet.class);
- verify(httpClientMock).execute(captor1.capture());
-
- assertEquals(captor1.getValue().getURI().getHost(),HOST);
- assertEquals(captor1.getValue().getURI().getPort(),PORT);
- assertEquals(captor1.getValue().getURI().getScheme(),PROTOCOL);
- assertEquals(captor1.getValue().getURI().getPath(),"/" + URI_PATH_PREFIX + "/" + EVENT_TOPIC_TEST + "/" + CONSUMER_GROUP + "/" + CONSUMER_ID + "");
-
- verify(threadMockToNotifyCamundaFlow).run();
+ verify(httpClientMock).execute(captor1.capture());
+
+ assertEquals(captor1.getValue().getURI().getHost(), HOST);
+ assertEquals(captor1.getValue().getURI().getPort(), PORT);
+ assertEquals(captor1.getValue().getURI().getScheme(), PROTOCOL);
+ assertEquals(captor1.getValue().getURI().getPath(),
+ "/" + URI_PATH_PREFIX + "/" + EVENT_TOPIC_TEST + "/" + CONSUMER_GROUP + "/" + CONSUMER_ID + "");
+
+ /**
+ * Two PNF returned from HTTP request.
+ */
+ verify(applicationEventPublisher, times(2)).publishEvent(any(PnfNotificationEvent.class));
verify(executorMock).shutdown();
}
/**
* Test run method, where the are following conditions:
- * <p> - DmaapThreadListener is running, flag is set to true
- * <p> - map is filled with one entry with the pnfCorrelationId that does not match to pnfCorrelationId
- * taken from http response. run method should not do anything with the map not run any thread to notify camunda
- * process
+ * <p>
+ * - DmaapThreadListener is running, flag is set to true
+ * <p>
+ * - map is filled with one entry with the pnfCorrelationId that does not match to pnfCorrelationId taken from http
+ * response. run method should not do anything with the map not run any thread to notify camunda process
*/
@Test
- public void pnfCorrelationIdIsFoundInHttpResponse_NotFoundInMap()
- throws IOException {
- when(httpClientMock.execute(any(HttpGet.class))).
- thenReturn(createResponse(
- String.format(JSON_EXAMPLE_WITH_PNF_CORRELATION_ID, PNF_CORRELATION_ID_NOT_FOUND_IN_MAP)));
+ public void pnfCorrelationIdIsFoundInHttpResponse_NotFoundInMap() throws IOException {
+ when(httpClientMock.execute(any(HttpGet.class))).thenReturn(createResponse(
+ String.format(JSON_EXAMPLE_WITH_PNF_CORRELATION_ID, PNF_CORRELATION_ID_NOT_FOUND_IN_MAP)));
testedObjectInnerClassThread.run();
verifyZeroInteractions(threadMockToNotifyCamundaFlow, executorMock);
}
/**
* Test run method, where the are following conditions:
- * <p> - DmaapThreadListener is running, flag is set to true
- * <p> - map is filled with one entry with the pnfCorrelationId but no correlation id is taken from HttpResponse
- * run method should not do anything with the map and not run any thread to notify camunda process
+ * <p>
+ * - DmaapThreadListener is running, flag is set to true
+ * <p>
+ * - map is filled with one entry with the pnfCorrelationId but no correlation id is taken from HttpResponse run
+ * method should not do anything with the map and not run any thread to notify camunda process
*/
@Test
public void pnfCorrelationIdIsNotFoundInHttpResponse() throws IOException {
- when(httpClientMock.execute(any(HttpGet.class))).
- thenReturn(createResponse(JSON_EXAMPLE_WITH_NO_PNF_CORRELATION_ID));
+ when(httpClientMock.execute(any(HttpGet.class)))
+ .thenReturn(createResponse(JSON_EXAMPLE_WITH_NO_PNF_CORRELATION_ID));
testedObjectInnerClassThread.run();
verifyZeroInteractions(threadMockToNotifyCamundaFlow, executorMock);
}
@@ -167,8 +181,7 @@ public class PnfEventReadyDmaapClientTest {
executorField.set(testedObject, executorMock);
executorField.setAccessible(false);
- Field pnfCorrelationToThreadMapField = testedObject.getClass()
- .getDeclaredField("pnfCorrelationIdToThreadMap");
+ Field pnfCorrelationToThreadMapField = testedObject.getClass().getDeclaredField("pnfCorrelationIdToThreadMap");
pnfCorrelationToThreadMapField.setAccessible(true);
Map<String, Runnable> pnfCorrelationToThreadMap = new ConcurrentHashMap<>();
pnfCorrelationToThreadMap.put(PNF_CORRELATION_ID, threadMockToNotifyCamundaFlow);
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/vfcmodel/VfcModelPojoTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/vfcmodel/VfcModelPojoTest.java
index 239361d306..61a4654668 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/vfcmodel/VfcModelPojoTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/vfcmodel/VfcModelPojoTest.java
@@ -21,7 +21,6 @@
package org.onap.so.bpmn.infrastructure.vfcmodel;
import org.junit.Test;
-
import com.openpojo.validation.Validator;
import com.openpojo.validation.ValidatorBuilder;
import com.openpojo.validation.rule.impl.NoNestedClassRule;
@@ -30,16 +29,12 @@ import com.openpojo.validation.test.impl.GetterTester;
import com.openpojo.validation.test.impl.SetterTester;
public class VfcModelPojoTest {
- private String packageName = "org.onap.so.bpmn.infrastructure.vfcmodel";
+ private String packageName = "org.onap.so.bpmn.infrastructure.vfcmodel";
- @Test
- public void validate() {
- Validator validator = ValidatorBuilder.create()
- .with(new NoNestedClassRule())
- .with(new NoPublicFieldsRule())
- .with(new SetterTester())
- .with(new GetterTester())
- .build();
- validator.validate(packageName);
- }
+ @Test
+ public void validate() {
+ Validator validator = ValidatorBuilder.create().with(new NoNestedClassRule()).with(new NoPublicFieldsRule())
+ .with(new SetterTester()).with(new GetterTester()).build();
+ validator.validate(packageName);
+ }
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactoryTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactoryTest.java
new file mode 100644
index 0000000000..0b4050beec
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactoryTest.java
@@ -0,0 +1,157 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 Samsung Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.workflow.service;
+
+import static org.mockito.Mockito.doReturn;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.bpmn.core.domain.ServiceDecomposition;
+
+@RunWith(MockitoJUnitRunner.class)
+public class ServicePluginFactoryTest {
+
+ @Mock
+ ServiceDecomposition serviceDecomposition;
+
+ @Spy
+ ServicePluginFactory servicePluginFactory;
+
+ String uuiRequest = "{" + " \"service\":{" + " \"name\":\"ONAP_223531\","
+ + " \"description\":\"ONAP_1546\","
+ + " \"serviceInvariantUuid\":\"4a09419a-c9fd-4a53-b1bd-b49603169ca1\","
+ + " \"serviceUuid\":\"1bd0eae6-2dcc-4461-9ae6-56d641f369d6\","
+ + " \"globalSubscriberId\":\"test_custormer\"," + " \"serviceType\":\"example-service-type\","
+ + " \"parameters\":{" + " \"locationConstraints\":[" + " ],"
+ + " \"resources\":[" + " {"
+ + " \"resourceName\":\"vEPC_ONAP01\","
+ + " \"resourceInvariantUuid\":\"36ebe421-283a-4ee8-92f1-d09e7c44b911\","
+ + " \"resourceUuid\":\"27a0e235-b67a-4ea4-a0cf-25761afed111\","
+ + " \"resourceCustomizationUuid\":\"47a0e235-b67a-4ea4-a0cf-25761afed231\","
+ + " \"parameters\":{" + " \"locationConstraints\":["
+ + " {"
+ + " \"vnfProfileId\":\"b244d433-8c9c-49ad-9c70-8e34b8dc8328\","
+ + " \"locationConstraints\":{"
+ + " \"vimId\":\"vmware_vio\"" + " }"
+ + " }," + " {"
+ + " \"vnfProfileId\":\"8a9f7c48-21ce-41b7-95b8-a8ac61ccb1ff\","
+ + " \"locationConstraints\":{"
+ + " \"vimId\":\"core-dc_RegionOne\""
+ + " }" + " }" + " ],"
+ + " \"resources\":[" + " ],"
+ + " \"requestInputs\":{" + " \"sdncontroller\":\"\""
+ + " }" + " }" + " }," + " {"
+ + " \"resourceName\":\"VL OVERLAYTUNNEL\","
+ + " \"resourceInvariantUuid\":\"184494cf-472f-436f-82e2-d83dddde21cb\","
+ + " \"resourceUuid\":\"95bc3e59-c9c5-458f-ad6e-78874ab4b3cc\","
+ + " \"resourceCustomizationUuid\":\"27a0e235-b67a-4ea4-a0cf-25761afed232\","
+ + " \"parameters\":{" + " \"locationConstraints\":["
+ + " ]," + " \"resources\":[" + " ],"
+ + " \"requestInputs\":{" + " }" + " }"
+ + " }" + " ]," + " \"requestInputs\":{"
+ + " \"vlunderlayvpn0_name\":\"l3connect\","
+ + " \"vlunderlayvpn0_site1_id\":\"IP-WAN-Controller-1\","
+ + " \"vlunderlayvpn0_site2_id\":\"SPTNController\","
+ + " \"vlunderlayvpn0_site1_networkName\":\"network1,network2\","
+ + " \"vlunderlayvpn0_site2_networkName\":\"network3,network4\","
+ + " \"vlunderlayvpn0_site1_routerId\":\"a8098c1a-f86e-11da-bd1a-00112444be1a\","
+ + " \"vlunderlayvpn0_site2_routerId\":\"a8098c1a-f86e-11da-bd1a-00112444be1e\","
+ + " \"vlunderlayvpn0_site2_importRT1\":\"200:1,200:2\","
+ + " \"vlunderlayvpn0_site1_exportRT1\":\"300:1,300:2\","
+ + " \"vlunderlayvpn0_site2_exportRT1\":\"400:1,400:2\","
+ + " \"vlunderlayvpn0_site1_vni\":\"2000\","
+ + " \"vlunderlayvpn0_site2_vni\":\"3000\","
+ + " \"vlunderlayvpn0_tunnelType\":\"L3-DCI\","
+ + " \"CallSource\":\"NOT-ExternalAPI\"," + " \"sotnconnectivity\":\"\""
+ + " }" + " }" + " }" + "}";
+
+
+ @Test
+ public void doProcessSiteLocation_isNeedProcessSite() {
+ String result = servicePluginFactory.doProcessSiteLocation(serviceDecomposition, uuiRequest);
+ Assert.assertEquals(result, uuiRequest);
+ }
+
+ @Test
+ public void doProcessSiteLocation_uuiObjectNull() {
+ String faultyJsonInput = "site_address,sotncondition_clientsignal";
+ String result = servicePluginFactory.doProcessSiteLocation(serviceDecomposition, faultyJsonInput);
+ Assert.assertEquals(result, faultyJsonInput);
+ }
+
+ @Test
+ public void doProcessSiteLocation_isSiteLocationLocal() {
+ String jsonWithOnlyNeededValues = "{\"site_address\":\"\",\"sotncondition_clientsignal\":\"\"}";
+ String result = servicePluginFactory.doProcessSiteLocation(serviceDecomposition, jsonWithOnlyNeededValues);
+ Assert.assertEquals(result, jsonWithOnlyNeededValues);
+ }
+
+
+ @Test
+ public void doTPResourcesAllocation_Success() {
+ doReturn(null).when(servicePluginFactory).getTPsfromAAI();
+ String result = servicePluginFactory.doTPResourcesAllocation(null, uuiRequest);
+ Assert.assertNotEquals(result, uuiRequest);
+ }
+
+ @Test
+ public void doTPResourcesAllocation_uuiObjectNull() {
+ String faultyJsonInput = "site_address,sotncondition_clientsignal";
+ String result = servicePluginFactory.doTPResourcesAllocation(null, faultyJsonInput);
+ Assert.assertEquals(result, faultyJsonInput);
+ }
+
+ @Test
+ public void doTPResourcesAllocation_isNeedAllocateCrossTPResources() {
+ // doReturn(null).when(servicePluginFactory).getTPsfromAAI();
+ String jsonWithOnlyNeededValues = "{\"site_address\":\"\",\"sotncondition_clientsignal\":\"\"}";
+ String result = servicePluginFactory.doTPResourcesAllocation(null, jsonWithOnlyNeededValues);
+ Assert.assertEquals(result, jsonWithOnlyNeededValues);
+ }
+
+ @Test
+ public void preProcessService_isSOTN() {
+ String invalidJsonWithOnlyNeededValues = "\"clientSignal\":\"\",\"vpnType\":\"\"}";
+ String result = servicePluginFactory.preProcessService(null, invalidJsonWithOnlyNeededValues);
+ Assert.assertEquals(result, invalidJsonWithOnlyNeededValues);
+ }
+
+ @Test
+ public void preProcessService() {
+ String result = servicePluginFactory.preProcessService(null, uuiRequest);
+ Assert.assertEquals(result, uuiRequest);
+ }
+
+ @Test
+ public void doServiceHoming() {
+ String result = servicePluginFactory.doServiceHoming(null, uuiRequest);
+ Assert.assertEquals(result, uuiRequest);
+ }
+
+ @Test
+ public void doServiceHoming_isSOTN() {
+ String invalidJsonWithOnlyNeededValues = "\"clientSignal\":\"\",\"vpnType\":\"\"}";
+ String result = servicePluginFactory.doServiceHoming(null, invalidJsonWithOnlyNeededValues);
+ Assert.assertEquals(result, invalidJsonWithOnlyNeededValues);
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtilTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtilTest.java
index ca8ec22088..f523e7ab1d 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtilTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtilTest.java
@@ -20,15 +20,14 @@
package org.onap.so.bpmn.infrastructure.workflow.serviceTask.client;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
public class HeaderUtilTest {
@Test
public void getAuthorizationTest() throws Exception {
- String authorization = HeaderUtil.getAuthorization(HeaderUtil.USER, HeaderUtil.PASS);
- assertEquals("Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==", authorization);
+ String authorization = HeaderUtil.getAuthorization(HeaderUtil.USER, HeaderUtil.PASS);
+ assertEquals("Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==", authorization);
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java
index 4ac131f873..6f884cb126 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java
@@ -20,13 +20,11 @@
package org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder;
import static org.junit.Assert.assertEquals;
-
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
-
import org.camunda.bpm.engine.ProcessEngine;
import org.camunda.bpm.engine.ProcessEngineServices;
import org.camunda.bpm.engine.delegate.DelegateExecution;
@@ -52,10 +50,10 @@ public class AbstractBuilderTest {
DelegateExecution delegateExecution = new DelegateExecution() {
private String operType;
- private String resourceType;
- private String requestId;
+ private String resourceType;
+ private String requestId;
- @Override
+ @Override
public String getProcessInstanceId() {
return null;
}
@@ -207,14 +205,14 @@ public class AbstractBuilderTest {
@Override
public Object getVariable(String s) {
- if (AbstractBuilder.OPERATION_TYPE.equals(s)) {
- return operType;
- } else if (AbstractBuilder.RESOURCE_TYPE.equals(s)) {
- return resourceType;
- } else if ("msoRequestId".equals(s)) {
- return requestId;
- }
- return null;
+ if (AbstractBuilder.OPERATION_TYPE.equals(s)) {
+ return operType;
+ } else if (AbstractBuilder.RESOURCE_TYPE.equals(s)) {
+ return resourceType;
+ } else if ("msoRequestId".equals(s)) {
+ return requestId;
+ }
+ return null;
}
@Override
@@ -254,13 +252,13 @@ public class AbstractBuilderTest {
@Override
public void setVariable(String s, Object o) {
- if (AbstractBuilder.OPERATION_TYPE.equals(s)) {
- operType = (String) o;
- } else if (AbstractBuilder.RESOURCE_TYPE.equals(s)) {
- resourceType = (String) o;
- } else if ("msoRequestId".equals(s)) {
- requestId = (String) o;
- }
+ if (AbstractBuilder.OPERATION_TYPE.equals(s)) {
+ operType = (String) o;
+ } else if (AbstractBuilder.RESOURCE_TYPE.equals(s)) {
+ resourceType = (String) o;
+ } else if ("msoRequestId".equals(s)) {
+ requestId = (String) o;
+ }
}
@Override
@@ -328,27 +326,27 @@ public class AbstractBuilderTest {
}
- @Override
- public ProcessEngine getProcessEngine(){
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public ProcessEngine getProcessEngine() {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public void setProcessBusinessKey(String arg0){
- // TODO Auto-generated method stub
+ @Override
+ public void setProcessBusinessKey(String arg0) {
+ // TODO Auto-generated method stub
- }
+ }
};
@Test
public void requestActionGetIntValueTest() {
- assertEquals(0, RequestAction.CREATE_NETWORK_INSTANCE.getIntValue());
+ assertEquals(0, RequestAction.CREATE_NETWORK_INSTANCE.getIntValue());
}
@Test
public void svcActionGetIntValueTest() {
- assertEquals(0, SvcAction.RESERVE.getIntValue());
+ assertEquals(0, SvcAction.RESERVE.getIntValue());
}
@Test
@@ -358,81 +356,93 @@ public class AbstractBuilderTest {
@Test
public void getRequestActionBlankOperationTypeTest() throws Exception {
- assertEquals(AbstractBuilder.RequestAction.CREATE_NETWORK_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution));
+ assertEquals(AbstractBuilder.RequestAction.CREATE_NETWORK_INSTANCE.getName(),
+ abstractBuilder.getRequestAction(delegateExecution));
}
@Test
public void getRequestActionDeleteOperationTypeBlankResourceTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
- delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "");
- assertEquals(AbstractBuilder.RequestAction.DELETE_SERVICE_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
+ delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "");
+ assertEquals(AbstractBuilder.RequestAction.DELETE_SERVICE_INSTANCE.getName(),
+ abstractBuilder.getRequestAction(delegateExecution));
}
@Test
public void getRequestActionDeleteOperationTypeBadResourceTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
- delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "bad");
- assertEquals(AbstractBuilder.RequestAction.DELETE_SERVICE_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
+ delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "bad");
+ assertEquals(AbstractBuilder.RequestAction.DELETE_SERVICE_INSTANCE.getName(),
+ abstractBuilder.getRequestAction(delegateExecution));
}
@Test
public void getRequestActionDeleteOperationTypeOverlayResourceTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
- delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "overlay");
- assertEquals(AbstractBuilder.RequestAction.DEACTIVATE_DCI_NETWORK_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
+ delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "overlay");
+ assertEquals(AbstractBuilder.RequestAction.DEACTIVATE_DCI_NETWORK_INSTANCE.getName(),
+ abstractBuilder.getRequestAction(delegateExecution));
}
@Test
public void getRequestActionDeleteOperationTypeUnderlayResourceTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
- delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "underlay");
- assertEquals(AbstractBuilder.RequestAction.DELETE_NETWORK_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
+ delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "underlay");
+ assertEquals(AbstractBuilder.RequestAction.DELETE_NETWORK_INSTANCE.getName(),
+ abstractBuilder.getRequestAction(delegateExecution));
}
@Test
public void getRequestActionDeleteOperationTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
- assertEquals(AbstractBuilder.RequestAction.DELETE_SERVICE_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
+ assertEquals(AbstractBuilder.RequestAction.DELETE_SERVICE_INSTANCE.getName(),
+ abstractBuilder.getRequestAction(delegateExecution));
}
@Test
public void getRequestActionCreateOperationTypeBlankResourceTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
- delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "");
- assertEquals(AbstractBuilder.RequestAction.CREATE_SERVICE_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
+ delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "");
+ assertEquals(AbstractBuilder.RequestAction.CREATE_SERVICE_INSTANCE.getName(),
+ abstractBuilder.getRequestAction(delegateExecution));
}
@Test
public void getRequestActionCreateOperationTypeBadResourceTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
- delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "bad");
- assertEquals(AbstractBuilder.RequestAction.CREATE_SERVICE_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
+ delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "bad");
+ assertEquals(AbstractBuilder.RequestAction.CREATE_SERVICE_INSTANCE.getName(),
+ abstractBuilder.getRequestAction(delegateExecution));
}
@Test
public void getRequestActionCreateOperationTypeOverlayResourceTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
- delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "overlay");
- assertEquals(AbstractBuilder.RequestAction.ACTIVATE_DCI_NETWORK_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
+ delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "overlay");
+ assertEquals(AbstractBuilder.RequestAction.ACTIVATE_DCI_NETWORK_INSTANCE.getName(),
+ abstractBuilder.getRequestAction(delegateExecution));
}
@Test
public void getRequestActionCreateOperationTypeUnderlayResourceTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
- delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "underlay");
- assertEquals(AbstractBuilder.RequestAction.CREATE_NETWORK_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
+ delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "underlay");
+ assertEquals(AbstractBuilder.RequestAction.CREATE_NETWORK_INSTANCE.getName(),
+ abstractBuilder.getRequestAction(delegateExecution));
}
@Test
public void getRequestActionCreateOperationTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
- assertEquals(AbstractBuilder.RequestAction.CREATE_SERVICE_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
+ assertEquals(AbstractBuilder.RequestAction.CREATE_SERVICE_INSTANCE.getName(),
+ abstractBuilder.getRequestAction(delegateExecution));
}
@Test
public void getRequestActionBadOperationType() {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, "bad");
- assertEquals(AbstractBuilder.RequestAction.CREATE_NETWORK_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, "bad");
+ assertEquals(AbstractBuilder.RequestAction.CREATE_NETWORK_INSTANCE.getName(),
+ abstractBuilder.getRequestAction(delegateExecution));
}
@Test
@@ -442,95 +452,95 @@ public class AbstractBuilderTest {
@Test
public void getSvcActionDeleteOperationTypeBlankResourceTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
- delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "");
- assertEquals(AbstractBuilder.SvcAction.UNASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
+ delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "");
+ assertEquals(AbstractBuilder.SvcAction.UNASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
public void getSvcActionDeleteOperationTypeBadResourceTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
- delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "bad");
- assertEquals(AbstractBuilder.SvcAction.UNASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
+ delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "bad");
+ assertEquals(AbstractBuilder.SvcAction.UNASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
public void getSvcActionDeleteOperationTypeOverlayResourceTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
- delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "overlay");
- assertEquals(AbstractBuilder.SvcAction.DEACTIVATE.getName(), abstractBuilder.getSvcAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
+ delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "overlay");
+ assertEquals(AbstractBuilder.SvcAction.DEACTIVATE.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
public void getSvcActionDeleteOperationTypeUnderlayResourceTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
- delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "underlay");
- assertEquals(AbstractBuilder.SvcAction.DELETE.getName(), abstractBuilder.getSvcAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
+ delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "underlay");
+ assertEquals(AbstractBuilder.SvcAction.DELETE.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
public void getSvcActionDeleteOperationTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
- assertEquals(AbstractBuilder.SvcAction.UNASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE);
+ assertEquals(AbstractBuilder.SvcAction.UNASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
public void getSvcActionCreateOperationTypeBlankResourceTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
- delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "");
- assertEquals(AbstractBuilder.SvcAction.ASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
+ delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "");
+ assertEquals(AbstractBuilder.SvcAction.ASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
public void getSvcActionCreateOperationTypeBadResourceTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
- delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "bad");
- assertEquals(AbstractBuilder.SvcAction.ASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
+ delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "bad");
+ assertEquals(AbstractBuilder.SvcAction.ASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
public void getSvcActionCreateOperationTypeOverlayResourceTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
- delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "overlay");
- assertEquals(AbstractBuilder.SvcAction.ACTIVATE.getName(), abstractBuilder.getSvcAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
+ delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "overlay");
+ assertEquals(AbstractBuilder.SvcAction.ACTIVATE.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
public void getSvcActionCreateOperationTypeUnderlayResourceTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
- delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "underlay");
- assertEquals(AbstractBuilder.SvcAction.CREATE.getName(), abstractBuilder.getSvcAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
+ delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "underlay");
+ assertEquals(AbstractBuilder.SvcAction.CREATE.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
public void getSvcActionCreateOperationTypeTest() throws Exception {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
- assertEquals(AbstractBuilder.SvcAction.ASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE);
+ assertEquals(AbstractBuilder.SvcAction.ASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
public void getSvcActionBadOperationType() {
- delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, "bad");
- assertEquals(AbstractBuilder.SvcAction.CREATE.getName(), abstractBuilder.getSvcAction(delegateExecution));
+ delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, "bad");
+ assertEquals(AbstractBuilder.SvcAction.CREATE.getName(), abstractBuilder.getSvcAction(delegateExecution));
}
@Test
public void getRequestIdBlankNotOnExecutionTest() {
- abstractBuilder.getRequestId(delegateExecution);
+ abstractBuilder.getRequestId(delegateExecution);
}
@Test
public void getRequestIdBlankOnExecutionTest() {
- String expected = "requestId";
- delegateExecution.setVariable("msoRequestId", expected);
- assertEquals(expected, abstractBuilder.getRequestId(delegateExecution));
+ String expected = "requestId";
+ delegateExecution.setVariable("msoRequestId", expected);
+ assertEquals(expected, abstractBuilder.getRequestId(delegateExecution));
}
@Test
public void getRequestIdTest() {
- String expected = "requestId";
- abstractBuilder.requestId = expected;
- assertEquals(expected, abstractBuilder.getRequestId(delegateExecution));
+ String expected = "requestId";
+ abstractBuilder.requestId = expected;
+ assertEquals(expected, abstractBuilder.getRequestId(delegateExecution));
}
@Test
@@ -545,8 +555,8 @@ public class AbstractBuilderTest {
@Test
public void getParamEntitiesTest() throws Exception {
- Map<String, String> inputs = new HashMap<>();
- inputs.put("foo", "bar");
+ Map<String, String> inputs = new HashMap<>();
+ inputs.put("foo", "bar");
List<ParamEntity> list = abstractBuilder.getParamEntities(inputs);
assertEquals(1, list.size());
assertEquals("foo", list.get(0).getName());
@@ -555,14 +565,14 @@ public class AbstractBuilderTest {
@Test
public void getParamEntitiesNullInputsTest() {
- List<ParamEntity> list = abstractBuilder.getParamEntities(null);
- assertEquals(0, list.size());
+ List<ParamEntity> list = abstractBuilder.getParamEntities(null);
+ assertEquals(0, list.size());
}
@Test
public void getParamEntitiesEmptyInputsTest() {
- List<ParamEntity> list = abstractBuilder.getParamEntities(new HashMap<>());
- assertEquals(0, list.size());
+ List<ParamEntity> list = abstractBuilder.getParamEntities(new HashMap<>());
+ assertEquals(0, list.size());
}
@Test
@@ -580,4 +590,4 @@ public class AbstractBuilderTest {
abstractBuilder.getServiceInstanceName(delegateExecution);
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilderTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilderTest.java
index 4e39c7b4e3..ed16f5d197 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilderTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilderTest.java
@@ -23,7 +23,6 @@ package org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
-
import org.camunda.bpm.engine.ProcessEngine;
import org.camunda.bpm.engine.ProcessEngineServices;
import org.camunda.bpm.engine.delegate.DelegateExecution;
@@ -35,14 +34,14 @@ import org.camunda.bpm.model.bpmn.instance.FlowElement;
import org.junit.Test;
public class NetworkRpcInputEntityBuilderTest {
- NetworkRpcInputEntityBuilder networRpcInputEntityBuilder = new NetworkRpcInputEntityBuilder();
+ NetworkRpcInputEntityBuilder networRpcInputEntityBuilder = new NetworkRpcInputEntityBuilder();
- DelegateExecution delegateExecution = new DelegateExecution() {
+ DelegateExecution delegateExecution = new DelegateExecution() {
private String operType;
- private String resourceType;
- private String requestId;
+ private String resourceType;
+ private String requestId;
- @Override
+ @Override
public String getProcessInstanceId() {
return null;
}
@@ -194,14 +193,14 @@ public class NetworkRpcInputEntityBuilderTest {
@Override
public Object getVariable(String s) {
- if (AbstractBuilder.OPERATION_TYPE.equals(s)) {
- return operType;
- } else if (AbstractBuilder.RESOURCE_TYPE.equals(s)) {
- return resourceType;
- } else if ("msoRequestId".equals(s)) {
- return requestId;
- }
- return null;
+ if (AbstractBuilder.OPERATION_TYPE.equals(s)) {
+ return operType;
+ } else if (AbstractBuilder.RESOURCE_TYPE.equals(s)) {
+ return resourceType;
+ } else if ("msoRequestId".equals(s)) {
+ return requestId;
+ }
+ return null;
}
@Override
@@ -241,13 +240,13 @@ public class NetworkRpcInputEntityBuilderTest {
@Override
public void setVariable(String s, Object o) {
- if (AbstractBuilder.OPERATION_TYPE.equals(s)) {
- operType = (String) o;
- } else if (AbstractBuilder.RESOURCE_TYPE.equals(s)) {
- resourceType = (String) o;
- } else if ("msoRequestId".equals(s)) {
- requestId = (String) o;
- }
+ if (AbstractBuilder.OPERATION_TYPE.equals(s)) {
+ operType = (String) o;
+ } else if (AbstractBuilder.RESOURCE_TYPE.equals(s)) {
+ resourceType = (String) o;
+ } else if ("msoRequestId".equals(s)) {
+ requestId = (String) o;
+ }
}
@Override
@@ -315,22 +314,22 @@ public class NetworkRpcInputEntityBuilderTest {
}
- @Override
- public ProcessEngine getProcessEngine(){
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public ProcessEngine getProcessEngine() {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public void setProcessBusinessKey(String arg0){
- // TODO Auto-generated method stub
+ @Override
+ public void setProcessBusinessKey(String arg0) {
+ // TODO Auto-generated method stub
- }
+ }
};
- @Test
- public void buildTest() {
- networRpcInputEntityBuilder.build(delegateExecution, null);
- }
+ @Test
+ public void buildTest() {
+ networRpcInputEntityBuilder.build(delegateExecution, null);
+ }
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilderTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilderTest.java
index 556ff67fad..3d1b1de8c0 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilderTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilderTest.java
@@ -23,7 +23,6 @@ package org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
-
import org.camunda.bpm.engine.ProcessEngine;
import org.camunda.bpm.engine.ProcessEngineServices;
import org.camunda.bpm.engine.delegate.DelegateExecution;
@@ -35,14 +34,14 @@ import org.camunda.bpm.model.bpmn.instance.FlowElement;
import org.junit.Test;
public class ServiceRpcInputEntityBuilderTest {
- ServiceRpcInputEntityBuilder serviceRpcInputEntityBuilder = new ServiceRpcInputEntityBuilder();
+ ServiceRpcInputEntityBuilder serviceRpcInputEntityBuilder = new ServiceRpcInputEntityBuilder();
- DelegateExecution delegateExecution = new DelegateExecution() {
+ DelegateExecution delegateExecution = new DelegateExecution() {
private String operType;
- private String resourceType;
- private String requestId;
+ private String resourceType;
+ private String requestId;
- @Override
+ @Override
public String getProcessInstanceId() {
return null;
}
@@ -194,14 +193,14 @@ public class ServiceRpcInputEntityBuilderTest {
@Override
public Object getVariable(String s) {
- if (AbstractBuilder.OPERATION_TYPE.equals(s)) {
- return operType;
- } else if (AbstractBuilder.RESOURCE_TYPE.equals(s)) {
- return resourceType;
- } else if ("msoRequestId".equals(s)) {
- return requestId;
- }
- return null;
+ if (AbstractBuilder.OPERATION_TYPE.equals(s)) {
+ return operType;
+ } else if (AbstractBuilder.RESOURCE_TYPE.equals(s)) {
+ return resourceType;
+ } else if ("msoRequestId".equals(s)) {
+ return requestId;
+ }
+ return null;
}
@Override
@@ -241,13 +240,13 @@ public class ServiceRpcInputEntityBuilderTest {
@Override
public void setVariable(String s, Object o) {
- if (AbstractBuilder.OPERATION_TYPE.equals(s)) {
- operType = (String) o;
- } else if (AbstractBuilder.RESOURCE_TYPE.equals(s)) {
- resourceType = (String) o;
- } else if ("msoRequestId".equals(s)) {
- requestId = (String) o;
- }
+ if (AbstractBuilder.OPERATION_TYPE.equals(s)) {
+ operType = (String) o;
+ } else if (AbstractBuilder.RESOURCE_TYPE.equals(s)) {
+ resourceType = (String) o;
+ } else if ("msoRequestId".equals(s)) {
+ requestId = (String) o;
+ }
}
@Override
@@ -315,22 +314,22 @@ public class ServiceRpcInputEntityBuilderTest {
}
- @Override
- public ProcessEngine getProcessEngine(){
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public ProcessEngine getProcessEngine() {
+ // TODO Auto-generated method stub
+ return null;
+ }
- @Override
- public void setProcessBusinessKey(String arg0){
- // TODO Auto-generated method stub
+ @Override
+ public void setProcessBusinessKey(String arg0) {
+ // TODO Auto-generated method stub
- }
+ }
};
- @Test
- public void buildTest() throws Exception {
- serviceRpcInputEntityBuilder.build(delegateExecution, null);
- }
+ @Test
+ public void buildTest() throws Exception {
+ serviceRpcInputEntityBuilder.build(delegateExecution, null);
+ }
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ClientEntityPojoTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ClientEntityPojoTest.java
index c8949cee0f..70dfd6bd57 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ClientEntityPojoTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ClientEntityPojoTest.java
@@ -21,7 +21,6 @@
package org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity;
import org.junit.Test;
-
import com.openpojo.reflection.PojoClass;
import com.openpojo.reflection.impl.PojoClassFactory;
import com.openpojo.validation.Validator;
@@ -36,41 +35,34 @@ import com.openpojo.validation.test.impl.GetterTester;
import com.openpojo.validation.test.impl.SetterTester;
public class ClientEntityPojoTest {
- @Test
- public void pojoStructure() {
- test(PojoClassFactory.getPojoClass(NetworkInformationEntity.class));
- test(PojoClassFactory.getPojoClass(NetworkInputParametersEntity.class));
- test(PojoClassFactory.getPojoClass(NetworkRequestInputEntity.class));
- test(PojoClassFactory.getPojoClass(NetworkResponseInformationEntity.class));
- test(PojoClassFactory.getPojoClass(NetworkTopologyOperationInputEntity.class));
- test(PojoClassFactory.getPojoClass(NetworkTopologyOperationOutputEntity.class));
- test(PojoClassFactory.getPojoClass(OnapModelInformationEntity.class));
- test(PojoClassFactory.getPojoClass(ParamEntity.class));
- test(PojoClassFactory.getPojoClass(RequestInformationEntity.class));
- test(PojoClassFactory.getPojoClass(RpcNetworkTopologyOperationInputEntity.class));
- test(PojoClassFactory.getPojoClass(SdncRequestHeaderEntity.class));
- test(PojoClassFactory.getPojoClass(RpcServiceTopologyOperationInputEntity.class));
- test(PojoClassFactory.getPojoClass(RpcServiceTopologyOperationOutputEntity.class));
- test(PojoClassFactory.getPojoClass(ServiceInformationEntity.class));
- test(PojoClassFactory.getPojoClass(ServiceInputParametersEntity.class));
- test(PojoClassFactory.getPojoClass(ServiceRequestInputEntity.class));
- test(PojoClassFactory.getPojoClass(ServiceResponseInformationEntity.class));
- test(PojoClassFactory.getPojoClass(ServiceTopologyOperationInputEntity.class));
- test(PojoClassFactory.getPojoClass(ServiceTopologyOperationOutputEntity.class));
- test(PojoClassFactory.getPojoClass(RpcNetworkTopologyOperationOutputEntity.class));
- }
-
- private void test(PojoClass pojoClass) {
- Validator validator = ValidatorBuilder.create()
- .with(new GetterMustExistRule())
- .with(new SetterMustExistRule())
- .with(new NoNestedClassRule())
- .with(new NoPrimitivesRule())
- .with(new NoPublicFieldsRule())
- .with(new SetterTester())
- .with(new GetterTester())
- .with(new DefaultValuesNullTester())
- .build();
- validator.validate(pojoClass);
- }
+ @Test
+ public void pojoStructure() {
+ test(PojoClassFactory.getPojoClass(NetworkInformationEntity.class));
+ test(PojoClassFactory.getPojoClass(NetworkInputParametersEntity.class));
+ test(PojoClassFactory.getPojoClass(NetworkRequestInputEntity.class));
+ test(PojoClassFactory.getPojoClass(NetworkResponseInformationEntity.class));
+ test(PojoClassFactory.getPojoClass(NetworkTopologyOperationInputEntity.class));
+ test(PojoClassFactory.getPojoClass(NetworkTopologyOperationOutputEntity.class));
+ test(PojoClassFactory.getPojoClass(OnapModelInformationEntity.class));
+ test(PojoClassFactory.getPojoClass(ParamEntity.class));
+ test(PojoClassFactory.getPojoClass(RequestInformationEntity.class));
+ test(PojoClassFactory.getPojoClass(RpcNetworkTopologyOperationInputEntity.class));
+ test(PojoClassFactory.getPojoClass(SdncRequestHeaderEntity.class));
+ test(PojoClassFactory.getPojoClass(RpcServiceTopologyOperationInputEntity.class));
+ test(PojoClassFactory.getPojoClass(RpcServiceTopologyOperationOutputEntity.class));
+ test(PojoClassFactory.getPojoClass(ServiceInformationEntity.class));
+ test(PojoClassFactory.getPojoClass(ServiceInputParametersEntity.class));
+ test(PojoClassFactory.getPojoClass(ServiceRequestInputEntity.class));
+ test(PojoClassFactory.getPojoClass(ServiceResponseInformationEntity.class));
+ test(PojoClassFactory.getPojoClass(ServiceTopologyOperationInputEntity.class));
+ test(PojoClassFactory.getPojoClass(ServiceTopologyOperationOutputEntity.class));
+ test(PojoClassFactory.getPojoClass(RpcNetworkTopologyOperationOutputEntity.class));
+ }
+
+ private void test(PojoClass pojoClass) {
+ Validator validator = ValidatorBuilder.create().with(new GetterMustExistRule()).with(new SetterMustExistRule())
+ .with(new NoNestedClassRule()).with(new NoPrimitivesRule()).with(new NoPublicFieldsRule())
+ .with(new SetterTester()).with(new GetterTester()).with(new DefaultValuesNullTester()).build();
+ validator.validate(pojoClass);
+ }
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/queryAAIVpnBindingTestResponseWithRoutes.json b/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/queryAAIVpnBindingTestResponseWithRoutes.json
new file mode 100644
index 0000000000..4a30d4bcec
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/queryAAIVpnBindingTestResponseWithRoutes.json
@@ -0,0 +1,903 @@
+{
+ "vpn-id": "13e94b71-3ce1-4988-ab0e-61208fc91f1c",
+ "vpn-name": "vMDNS",
+ "resource-version": "1510956324462",
+ "route-targets": {"route-target": [
+ {
+ "global-route-target": "2001:051111",
+ "route-target-role": "EXPORT",
+ "resource-version": "1515683690360"
+ },
+ {
+ "global-route-target": "1000:051113",
+ "route-target-role": "IMPORT",
+ "resource-version": "1515683690372"
+ }
+ ]},
+ "relationship-list": {"relationship": [
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/b3376949-5487-4a74-9029-332c07720c07",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "b3376949-5487-4a74-9029-332c07720c07"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "vEPDG-FN-26642-T-01_hsl_fn_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/d0b8ecd3-aee4-48ba-8bc5-222d3fb08162",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "d0b8ecd3-aee4-48ba-8bc5-222d3fb08162"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_Shared_oam_protected_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/34305bd0-ad54-4349-8567-6f65ea09e750",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "34305bd0-ad54-4349-8567-6f65ea09e750"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_vEPDG-FN_swu_direct_fn_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/dfa4972a-ed82-43cd-98be-ed73bb3406a9",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "dfa4972a-ed82-43cd-98be-ed73bb3406a9"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_Shared_EXN_INTERNET_NET_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/93556256-aa23-449d-a2fd-3a9c034f232a",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "93556256-aa23-449d-a2fd-3a9c034f232a"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_CORE-NSD-TOAM0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/7ce01c3a-5998-4908-85f6-ab29bc507a92",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "7ce01c3a-5998-4908-85f6-ab29bc507a92"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B-VSHAKEN_CORE-NSD-TOAM0_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/016d3722-999b-4133-b4e6-8a1088bab664",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "016d3722-999b-4133-b4e6-8a1088bab664"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND-vepdg-FN-Shared_oam_protected_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/80038196-9eae-452c-ad06-1f3fef1bef9f",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "80038196-9eae-452c-ad06-1f3fef1bef9f"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_VPMS-FN-26071-T-BE-01_cdr_direct_net420"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/f5f38447-dc62-4969-90a3-c60474f9c0ac",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "f5f38447-dc62-4969-90a3-c60474f9c0ac"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_Shared_OAM_DIRECT_NET_3"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/58b374aa-01ca-4a39-99b9-889c2f7ae908",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "58b374aa-01ca-4a39-99b9-889c2f7ae908"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_OAM_MGMT_NET_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/efe0dfca-18e7-4992-a63a-041b9f8271e0",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "efe0dfca-18e7-4992-a63a-041b9f8271e0"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_APN-dns_int_apn_dns_fn_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/dab7e704-6a6e-4c53-9a80-fb5857a43b6f",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "dab7e704-6a6e-4c53-9a80-fb5857a43b6f"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B-VSHAKEN_CORE-NSD-TOAM0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/634653b3-9084-41d9-ad6a-40863a3d666f",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "634653b3-9084-41d9-ad6a-40863a3d666f"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-01A_int_fw_dns_trusted_net_5"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/6117b35e-c029-4308-85e6-007c24014484",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "6117b35e-c029-4308-85e6-007c24014484"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-24595-D-T001_vprobes_int_mgmt_net_2"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/eb1ce51b-d10f-4b08-9166-345335b9f73b",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "eb1ce51b-d10f-4b08-9166-345335b9f73b"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_OAMP_NSD_ISBC0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/468f83be-4abb-4901-950b-e399b77a09a0",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "468f83be-4abb-4901-950b-e399b77a09a0"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_IRPR-TOAM0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/103d17dc-6575-427c-a2c1-301493e08ec0",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "103d17dc-6575-427c-a2c1-301493e08ec0"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_segw_hsl_direct_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/305214f8-64be-4209-8a0d-10b6dfb77dd1",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "305214f8-64be-4209-8a0d-10b6dfb77dd1"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_vMDS_FN_int_fw_dns_trusted_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/7989a6d2-ba10-4a5d-8f15-4520bc833090",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "7989a6d2-ba10-4a5d-8f15-4520bc833090"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02AShared_cor_direct_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/f040ebf4-76ad-4b05-a766-1deec26549ae",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "f040ebf4-76ad-4b05-a766-1deec26549ae"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "vEPDG-FN-26642-T-01_gn_untrusted_fn_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/26d6038b-4b9e-4fe5-bcff-9af7586651cc",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "26d6038b-4b9e-4fe5-bcff-9af7586651cc"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-24595-D-T001_vprobes_pktinternal_net_10"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/9e78d3f4-85b5-40b8-803e-c3a0ab6d6165",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "9e78d3f4-85b5-40b8-803e-c3a0ab6d6165"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_MNS_Shared_oam_protected_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/a2de22f9-eb91-452e-aff5-e81a1a679ef6",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "a2de22f9-eb91-452e-aff5-e81a1a679ef6"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_Shared_GN_DIRECT_NET_01"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/6d6b7254-72d2-4731-80d6-8e8375d959e9",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "6d6b7254-72d2-4731-80d6-8e8375d959e9"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_VDBE-PED-DMZ0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/21819ac4-95c4-490f-ba7c-0ad92920f805",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "21819ac4-95c4-490f-ba7c-0ad92920f805"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_FN_int_pktinternal_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/98ff6827-320a-4b71-bd2b-df2bd20b6855",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "98ff6827-320a-4b71-bd2b-df2bd20b6855"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_Shared_oam_protected_net_2"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/e229ab86-279c-4505-a08a-91e373293e20",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "e229ab86-279c-4505-a08a-91e373293e20"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_Shared_OAM_DIRECT_NET_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/bb722f93-2d1a-42a5-bd11-57ad30ff1085",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "bb722f93-2d1a-42a5-bd11-57ad30ff1085"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_segw_hsl_direct_net_2"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/0399443d-1fc6-42a6-934c-77030d751916",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "0399443d-1fc6-42a6-934c-77030d751916"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_VDBE-PED-DMZ0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/d259ec74-304d-4bd2-bbd6-93c201acba42",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "d259ec74-304d-4bd2-bbd6-93c201acba42"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A__vprobes_int_mgmt_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/f69fb458-e2bd-4d0f-9a47-430d18cbebfd",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "f69fb458-e2bd-4d0f-9a47-430d18cbebfd"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_VPMS-FN-26071-T-BE-01_cdr_direct_net4"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/0f18b91f-ee79-403b-a081-8c0a89650641",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "0f18b91f-ee79-403b-a081-8c0a89650641"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_VPMS-FN_int_pktinternal_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/90fdbbbb-42bb-41ff-9356-db245466a4fc",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "90fdbbbb-42bb-41ff-9356-db245466a4fc"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_Shared_oam_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/0e66adce-d5dd-4968-bcb2-83f0281424db",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "0e66adce-d5dd-4968-bcb2-83f0281424db"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B-VSHAKEN_VDBF-MIS-UDAT0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/db572383-dbd7-4d5e-93cb-8c7c1d209a90",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "db572383-dbd7-4d5e-93cb-8c7c1d209a90"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_TRST_VIF_ISBC0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/478b7f86-8544-48e5-95f1-568dfd18730d",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "478b7f86-8544-48e5-95f1-568dfd18730d"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_Shared_GN_DIRECT_NET_01"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/0f725895-5224-4016-b49a-d9d016eaafff",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "0f725895-5224-4016-b49a-d9d016eaafff"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_Shared_OAM_DIRECT_NET_2"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/9cd47b0c-ee58-46f0-9ec5-b4db504dd59b",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "9cd47b0c-ee58-46f0-9ec5-b4db504dd59b"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "MNS-FN-25180-T-01Shared_oam_protected_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/f95259c9-f5c6-4861-a9f4-b6eec199b33f",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "f95259c9-f5c6-4861-a9f4-b6eec199b33f"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_Shared_oam_protected_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/caf98ee4-2496-4c92-a41c-b6a50efcc29f",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "caf98ee4-2496-4c92-a41c-b6a50efcc29f"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_MGM-CORE-NSD-TOAM0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/754739cb-5371-4d5b-a02a-489587d17443",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "754739cb-5371-4d5b-a02a-489587d17443"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_Shared_OAM_DIRECT_NET_4"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/8cd7add8-0cfc-4f65-bbf8-d0f25a0dbc70",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "8cd7add8-0cfc-4f65-bbf8-d0f25a0dbc70"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_VDBE-MIS-UDAT0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/7093921f-bed8-4866-bb3c-a2b8c376ca69",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "7093921f-bed8-4866-bb3c-a2b8c376ca69"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_VIRPR-TDAT0_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/691da8b2-805e-4dd1-aaf5-b0e37414c662",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "691da8b2-805e-4dd1-aaf5-b0e37414c662"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_int_pktmirror_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/00eaa0b3-90df-4b43-a850-9d30abb7fded",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "00eaa0b3-90df-4b43-a850-9d30abb7fded"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-01AShared_oam_protected_net_5"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/6ba57200-c61a-46be-821b-88b3fa169b66",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "6ba57200-c61a-46be-821b-88b3fa169b66"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_OAM_MGMT_NET_3"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/8e32ec2c-47a1-4514-b21a-2806e23f0437",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "8e32ec2c-47a1-4514-b21a-2806e23f0437"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B-VSHAKENb_VDBF-PSD-DMZ0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/a755ddd0-512a-444d-9f38-97b3eff70f85",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "a755ddd0-512a-444d-9f38-97b3eff70f85"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_UNTR_VSE_ISBC0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/c7bde85d-1c12-467c-ae6f-57bdf5c1d380",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "c7bde85d-1c12-467c-ae6f-57bdf5c1d380"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B-VSHAKENb_VDBF-PSD-DMZ0_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/0933fcec-9e78-4045-a21a-8258e18cb78e",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "0933fcec-9e78-4045-a21a-8258e18cb78e"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_vdbe_oam_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/6a26a729-d9ce-4619-a20e-38597205ba7d",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "6a26a729-d9ce-4619-a20e-38597205ba7d"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "vEPDG-FN-26642-T-01_swu_direct_fn_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/c1a06665-518b-408b-bfe0-8f393204baf6",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "c1a06665-518b-408b-bfe0-8f393204baf6"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_OAM_MGMT_NET_2"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/fb51398b-7622-4570-9bd6-e29c82621d44",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "fb51398b-7622-4570-9bd6-e29c82621d44"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02B_OAM_MGMT_NET_4"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/92072731-1c40-45c2-a218-5e75b713b312",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "92072731-1c40-45c2-a218-5e75b713b312"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_TRST_VIF_ISBC0_net_0001"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/c6d94632-fd6b-4bfe-993e-377b0368476b",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "c6d94632-fd6b-4bfe-993e-377b0368476b"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-01AShared_int_ha_net_5"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/84516ef3-e371-4039-908e-83cd2b55a4a1",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "84516ef3-e371-4039-908e-83cd2b55a4a1"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "VPMS-FN-26071-T-BE-01_vprobes_int_mgmt_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/2c4f3adc-1a45-4484-8fb6-9eeac99eb922",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "2c4f3adc-1a45-4484-8fb6-9eeac99eb922"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_VDBE-MIS-UDAT0_net_0"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/1fea0624-dac2-4997-904d-34ca1bc12fa9",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "1fea0624-dac2-4997-904d-34ca1bc12fa9"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02AShared_cps_internal_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/8ab98982-05b7-45b2-828d-648da3d6cc0f",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "8ab98982-05b7-45b2-828d-648da3d6cc0f"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "vEPDG-FN-26642-T-01_swu_direct_fn_net_2"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/c8934d59-24a8-41cc-af9d-2026ef261843",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "c8934d59-24a8-41cc-af9d-2026ef261843"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APPC-24595-T-IST-02A_Shared_oam_protected_net_vrar_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/c741fe5b-bf27-4ad9-b30d-20518e115495",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "c741fe5b-bf27-4ad9-b30d-20518e115495"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_int_apn_dns_fn_net_PB_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/8285fbae-ec25-44f7-ac52-89a968d45a2b",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "8285fbae-ec25-44f7-ac52-89a968d45a2b"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-T2B_vEPDG-FN_swu_direct_fn_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/65e6d4b0-0c96-4bfa-bdd6-2baa16df322a",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "65e6d4b0-0c96-4bfa-bdd6-2baa16df322a"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-DND_vEPDG-FN_gn_untrusted_fn_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/38e51c7b-adc2-491a-a036-3189645b007c",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "38e51c7b-adc2-491a-a036-3189645b007c"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "vprobes_pktinternal_net_2_1806"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/4d210b09-b6ce-41b3-95a6-5e4dffea9ca2",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "4d210b09-b6ce-41b3-95a6-5e4dffea9ca2"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "vprobes_pktinternal_net_3_1806"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/c5df1c57-3c85-4abc-973f-a1ffb13e391a",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "c5df1c57-3c85-4abc-973f-a1ffb13e391a"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-24595-T-IST-04AShared_untrusted_vDBE_net_1"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/467e3349-bec1-4922-bcb1-d0bb041bce30",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "467e3349-bec1-4922-bcb1-d0bb041bce30"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "vprobes_pktinternal_net_4_1806"
+ }]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v12/network/l3-networks/l3-network/1596f4d2-66b5-4627-96f2-c26794154530",
+ "relationship-data": [ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "1596f4d2-66b5-4627-96f2-c26794154530"
+ }],
+ "related-to-property": [ {
+ "property-key": "l3-network.network-name",
+ "property-value": "APP-C-24595-T-IST-04AShared_untrusted_vDBE_net_2"
+ }]
+ }
+ ]}
+} \ No newline at end of file
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV2/vnfAdapterDeleteRequest.xml b/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV2/vnfAdapterDeleteRequest.xml
index fd6c228cba..f7d44c030b 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV2/vnfAdapterDeleteRequest.xml
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV2/vnfAdapterDeleteRequest.xml
@@ -1,5 +1,6 @@
<deleteVolumeGroupRequest>
<cloudSiteId>null</cloudSiteId>
+ <cloudOwner>null</cloudOwner>
<tenantId>12345</tenantId>
<volumeGroupId>12345</volumeGroupId>
<volumeGroupStackId>null</volumeGroupStackId>