aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--bpmn/MSOCommonBPMN/pom.xml1114
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/MSOCommonApplication.java59
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java18
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/ProcessEngineAwareService.java64
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/SDNCAdapterCallbackServiceImpl.java10
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java8
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java17
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResourceApplication.java11
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/PreconditionFailedException.java (renamed from bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java)67
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/ResponseExceptionMapper.java98
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/ResponseExceptionMapperImpl.java39
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/RestProperties.java30
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/RestPropertiesLoader.java55
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/Consumer.java30
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DefaultDmaapPropertiesImpl.java38
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapClient.java68
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapConsumer.java117
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapProperties.java32
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPropertiesLoader.java49
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPublisher.java25
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/Publisher.java26
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/exceptions/DMaaPConsumerFailure.java34
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/exceptions/ExceededMaximumPollingTime.java34
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/DMaaPRestClient.java57
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/PropertiesBean.java131
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/RestConsumer.java60
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/RestPublisher.java56
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java268
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyRestClient.java53
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyRestProperties.java64
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/RestClient.java181
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/entities/PolicyServiceType.java48
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidator.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidatorImpl.java101
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/Body.java (renamed from bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Body.java)4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/Input.java (renamed from bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Input.java)8
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/RequestHealthDiagnostic.java (renamed from bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/RequestHealthDiagnostic.java)4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/ResultInfo.java (renamed from bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/ResultInfo.java)4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/SDNO.java (renamed from bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNO.java)24
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/dmaap/SDNOHealthCheckDmaapConsumer.java156
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/dmaap/SDNOHealthCheckDmaapPublisher.java50
-rw-r--r--bpmn/MSOCommonBPMN/src/main/resources/META-INF/processes.xml2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/applicationContext.xml8
-rw-r--r--bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml38
-rw-r--r--bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-web.xml26
-rw-r--r--bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/web.xml81
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java3
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java4
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java5
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/FileUtil.java (renamed from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/FileUtil.java)0
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResource.java (renamed from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/MockResource.java)0
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResourceApplication.java (renamed from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/MockResourceApplication.java)0
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/SDNCAdapterMockTransformer.java (renamed from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterMockTransformer.java)0
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/SDNCAdapterNetworkTopologyMockTransformer.java (renamed from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterNetworkTopologyMockTransformer.java)0
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java (renamed from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java)2138
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseDatabase.java (renamed from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseDatabase.java)0
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseNetworkAdapter.java (renamed from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseNetworkAdapter.java)0
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponsePolicy.java (renamed from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponsePolicy.java)188
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseSDNCAdapter.java (renamed from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseSDNCAdapter.java)0
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseSNIRO.java (renamed from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseSNIRO.java)138
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseVNFAdapter.java (renamed from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseVNFAdapter.java)0
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterCreateMockTransformer.java (renamed from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterCreateMockTransformer.java)0
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterDeleteMockTransformer.java (renamed from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterDeleteMockTransformer.java)0
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterQueryMockTransformer.java (renamed from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterQueryMockTransformer.java)0
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterRollbackMockTransformer.java (renamed from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterRollbackMockTransformer.java)0
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterUpdateMockTransformer.java (renamed from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterUpdateMockTransformer.java)0
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/policy/PolicyDecisionTest.java70
-rw-r--r--bpmn/MSOInfrastructureBPMN/pom.xml7
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnfAndModules.groovy80
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy13
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy11
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy7
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy24
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy41
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowAsyncInfrastructureResource.java46
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java8
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/META-INF/processes.xml4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn123
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteVcpeResCustService.bpmn1
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceBRG.bpmn32
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceTXC.bpmn44
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstanceTest.groovy160
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceTest.groovy143
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy128
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy2
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy13
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy95
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java1
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java1
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java1
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties2
-rw-r--r--bpmn/MSOMockServer/.gitignore4
-rw-r--r--bpmn/MSOMockServer/WebContent/META-INF/MANIFEST.MF3
-rw-r--r--bpmn/MSOMockServer/WebContent/WEB-INF/jboss-deployment-structure.xml21
-rw-r--r--bpmn/MSOMockServer/WebContent/WEB-INF/web.xml3
-rw-r--r--bpmn/MSOMockServer/pom.xml100
-rw-r--r--bpmn/MSOMockServer/src/main/resources/__files/sdncSimResponse.xml19
-rw-r--r--bpmn/MSOMockServer/src/main/webapp/WEB-INF/jboss-web.xml6
-rw-r--r--bpmn/pom.xml1
-rw-r--r--docs/BPMN_Main_Process_Flows.rst40
-rw-r--r--docs/BPMN_Project_Deployment_Strategy.rst35
-rw-r--r--docs/BPMN_Project_Structure.rst47
-rw-r--r--docs/BPMN_Subprocess_Process_Flows.rst32
-rw-r--r--docs/Building_SO.rst79
-rw-r--r--docs/Camunda_Cockpit_Community_Edition.rst44
-rw-r--r--docs/Camunda_Cockpit_Enterprise_Edition.rst143
-rw-r--r--docs/Camunda_Modeler.rst19
-rw-r--r--docs/Configure_git_and_gerrit.rst93
-rw-r--r--docs/Developer_Info.rst13
-rw-r--r--docs/Install_Configure_SO.rst80
-rw-r--r--docs/Install_Docker.rst85
-rw-r--r--docs/SO_API_v0.1.pdfbin0 -> 524355 bytes
-rw-r--r--docs/SO_R1_Interface.rst17
-rw-r--r--docs/UUI-SO_API_Specification_v0.1.docx (renamed from docs/UUI-SO API Specification v0.1(1).docx)bin61244 -> 61243 bytes
-rw-r--r--docs/Working_with_SO_Docker.rst208
-rw-r--r--docs/Workspace_and_Development_Tools.rst107
-rw-r--r--docs/architecture.rst105
-rw-r--r--docs/developer_information.rst20
-rw-r--r--docs/images/BPMN_Main_Process_Flows_1.pngbin0 -> 61782 bytes
-rw-r--r--docs/images/BPMN_Subprocess_process_flows_1.pngbin0 -> 51579 bytes
-rw-r--r--docs/images/Camunda_Cockpit_1.pngbin0 -> 7230 bytes
-rw-r--r--docs/images/Camunda_Cockpit_2.pngbin0 -> 48004 bytes
-rw-r--r--docs/images/Camunda_Cockpit_3.pngbin0 -> 46008 bytes
-rw-r--r--docs/images/Camunda_Cockpit_4.pngbin0 -> 75143 bytes
-rw-r--r--docs/images/Camunda_Cockpit_Enterprise_1.pngbin0 -> 7230 bytes
-rw-r--r--docs/images/Configure_git_1.pngbin0 -> 1271 bytes
-rw-r--r--docs/images/Configure_git_2.pngbin0 -> 22979 bytes
-rw-r--r--docs/images/Configure_git_3.pngbin0 -> 21978 bytes
-rw-r--r--docs/images/Configure_ubuntu_SO_1.pngbin0 -> 31905 bytes
-rw-r--r--docs/images/Configure_ubuntu_SO_2.pngbin0 -> 8827 bytes
-rw-r--r--docs/images/Configure_ubuntu_SO_3.pngbin0 -> 23472 bytes
-rw-r--r--docs/images/Configure_ubuntu_SO_4.pngbin0 -> 6897 bytes
-rw-r--r--docs/images/Configure_ubuntu_SO_5.pngbin0 -> 6588 bytes
-rw-r--r--docs/images/Configure_ubuntu_SO_6.pngbin0 -> 110229 bytes
-rw-r--r--docs/images/Configure_ubuntu_SO_7.pngbin0 -> 24181 bytes
-rw-r--r--docs/images/Configure_ubuntu_SO_8.pngbin0 -> 6588 bytes
-rw-r--r--docs/images/Configure_ubuntu_SO_9.pngbin0 -> 10809 bytes
-rw-r--r--docs/images/Docker_install_1.pngbin0 -> 26476 bytes
-rw-r--r--docs/images/SO_Architecture_1.pngbin0 -> 108239 bytes
-rw-r--r--docs/images/SO_R1_1.pngbin0 -> 29837 bytes
-rw-r--r--docs/images/Workspace_and_Development_Tools.pngbin0 -> 15460 bytes
-rw-r--r--docs/images/Workspace_and_Development_Tools_2.pngbin0 -> 32643 bytes
-rw-r--r--docs/images/Workspace_and_Development_Tools_3.pngbin0 -> 62244 bytes
-rw-r--r--docs/images/Workspace_and_Development_Tools_4.pngbin0 -> 69016 bytes
-rw-r--r--docs/images/bpmn_project_structure_1.pngbin0 -> 27787 bytes
-rw-r--r--docs/images/bpmn_project_structure_2.pngbin0 -> 33254 bytes
-rw-r--r--docs/images/bpmn_project_structure_3.pngbin0 -> 60388 bytes
-rw-r--r--docs/images/bpmn_project_structure_4.pngbin0 -> 23978 bytes
-rw-r--r--docs/images/bpmn_project_structure_5.pngbin0 -> 64518 bytes
-rw-r--r--docs/images/camunda_modeler_1.pngbin0 -> 82589 bytes
-rw-r--r--docs/index.rst5
-rw-r--r--docs/installation.rst209
-rw-r--r--docs/offered_consumed_apis.rst9
-rw-r--r--docs/release-notes.rst53
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java5
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/serviceinstancebeans/RequestInfo.java3
-rw-r--r--packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/soapui/SoapUiITCase.java6
-rw-r--r--packages/deliveries/src/main/assembly/war-pack/mso-wars.xml7
161 files changed, 5435 insertions, 3197 deletions
diff --git a/.gitignore b/.gitignore
index 04bad35c02..958c3e2f76 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,7 @@ target
.project
.buildpath
.idea
+.checkstyle
*.iml
**/logs/
**/debug-logs/
diff --git a/bpmn/MSOCommonBPMN/pom.xml b/bpmn/MSOCommonBPMN/pom.xml
index e5becbf6cc..c0e657479f 100644
--- a/bpmn/MSOCommonBPMN/pom.xml
+++ b/bpmn/MSOCommonBPMN/pom.xml
@@ -1,604 +1,510 @@
-<?xml version="1.0"?>
-<project
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.openecomp.so</groupId>
- <artifactId>bpmn</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- </parent>
- <artifactId>MSOCommonBPMN</artifactId>
- <name>MSOCommonBPMN</name>
- <packaging>war</packaging>
-
- <properties>
- <camunda.version>7.6.0</camunda.version>
- <spring.version>4.3.2.RELEASE</spring.version>
- <httpclient.version>3.1</httpclient.version>
- <jax.ws.rs>2.0.1</jax.ws.rs>
- <jackson.version>1.1.1</jackson.version>
- <maven.compiler.target>1.8</maven.compiler.target>
- <maven.compiler.source>1.8</maven.compiler.source>
- </properties>
-
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <executions>
- <execution>
- <id>test-compile</id>
- <phase>compile</phase>
- <goals>
- <goal>testCompile</goal>
- </goals>
- <configuration>
- <skip>false</skip>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.6</version>
- <executions>
- <execution>
- <!-- Build MSOCommonBPMN-${version}.jar -->
- <id>default-jar</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- <configuration>
- <excludes>
- <exclude>org/openecomp/mso/bpmn/common/MSOCommonApplication.class</exclude>
- <!-- <exclude>META-INF/</exclude> -->
- </excludes>
- </configuration>
- </execution>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- <configuration>
- <forceCreation>true</forceCreation>
- <skip>false</skip>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>3.0.0</version>
- <executions>
- <execution>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <artifacts>
- <artifact>
- <file>${project.build.directory}/${project.artifactId}-${project.version}.jar</file>
- <type>jar</type>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <failOnMissingWebXml>false</failOnMissingWebXml>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-codegen-plugin</artifactId>
- <version>2.5.2</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <version>2.8</version>
- <configuration>
- <additionalProjectnatures>
- <projectnature>org.eclipse.jdt.groovy.core.groovyNature</projectnature>
- </additionalProjectnatures>
- <sourceIncludes>
- <sourceInclude>**/*.groovy</sourceInclude>
- </sourceIncludes>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>compile</id>
- <phase>compile</phase>
- <configuration>
- <tasks>
- <mkdir dir="${basedir}/src/main/groovy" />
- <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc">
- <classpath refid="maven.compile.classpath" />
- </taskdef>
- <mkdir dir="${project.build.outputDirectory}" />
- <groovyc destdir="${project.build.outputDirectory}"
- srcdir="${basedir}/src/main/groovy/" listfiles="true">
- <classpath refid="maven.compile.classpath" />
- </groovyc>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- <execution>
- <id>test-compile</id>
- <phase>test-compile</phase>
- <configuration>
- <tasks>
- <mkdir dir="${basedir}/src/test/groovy" />
- <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc">
- <classpath refid="maven.test.classpath" />
- </taskdef>
- <mkdir dir="${project.build.testOutputDirectory}" />
- <groovyc destdir="${project.build.testOutputDirectory}"
- srcdir="${basedir}/src/test/groovy/" listfiles="true">
- <classpath refid="maven.test.classpath" />
- </groovyc>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>jaxb2-maven-plugin</artifactId>
- <version>2.3</version>
- <executions>
- <execution>
- <id>xjc</id>
- <goals>
- <goal>xjc</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <extension>true</extension>
- <arguments>
- <argument>-Xannotate</argument>
- <argument>-Xcommons-lang</argument>
- </arguments>
- <sources>
- <source>src/main/resources/xsd</source>
- </sources>
- <xjbSources>
- <xjbSource>src/main/resources/xjb</xjbSource>
- </xjbSources>
- <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
- </configuration>
- <dependencies>
- <dependency>
- <groupId>org.jvnet.jaxb2_commons</groupId>
- <artifactId>jaxb2-basics-annotate</artifactId>
- <version>0.6.4</version>
- </dependency>
- <dependency>
- <groupId>org.jvnet.jaxb2_commons</groupId>
- <artifactId>jaxb2-commons-lang</artifactId>
- <version>2.3</version>
- </dependency>
- <dependency>
- <groupId>com.sun.codemodel</groupId>
- <artifactId>codemodel</artifactId>
- <version>2.6</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings
- only. It has no influence on the Maven build itself. -->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>
- org.apache.maven.plugins
- </groupId>
- <artifactId>
- maven-antrun-plugin
- </artifactId>
- <versionRange>
- [1.3,)
- </versionRange>
- <goals>
- <goal>run</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore></ignore>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
-
-
- </plugins>
- </pluginManagement>
- </build>
-
- <dependencies>
-
- <dependency>
- <!-- process engine, in compile scope to include it in the war file -->
- <groupId>org.camunda.bpm</groupId>
- <artifactId>camunda-engine</artifactId>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- Using the `DefaultEjbProcessApplication` result in: `java.sql.SQLException:
- You cannot commit during a managed transaction!` -->
- <dependency>
- <!-- CDI integration, needs to be included in WAR, otherwise CDI can not
- work correctly -->
- <groupId>org.camunda.bpm</groupId>
- <artifactId>camunda-engine-cdi</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.camunda.bpm.extension</groupId>
- <artifactId>camunda-bpm-assert</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.10.19</version>
- <scope>test</scope>
- </dependency>
-
- <!-- Spin dataformat support, in compile scope to include it in the war
- file -->
- <dependency>
- <groupId>org.camunda.spin</groupId>
- <artifactId>camunda-spin-dataformat-all</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.camunda.bpm</groupId>
- <artifactId>camunda-engine-plugin-spin</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.camunda.bpm</groupId>
- <artifactId>camunda-engine-plugin-connect</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <!-- Bootstrap for styling via Webjars project -->
- <groupId>org.webjars</groupId>
- <artifactId>bootstrap</artifactId>
- <version>2.3.2</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-client</artifactId>
- <version>3.0.19.Final</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <!-- Needed for InMemoryH2Test -->
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.uuid</groupId>
- <artifactId>java-uuid-generator</artifactId>
- </dependency>
- <dependency>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy-all</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>3.4</version>
- </dependency>
- <dependency>
- <groupId>org.openecomp.so</groupId>
- <artifactId>MSOCoreBPMN</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <!-- unit test utilities -->
- <groupId>org.openecomp.so</groupId>
- <artifactId>MSOCoreBPMN</artifactId>
- <version>${project.version}</version>
- <classifier>tests</classifier>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.openecomp.so</groupId>
- <artifactId>common</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>javax.ws.rs-api</artifactId>
- <version>2.0</version>
- </dependency>
- <!-- for encoding the url the same way A&AI does -->
- <dependency>
- <groupId>org.openecomp.so</groupId>
- <artifactId>MSOMockServer</artifactId>
- <version>${project.version}</version>
- <classifier>classes</classifier>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.openecomp.so</groupId>
- <artifactId>MSORESTClient</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <version>3.0.1</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.github.tomakehurst</groupId>
- <artifactId>wiremock</artifactId>
- <version>1.56</version>
- <scope>test</scope>
- <classifier>standalone</classifier>
- <exclusions>
- <exclusion>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.skyscreamer</groupId>
- <artifactId>jsonassert</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xmlunit</groupId>
- <artifactId>xmlunit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.jayway.jsonpath</groupId>
- <artifactId>json-path</artifactId>
- </exclusion>
- <exclusion>
- <groupId>net.sf.jopt-simple</groupId>
- <artifactId>jopt-simple</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.camunda.bpm</groupId>
- <artifactId>camunda-engine-spring</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- <version>4.3.2.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- <version>2.8.7</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- <version>2.8.7</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.module</groupId>
- <artifactId>jackson-module-jaxb-annotations</artifactId>
- <version>2.4.0</version>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- <version>1.6.12</version>
- </dependency>
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>${httpclient.version}</version>
- </dependency>
- <dependency>
- <groupId>org.openecomp.appc.client</groupId>
- <artifactId>client-kit</artifactId>
- <version>1.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.openecomp.appc.client</groupId>
- <artifactId>client-lib</artifactId>
- <version>1.1.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.onap.aai.aai-common</groupId>
- <artifactId>aai-schema</artifactId>
- <version>1.1.0</version>
- </dependency>
-
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.8.7</version>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.10.19</version>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.6</version>
- </dependency>
- <dependency>
- <groupId>com.openpojo</groupId>
- <artifactId>openpojo</artifactId>
- <version>0.8.6</version>
- </dependency>
- <dependency>
- <groupId>com.jayway.jsonpath</groupId>
- <artifactId>json-path</artifactId>
- <version>2.2.0</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- </dependency>
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>${httpclient.version}</version>
- </dependency>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>javax.ws.rs-api</artifactId>
- <version>${jax.ws.rs}</version>
- </dependency>
-
- <dependency>
- <groupId>org.openecomp.appc.client</groupId>
- <artifactId>client-kit</artifactId>
- <version>1.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.openecomp.appc.client</groupId>
- <artifactId>client-lib</artifactId>
- <version>1.1.0</version>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.8.7</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- <version>2.8.7</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.module</groupId>
- <artifactId>jackson-module-jaxb-annotations</artifactId>
- <version>2.4.0</version>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- <version>1.6.12</version>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.10.19</version>
- </dependency>
- <dependency>
- <groupId>com.att.nsa</groupId>
- <artifactId>dmaapClient</artifactId>
- <version>0.2.12</version>
- </dependency>
- <dependency>
- <!-- Optional Plugin for Camunda BPM Workbench -->
- <groupId>org.camunda.bpm.workbench</groupId>
- <artifactId>camunda-workbench-dist-embeddable</artifactId>
- <version>1.0.0-alpha8</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-jackson2-provider</artifactId>
- <version>3.0.11.Final</version>
- </dependency>
-
- </dependencies>
-</project>
+<?xml version="1.0"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.openecomp.so</groupId>
+ <artifactId>bpmn</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>MSOCommonBPMN</artifactId>
+ <name>MSOCommonBPMN</name>
+ <packaging>jar</packaging>
+
+ <properties>
+ <camunda.version>7.6.0</camunda.version>
+ <spring.version>4.3.2.RELEASE</spring.version>
+ <httpclient.version>3.1</httpclient.version>
+ <jax.ws.rs>2.0.1</jax.ws.rs>
+ <jackson.version>1.1.1</jackson.version>
+ <maven.compiler.target>1.8</maven.compiler.target>
+ <maven.compiler.source>1.8</maven.compiler.source>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>test-compile</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>testCompile</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.0.2</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-codegen-plugin</artifactId>
+ <version>2.5.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.8</version>
+ <configuration>
+ <additionalProjectnatures>
+ <projectnature>org.eclipse.jdt.groovy.core.groovyNature</projectnature>
+ </additionalProjectnatures>
+ <sourceIncludes>
+ <sourceInclude>**/*.groovy</sourceInclude>
+ </sourceIncludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>compile</id>
+ <phase>compile</phase>
+ <configuration>
+ <tasks>
+ <mkdir dir="${basedir}/src/main/groovy" />
+ <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc">
+ <classpath refid="maven.compile.classpath" />
+ </taskdef>
+ <mkdir dir="${project.build.outputDirectory}" />
+ <groovyc destdir="${project.build.outputDirectory}"
+ srcdir="${basedir}/src/main/groovy/" listfiles="true">
+ <classpath refid="maven.compile.classpath" />
+ </groovyc>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>test-compile</id>
+ <phase>test-compile</phase>
+ <configuration>
+ <tasks>
+ <mkdir dir="${basedir}/src/test/groovy" />
+ <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc">
+ <classpath refid="maven.test.classpath" />
+ </taskdef>
+ <mkdir dir="${project.build.testOutputDirectory}" />
+ <groovyc destdir="${project.build.testOutputDirectory}"
+ srcdir="${basedir}/src/test/groovy/" listfiles="true">
+ <classpath refid="maven.test.classpath" />
+ </groovyc>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jaxb2-maven-plugin</artifactId>
+ <version>2.3</version>
+ <executions>
+ <execution>
+ <id>xjc</id>
+ <goals>
+ <goal>xjc</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <extension>true</extension>
+ <arguments>
+ <argument>-Xannotate</argument>
+ <argument>-Xcommons-lang</argument>
+ </arguments>
+ <sources>
+ <source>src/main/resources/xsd</source>
+ </sources>
+ <xjbSources>
+ <xjbSource>src/main/resources/xjb</xjbSource>
+ </xjbSources>
+ <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.jvnet.jaxb2_commons</groupId>
+ <artifactId>jaxb2-basics-annotate</artifactId>
+ <version>0.6.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jvnet.jaxb2_commons</groupId>
+ <artifactId>jaxb2-commons-lang</artifactId>
+ <version>2.3</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.codemodel</groupId>
+ <artifactId>codemodel</artifactId>
+ <version>2.6</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings
+ only. It has no influence on the Maven build itself. -->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>
+ org.apache.maven.plugins
+ </groupId>
+ <artifactId>
+ maven-antrun-plugin
+ </artifactId>
+ <versionRange>
+ [1.3,)
+ </versionRange>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.camunda.bpm</groupId>
+ <artifactId>camunda-engine</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.camunda.bpm</groupId>
+ <artifactId>camunda-engine-cdi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.camunda.bpm.extension</groupId>
+ <artifactId>camunda-bpm-assert</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.10.19</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.camunda.spin</groupId>
+ <artifactId>camunda-spin-dataformat-all</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.camunda.bpm</groupId>
+ <artifactId>camunda-engine-plugin-spin</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.camunda.bpm</groupId>
+ <artifactId>camunda-engine-plugin-connect</artifactId>
+ </dependency>
+ <dependency>
+ <!-- Bootstrap for styling via Webjars project -->
+ <groupId>org.webjars</groupId>
+ <artifactId>bootstrap</artifactId>
+ <version>2.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-client</artifactId>
+ <version>3.0.19.Final</version>
+ </dependency>
+ <dependency>
+ <!-- Needed for InMemoryH2Test -->
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.uuid</groupId>
+ <artifactId>java-uuid-generator</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.so</groupId>
+ <artifactId>MSOCoreBPMN</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <!-- unit test utilities -->
+ <groupId>org.openecomp.so</groupId>
+ <artifactId>MSOCoreBPMN</artifactId>
+ <version>${project.version}</version>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.so</groupId>
+ <artifactId>common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.so</groupId>
+ <artifactId>MSORESTClient</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.github.tomakehurst</groupId>
+ <artifactId>wiremock</artifactId>
+ <version>1.56</version>
+ <scope>test</scope>
+ <classifier>standalone</classifier>
+ <exclusions>
+ <exclusion>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.skyscreamer</groupId>
+ <artifactId>jsonassert</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xmlunit</groupId>
+ <artifactId>xmlunit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.jayway.jsonpath</groupId>
+ <artifactId>json-path</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>net.sf.jopt-simple</groupId>
+ <artifactId>jopt-simple</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.camunda.bpm</groupId>
+ <artifactId>camunda-engine-spring</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>4.3.2.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>2.8.7</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ <version>2.8.7</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.module</groupId>
+ <artifactId>jackson-module-jaxb-annotations</artifactId>
+ <version>2.4.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>1.6.12</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>${httpclient.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.appc.client</groupId>
+ <artifactId>client-kit</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.appc.client</groupId>
+ <artifactId>client-lib</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.aai.aai-common</groupId>
+ <artifactId>aai-schema</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>2.8.7</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.10.19</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.6</version>
+ </dependency>
+ <dependency>
+ <groupId>com.openpojo</groupId>
+ <artifactId>openpojo</artifactId>
+ <version>0.8.6</version>
+ </dependency>
+ <dependency>
+ <groupId>com.jayway.jsonpath</groupId>
+ <artifactId>json-path</artifactId>
+ <version>2.2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>${httpclient.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>${jax.ws.rs}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.appc.client</groupId>
+ <artifactId>client-kit</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.appc.client</groupId>
+ <artifactId>client-lib</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>2.8.7</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>2.8.7</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.module</groupId>
+ <artifactId>jackson-module-jaxb-annotations</artifactId>
+ <version>2.4.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>1.6.12</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.10.19</version>
+ </dependency>
+ <dependency>
+ <groupId>com.att.nsa</groupId>
+ <artifactId>dmaapClient</artifactId>
+ <version>0.2.12</version>
+ </dependency>
+ <dependency>
+ <!-- Optional Plugin for Camunda BPM Workbench -->
+ <groupId>org.camunda.bpm.workbench</groupId>
+ <artifactId>camunda-workbench-dist-embeddable</artifactId>
+ <version>1.0.0-alpha8</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jackson2-provider</artifactId>
+ <version>3.0.11.Final</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>22.0</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/MSOCommonApplication.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/MSOCommonApplication.java
deleted file mode 100644
index 3e8fd6ee05..0000000000
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/MSOCommonApplication.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package org.openecomp.mso.bpmn.common;
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T 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=========================================================
- */
-
-
-
-import java.util.List;
-
-import org.camunda.bpm.application.PostDeploy;
-import org.camunda.bpm.application.PreUndeploy;
-import org.camunda.bpm.application.ProcessApplication;
-import org.camunda.bpm.application.ProcessApplicationInfo;
-import org.camunda.bpm.application.impl.ServletProcessApplication;
-import org.camunda.bpm.engine.ProcessEngine;
-
-import org.openecomp.mso.logger.MsoLogger;
-
-/**
- * @since Version 1.0
- *
- */
-@ProcessApplication(name="MSO Common Application", deploymentDescriptors={"../processes.xml"})
-public class MSOCommonApplication extends ServletProcessApplication {
-
- private MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
-
- @PostDeploy
- public void postDeploy(ProcessEngine processEngineInstance) {
- long startTime = System.currentTimeMillis();
-
- msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Post deployment complete...");
- }
-
- @PreUndeploy
- public void cleanup(ProcessEngine processEngine, ProcessApplicationInfo processApplicationInfo, List<ProcessEngine> processEngines) {
- long startTime = System.currentTimeMillis();
-
- msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Pre Undeploy complete...");
-
- }
-
-}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java
index c0be8992ef..d65311dfe8 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java
@@ -26,8 +26,6 @@ import java.util.List;
import java.util.Map;
import org.camunda.bpm.engine.MismatchingMessageCorrelationException;
-import org.camunda.bpm.engine.ProcessEngineServices;
-import org.camunda.bpm.engine.ProcessEngines;
import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.runtime.Execution;
import org.camunda.bpm.engine.runtime.MessageCorrelationResult;
@@ -38,7 +36,7 @@ import org.openecomp.mso.logger.MsoLogger;
/**
* Abstract base class for callback services.
*/
-public abstract class AbstractCallbackService {
+public abstract class AbstractCallbackService extends ProcessEngineAwareService {
public static final long DEFAULT_TIMEOUT_SECONDS = 60;
public static final long FAST_POLL_DUR_SECONDS = 5;
public static final long FAST_POLL_INT_MS = 100;
@@ -46,8 +44,6 @@ public abstract class AbstractCallbackService {
private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
- protected volatile ProcessEngineServices pes4junit = null;
-
/**
* Parameterized callback handler.
*/
@@ -368,16 +364,4 @@ public abstract class AbstractCallbackService {
+ ":" + execution.getId() + "]";
}
}
-
- protected ProcessEngineServices getProcessEngineServices() {
- if (pes4junit == null) {
- return ProcessEngines.getProcessEngine("infrastructure");
- } else {
- return pes4junit;
- }
- }
-
- public void setProcessEngineServices4junit(ProcessEngineServices pes) {
- pes4junit = pes;
- }
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/ProcessEngineAwareService.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/ProcessEngineAwareService.java
new file mode 100644
index 0000000000..dbb6674a64
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/ProcessEngineAwareService.java
@@ -0,0 +1,64 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.openecomp.mso.bpmn.common.workflow.service;
+
+import java.util.Optional;
+
+import org.camunda.bpm.engine.ProcessEngineServices;
+import org.camunda.bpm.engine.ProcessEngines;
+
+/**
+ * Base class for services that must be process-engine aware. The only
+ * process engine currently supported is the "default" process engine.
+ */
+public class ProcessEngineAwareService {
+
+ private final String processEngineName = "default";
+ private volatile Optional<ProcessEngineServices> pes4junit = Optional.empty();
+
+ /**
+ * Gets the process engine name.
+ * @return the process engine name
+ */
+ public String getProcessEngineName() {
+ return processEngineName;
+ }
+
+ /**
+ * Gets process engine services.
+ * @return process engine services
+ */
+ public ProcessEngineServices getProcessEngineServices() {
+ return pes4junit.orElse(ProcessEngines.getProcessEngine(
+ getProcessEngineName()));
+ }
+
+ /**
+ * Allows a particular process engine to be specified, overriding the
+ * usual process engine lookup by name. Intended primarily for the
+ * unit test environment.
+ * @param pes process engine services
+ */
+ public void setProcessEngineServices4junit(ProcessEngineServices pes) {
+ pes4junit = Optional.ofNullable(pes);
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/SDNCAdapterCallbackServiceImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/SDNCAdapterCallbackServiceImpl.java
index 2186e071f4..c5f0d02dff 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/SDNCAdapterCallbackServiceImpl.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/SDNCAdapterCallbackServiceImpl.java
@@ -20,9 +20,6 @@
package org.openecomp.mso.bpmn.common.workflow.service;
-import java.util.HashMap;
-import java.util.Map;
-
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
@@ -30,16 +27,9 @@ import javax.jws.WebService;
import javax.ws.rs.core.Context;
import javax.xml.ws.WebServiceContext;
-import org.camunda.bpm.BpmPlatform;
-import org.camunda.bpm.engine.MismatchingMessageCorrelationException;
-import org.camunda.bpm.engine.ProcessEngineServices;
-import org.camunda.bpm.engine.RuntimeService;
-import org.camunda.bpm.engine.runtime.ExecutionQuery;
import org.openecomp.mso.bpmn.common.adapter.sdnc.SDNCAdapterCallbackRequest;
import org.openecomp.mso.bpmn.common.adapter.sdnc.SDNCAdapterResponse;
import org.openecomp.mso.bpmn.common.adapter.sdnc.SDNCCallbackAdapterPortType;
-import org.openecomp.mso.bpmn.core.PropertyConfiguration;
-import org.openecomp.mso.logger.MessageEnum;
import org.openecomp.mso.logger.MsoLogger;
/**
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java
index 99909b68a0..608adcf756 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java
@@ -53,7 +53,7 @@ import org.slf4j.MDC;
* For asynchronous process - the activity may send a acknowledgement response and then proceed further on executing the process
*/
@Path("/async")
-public abstract class WorkflowAsyncResource {
+public class WorkflowAsyncResource extends ProcessEngineAwareService {
private static final WorkflowContextHolder contextHolder = WorkflowContextHolder.getInstance();
protected Optional<ProcessEngineServices> pes4junit = Optional.empty();
@@ -274,12 +274,6 @@ public abstract class WorkflowAsyncResource {
}
- protected abstract ProcessEngineServices getProcessEngineServices();
-
- public void setProcessEngineServices4junit(ProcessEngineServices pes) {
- pes4junit = Optional.ofNullable(pes);
- }
-
private static Map<String, Object> getInputVariables(VariableMapImpl variableMap) {
Map<String, Object> inputVariables = new HashMap<>();
@SuppressWarnings("unchecked")
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java
index 0521fb4df3..76ff221018 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java
@@ -39,7 +39,6 @@ import javax.ws.rs.core.UriInfo;
import org.camunda.bpm.engine.HistoryService;
import org.camunda.bpm.engine.ProcessEngineException;
import org.camunda.bpm.engine.ProcessEngineServices;
-import org.camunda.bpm.engine.ProcessEngines;
import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.history.HistoricVariableInstance;
import org.camunda.bpm.engine.runtime.ProcessInstance;
@@ -53,10 +52,8 @@ import org.openecomp.mso.logger.MsoLogger;
import org.slf4j.MDC;
@Path("/workflow")
-public class WorkflowResource {
+public class WorkflowResource extends ProcessEngineAwareService {
- private ProcessEngineServices pes4junit = null;
-
private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
private static final String LOGMARKER = "[WRKFLOW-RESOURCE]";
@@ -615,16 +612,4 @@ public class WorkflowResource {
return response;
}
-
- private ProcessEngineServices getProcessEngineServices() {
- if (pes4junit == null) {
- return ProcessEngines.getProcessEngine("infrastructure");
- } else {
- return pes4junit;
- }
- }
-
- public void setProcessEngineServices4junit(ProcessEngineServices pes) {
- pes4junit = pes;
- }
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResourceApplication.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResourceApplication.java
index 4f99edd660..193b8fe903 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResourceApplication.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResourceApplication.java
@@ -26,23 +26,12 @@ import java.util.Set;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowMessageResource;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResource;
-
-/**
- * @version 1.0
- * RESTeasy workflow application which wires synchronous and asynchronous response
- *
- */
@ApplicationPath("/")
public class WorkflowResourceApplication extends Application {
private Set<Object> singletons = new HashSet<Object>();
private Set<Class<?>> classes = new HashSet<Class<?>>();
public WorkflowResourceApplication() {
- singletons.add(new WorkflowResource());
- singletons.add(new WorkflowAsyncCommonResource());
- singletons.add(new WorkflowMessageResource());
}
@Override
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/PreconditionFailedException.java
index 4534b56efc..df28baac74 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/PreconditionFailedException.java
@@ -1,32 +1,35 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T 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.openecomp.mso.bpmn.common.workflow.service;
-
-import org.camunda.bpm.engine.ProcessEngineServices;
-import org.camunda.bpm.engine.ProcessEngines;
-
-
-public class WorkflowAsyncCommonResource extends WorkflowAsyncResource {
-
- protected ProcessEngineServices getProcessEngineServices() {
- return pes4junit.orElse(ProcessEngines.getProcessEngine("infrastructure"));
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+
+public class PreconditionFailedException extends WebApplicationException {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ public PreconditionFailedException(String message) {
+ super(message, Response.Status.PRECONDITION_FAILED);
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/ResponseExceptionMapper.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/ResponseExceptionMapper.java
new file mode 100644
index 0000000000..e0e3e936be
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/ResponseExceptionMapper.java
@@ -0,0 +1,98 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Optional;
+
+import javax.annotation.Priority;
+import javax.ws.rs.BadRequestException;
+import javax.ws.rs.ForbiddenException;
+import javax.ws.rs.InternalServerErrorException;
+import javax.ws.rs.NotAcceptableException;
+import javax.ws.rs.NotAllowedException;
+import javax.ws.rs.NotAuthorizedException;
+import javax.ws.rs.NotFoundException;
+import javax.ws.rs.NotSupportedException;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.client.ClientRequestContext;
+import javax.ws.rs.client.ClientResponseContext;
+import javax.ws.rs.client.ClientResponseFilter;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.Provider;
+
+@Provider
+@Priority(value = 1)
+public abstract class ResponseExceptionMapper implements ClientResponseFilter {
+
+ @Override
+ public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {
+ if (responseContext.getStatus() >= 300) {
+ String message = "empty message";
+ if (responseContext.hasEntity()) {
+ Optional<String> result = this.extractMessage(responseContext.getEntityStream());
+ if (result.isPresent()) {
+ message = result.get();
+ }
+ }
+ Response.Status status = Response.Status.fromStatusCode(responseContext.getStatus());
+ WebApplicationException webAppException;
+ switch (status) {
+ case BAD_REQUEST:
+ webAppException = new BadRequestException(message);
+ break;
+ case UNAUTHORIZED:
+ webAppException = new NotAuthorizedException(message);
+ break;
+ case FORBIDDEN:
+ webAppException = new ForbiddenException(message);
+ break;
+ case NOT_FOUND:
+ webAppException = new NotFoundException(message);
+ break;
+ case METHOD_NOT_ALLOWED:
+ webAppException = new NotAllowedException(message);
+ break;
+ case NOT_ACCEPTABLE:
+ webAppException = new NotAcceptableException(message);
+ break;
+ case PRECONDITION_FAILED:
+ webAppException = new PreconditionFailedException(message);
+ break;
+ case UNSUPPORTED_MEDIA_TYPE:
+ webAppException = new NotSupportedException(message);
+ break;
+ case INTERNAL_SERVER_ERROR:
+ webAppException = new InternalServerErrorException(message);
+ break;
+ case SERVICE_UNAVAILABLE:
+ webAppException = new WebApplicationException(message);
+ break;
+ default:
+ webAppException = new WebApplicationException(message);
+ }
+ throw webAppException;
+ }
+ }
+
+ public abstract Optional<String> extractMessage(InputStream stream) throws IOException;
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/ResponseExceptionMapperImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/ResponseExceptionMapperImpl.java
new file mode 100644
index 0000000000..0845a2fbcd
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/ResponseExceptionMapperImpl.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Optional;
+
+import org.apache.commons.io.IOUtils;
+
+public class ResponseExceptionMapperImpl extends ResponseExceptionMapper {
+
+ @Override
+ public Optional<String> extractMessage(InputStream stream) throws IOException {
+ final String input = IOUtils.toString(stream, "UTF-8");
+ IOUtils.closeQuietly(stream);
+ return Optional.of(input);
+ }
+
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/RestProperties.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/RestProperties.java
new file mode 100644
index 0000000000..ae8862de5e
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/RestProperties.java
@@ -0,0 +1,30 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+public interface RestProperties {
+
+ public URL getEndpoint() throws MalformedURLException;
+ public String getSystemName();
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/RestPropertiesLoader.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/RestPropertiesLoader.java
new file mode 100644
index 0000000000..6d49d9800f
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/RestPropertiesLoader.java
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client;
+
+import java.util.Iterator;
+import java.util.ServiceLoader;
+
+public class RestPropertiesLoader {
+
+ private final ServiceLoader<RestProperties> services;
+ private RestPropertiesLoader() {
+ services = ServiceLoader.load(RestProperties.class);
+ }
+
+ private static class Helper {
+ private static final RestPropertiesLoader INSTANCE = new RestPropertiesLoader();
+ }
+
+ public static RestPropertiesLoader getInstance() {
+ return Helper.INSTANCE;
+ }
+
+ public <T> T getImpl(Class<? extends RestProperties> clazz) {
+ T result = null;
+ Iterator<RestProperties> propertyImpls = services.iterator();
+ RestProperties item;
+ while (propertyImpls.hasNext()) {
+ item = propertyImpls.next();
+ if (clazz.isAssignableFrom(item.getClass())) {
+ result = (T)item;
+ break;
+ }
+ }
+
+ return result;
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/Consumer.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/Consumer.java
index f1bafde997..0e00ae5da8 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/Consumer.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/Consumer.java
@@ -22,33 +22,5 @@ package org.openecomp.mso.client.dmaap;
public interface Consumer {
- /**
- * Should this consumer continue to consume messages from the topic?
- * @return
- */
- public boolean continuePolling();
- /**
- * Process a message from a DMaaP topic
- *
- * @param message
- * @throws Exception
- */
- public void processMessage(String message) throws Exception;
- /**
- * Has the request been accepted by the receiving system?
- * Should the consumer move to processing messages?
- *
- * @param message
- * @return
- */
- public boolean isAccepted(String message);
- /**
- * The request id to filter messages on
- * @return
- */
- public String getRequestId();
- /**
- * Logic that defines when the consumer should stop processing messages
- */
- public void stopProcessingMessages();
+ public Iterable<String> fetch();
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DefaultDmaapPropertiesImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DefaultDmaapPropertiesImpl.java
new file mode 100644
index 0000000000..9af1fd3f7e
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DefaultDmaapPropertiesImpl.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client.dmaap;
+
+import java.util.Map;
+
+import org.openecomp.mso.bpmn.core.PropertyConfiguration;
+
+public class DefaultDmaapPropertiesImpl implements DmaapProperties {
+
+ private final Map<String, String> properties;
+ public DefaultDmaapPropertiesImpl() {
+ this.properties = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties");
+ }
+ @Override
+ public Map<String, String> getProperties() {
+ return this.properties;
+ }
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapClient.java
new file mode 100644
index 0000000000..7862c9d41d
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapClient.java
@@ -0,0 +1,68 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client.dmaap;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Base64;
+import java.util.Map;
+import java.util.Properties;
+
+import org.openecomp.mso.bpmn.core.PropertyConfiguration;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+public abstract class DmaapClient {
+
+ protected final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
+ protected final Map<String, String> msoProperties;
+ protected final Properties properties;
+ public DmaapClient(String filepath) throws FileNotFoundException, IOException {
+ Resource resource = new ClassPathResource(filepath);
+ DmaapProperties dmaapProperties = DmaapPropertiesLoader.getInstance().getImpl();
+ if (dmaapProperties == null) {
+ dmaapProperties = new DefaultDmaapPropertiesImpl();
+ }
+ this.msoProperties = dmaapProperties.getProperties();
+ this.properties = new Properties();
+ this.properties.load(resource.getInputStream());
+ this.properties.put("password", this.deobfuscatePassword(this.getPassword()));
+ this.properties.put("username", this.getUserName());
+ this.properties.put("topic", this.getTopic());
+ }
+ protected String deobfuscatePassword(String password) {
+
+ try {
+ return new String(Base64.getDecoder().decode(password.getBytes()));
+ } catch(IllegalArgumentException iae) {
+
+ return password;
+ }
+ }
+
+
+ public abstract String getUserName();
+ public abstract String getPassword();
+ public abstract String getTopic();
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapConsumer.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapConsumer.java
index 2a618763ff..033951612d 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapConsumer.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapConsumer.java
@@ -22,39 +22,110 @@ package org.openecomp.mso.client.dmaap;
import java.io.FileNotFoundException;
import java.io.IOException;
+import java.util.concurrent.TimeUnit;
-import com.att.nsa.mr.client.MRClientFactory;
-import com.att.nsa.mr.client.MRConsumer;
+import org.openecomp.mso.client.dmaap.exceptions.DMaaPConsumerFailure;
+import org.openecomp.mso.client.dmaap.exceptions.ExceededMaximumPollingTime;
+import org.openecomp.mso.client.dmaap.rest.RestConsumer;
-public class DmaapConsumer {
+import com.google.common.base.Stopwatch;
- private final MRConsumer mrConsumer;
- public DmaapConsumer() {
- mrConsumer = null;
- }
- public DmaapConsumer (String filepath) throws FileNotFoundException, IOException {
-
- mrConsumer = MRClientFactory.createConsumer(filepath);
+public abstract class DmaapConsumer extends DmaapClient {
+
+ public DmaapConsumer() throws FileNotFoundException, IOException {
+ super("dmaap/default-consumer.properties");
}
-
- public MRConsumer getMRConsumer() {
- return mrConsumer;
+ public Consumer getConsumer() throws FileNotFoundException, IOException {
+ return new RestConsumer(this.properties);
}
- public boolean consume(Consumer consumer) throws Exception {
+ public boolean consume() throws Exception {
+
+ Consumer mrConsumer = this.getConsumer();
+ int iterations = 0;
boolean accepted = false;
- while (consumer.continuePolling()) {
- for (String message : this.getMRConsumer().fetch()) {
- if (!accepted && consumer.isAccepted(message)) {
- accepted = true;
- }
- if (accepted) {
- consumer.processMessage(message);
+ Stopwatch stopwatch = Stopwatch.createUnstarted();
+ try {
+ while (this.continuePolling()) {
+ if (stopwatch.elapsed(TimeUnit.MILLISECONDS) >= this.getMaximumElapsedTime()) {
+ final String message = "exceeded maximum retries on " + this.getRequestId() + " on " + this.getTopic();
+ auditLogger.error(message);
+ throw new ExceededMaximumPollingTime(message);
}
+ stopwatch.start();
+ Iterable<String> itr = mrConsumer.fetch();
+ stopwatch.stop();
+ for (String message : itr) {
+ if (!accepted && this.isAccepted(message)) {
+ auditLogger.info("accepted message found for " + this.getRequestId() + " on " + this.getTopic());
+ accepted = true;
+ }
+ if (accepted) {
+ if (this.isFailure(message)) {
+ this.stopProcessingMessages();
+ auditLogger.info("received dmaap message: " + message);
+ final String errorMsg = "failure received from dmaap topic " + this.getTopic();
+ auditLogger.error(errorMsg);
+ throw new DMaaPConsumerFailure(errorMsg);
+ } else {
+ auditLogger.info("received dmaap message: " + message);
+ this.processMessage(message);
+ }
+ }
+ }
+ iterations++;
+ }
+ return true;
+ } catch (Exception e ) {
+ throw e;
+ } finally {
+ if (stopwatch.isRunning()) {
+ stopwatch.stop();
}
}
-
- return true;
}
+ /**
+ * Should this consumer continue to consume messages from the topic?
+ * @return
+ */
+ public abstract boolean continuePolling();
+ /**
+ * Process a message from a DMaaP topic
+ *
+ * @param message
+ * @throws Exception
+ */
+ public abstract void processMessage(String message) throws Exception;
+ /**
+ * Has the request been accepted by the receiving system?
+ * Should the consumer move to processing messages?
+ *
+ * @param message
+ * @return
+ */
+ public abstract boolean isAccepted(String message);
+ /**
+ * has the request failed?
+ *
+ * @param message
+ * @return
+ */
+ public abstract boolean isFailure(String message);
+ /**
+ * The request id to filter messages on
+ * @return
+ */
+ public abstract String getRequestId();
+ /**
+ * Logic that defines when the consumer should stop processing messages
+ */
+ public abstract void stopProcessingMessages();
+
+ /**
+ * time in milliseconds
+ */
+ public int getMaximumElapsedTime() {
+ return 180000;
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapProperties.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapProperties.java
new file mode 100644
index 0000000000..7bdd7dfe40
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapProperties.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client.dmaap;
+
+import java.util.Map;
+
+public interface DmaapProperties {
+
+ /**
+ * A map of strings which contains the properties for a dmaap client
+ * @return
+ */
+ public Map<String, String> getProperties();
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPropertiesLoader.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPropertiesLoader.java
new file mode 100644
index 0000000000..a21dbe8477
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPropertiesLoader.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client.dmaap;
+
+import java.util.Iterator;
+import java.util.ServiceLoader;
+
+public class DmaapPropertiesLoader {
+
+ private final ServiceLoader<DmaapProperties> services;
+ private DmaapPropertiesLoader() {
+ services = ServiceLoader.load(DmaapProperties.class);
+ }
+
+ private static class Helper {
+ private static final DmaapPropertiesLoader INSTANCE = new DmaapPropertiesLoader();
+ }
+
+ public static DmaapPropertiesLoader getInstance() {
+ return Helper.INSTANCE;
+ }
+
+ public DmaapProperties getImpl() {
+ Iterator<DmaapProperties> propertyImpls = services.iterator();
+ while (propertyImpls.hasNext()) {
+ return propertyImpls.next();
+ }
+
+ return null;
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPublisher.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPublisher.java
index 4d70a16b73..d2752c531b 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPublisher.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPublisher.java
@@ -22,29 +22,30 @@ package org.openecomp.mso.client.dmaap;
import java.io.FileNotFoundException;
import java.io.IOException;
-import java.util.concurrent.TimeUnit;
-import com.att.nsa.mr.client.MRBatchingPublisher;
-import com.att.nsa.mr.client.MRClientFactory;
+import org.openecomp.mso.client.dmaap.rest.RestPublisher;
-public class DmaapPublisher {
+public abstract class DmaapPublisher extends DmaapClient {
- private final long seconds;
- private final MRBatchingPublisher publisher;
-
- public DmaapPublisher(String filepath) throws FileNotFoundException, IOException {
+ private long seconds;
+ private final Publisher publisher;
+ public DmaapPublisher() throws FileNotFoundException, IOException {
+ super("dmaap/default-consumer.properties");
+ this.publisher = new RestPublisher(properties);
this.seconds = 20;
- this.publisher = MRClientFactory.createBatchingPublisher(filepath);
+
}
- public DmaapPublisher(String filepath, long seconds) throws FileNotFoundException, IOException {
+ public DmaapPublisher(long seconds) throws FileNotFoundException, IOException {
+ this();
this.seconds = seconds;
- this.publisher = MRClientFactory.createBatchingPublisher(filepath);
}
public void send(String json) throws IOException, InterruptedException {
+ auditLogger.info("publishing message to dmaap topic " + this.getTopic() + ": " + json);
publisher.send(json);
- publisher.close(seconds, TimeUnit.SECONDS);
+ //publisher.close(seconds, TimeUnit.SECONDS);
}
+
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/Publisher.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/Publisher.java
new file mode 100644
index 0000000000..d89ee6e5c6
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/Publisher.java
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client.dmaap;
+
+public interface Publisher {
+
+ public void send(String json);
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/exceptions/DMaaPConsumerFailure.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/exceptions/DMaaPConsumerFailure.java
new file mode 100644
index 0000000000..29472b2180
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/exceptions/DMaaPConsumerFailure.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client.dmaap.exceptions;
+
+public class DMaaPConsumerFailure extends Exception {
+
+ private static final long serialVersionUID = 2499229901897110362L;
+
+ public DMaaPConsumerFailure() {
+ super();
+ }
+
+ public DMaaPConsumerFailure(String message) {
+ super(message);
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/exceptions/ExceededMaximumPollingTime.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/exceptions/ExceededMaximumPollingTime.java
new file mode 100644
index 0000000000..c9d675067e
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/exceptions/ExceededMaximumPollingTime.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client.dmaap.exceptions;
+
+public class ExceededMaximumPollingTime extends RuntimeException {
+
+ private static final long serialVersionUID = 2331207691092906423L;
+
+ public ExceededMaximumPollingTime() {
+ super();
+ }
+
+ public ExceededMaximumPollingTime(String message) {
+ super(message);
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/DMaaPRestClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/DMaaPRestClient.java
new file mode 100644
index 0000000000..124e2c3a28
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/DMaaPRestClient.java
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client.dmaap.rest;
+
+import java.net.URL;
+import java.util.Base64;
+import java.util.Map;
+import java.util.Optional;
+
+import javax.ws.rs.client.ClientResponseFilter;
+
+import org.openecomp.mso.client.ResponseExceptionMapperImpl;
+import org.openecomp.mso.client.policy.RestClient;
+
+public class DMaaPRestClient extends RestClient {
+
+ private final String username;
+ private final String password;
+ public DMaaPRestClient(URL url, String contentType, String username, String password) {
+ super(url, contentType);
+ this.username = username;
+ this.password = password;
+ }
+
+ @Override
+ protected void initializeHeaderMap(Map<String, String> headerMap) {
+ headerMap.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(new String(username + ":" + password).getBytes()));
+ }
+
+ @Override
+ protected Optional<ClientResponseFilter> addResponseFilter() {
+ return Optional.of(new ResponseExceptionMapperImpl());
+ }
+
+ @Override
+ public RestClient addRequestId(String requestId) {
+ return null;
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/PropertiesBean.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/PropertiesBean.java
new file mode 100644
index 0000000000..fb914a0c13
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/PropertiesBean.java
@@ -0,0 +1,131 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client.dmaap.rest;
+
+import java.util.Properties;
+
+public class PropertiesBean {
+
+ private String username;
+ private String password;
+ private String environment;
+ private String partition;
+ private String contentType;
+ private String host;
+ private String topic;
+ private String timeout;
+
+
+ public PropertiesBean(Properties properties) {
+ this.withUsername(properties.getProperty("username"))
+ .withPassword(properties.getProperty("password"))
+ .withTopic(properties.getProperty("topic"))
+ .withEnvironment(properties.getProperty("environment"))
+ .withHost(properties.getProperty("host"))
+ .withTimeout(properties.getProperty("timeout", "20000"))
+ .withPartition(properties.getProperty("partition"))
+ .withContentType(properties.getProperty("contentType", "application/json"));
+ }
+ public String getUsername() {
+ return username;
+ }
+ public void setUsername(String username) {
+ this.username = username;
+ }
+ public PropertiesBean withUsername(String username) {
+ this.username = username;
+ return this;
+ }
+ public String getPassword() {
+ return password;
+ }
+ public void setPassword(String password) {
+ this.password = password;
+ }
+ public PropertiesBean withPassword(String password) {
+ this.password = password;
+ return this;
+ }
+ public String getEnvironment() {
+ return environment;
+ }
+ public void setEnvironment(String environment) {
+ this.environment = environment;
+ }
+ public PropertiesBean withEnvironment(String environment) {
+ this.environment = environment;
+ return this;
+ }
+ public String getPartition() {
+ return partition;
+ }
+ public void setPartition(String partition) {
+ this.partition = partition;
+ }
+ public PropertiesBean withPartition(String partition) {
+ this.partition = partition;
+ return this;
+ }
+ public String getContentType() {
+ return contentType;
+ }
+ public void setContentType(String contentType) {
+ this.contentType = contentType;
+ }
+ public PropertiesBean withContentType(String contentType) {
+ this.contentType = contentType;
+ return this;
+ }
+ public String getHost() {
+ return host;
+ }
+ public void setHost(String host) {
+ this.host = host;
+ }
+ public PropertiesBean withHost(String host) {
+ this.host = host;
+ return this;
+ }
+ public String getTopic() {
+ return topic;
+ }
+ public void setTopic(String topic) {
+ this.topic = topic;
+ }
+ public PropertiesBean withTopic(String topic) {
+ this.topic = topic;
+ return this;
+ }
+ public String getTimeout() {
+ return timeout;
+ }
+ public void setTimeout(String timeout) {
+ this.timeout = timeout;
+ }
+ public PropertiesBean withTimeout(String timeout) {
+ this.timeout = timeout;
+ return this;
+ }
+
+
+
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/RestConsumer.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/RestConsumer.java
new file mode 100644
index 0000000000..ff199e2373
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/RestConsumer.java
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client.dmaap.rest;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+import java.util.Properties;
+
+import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.UriBuilder;
+
+import org.openecomp.mso.client.dmaap.Consumer;
+import org.openecomp.mso.client.policy.RestClient;
+
+public class RestConsumer implements Consumer {
+
+ private final RestClient client;
+ public RestConsumer(Properties properties) {
+ PropertiesBean bean = new PropertiesBean(properties);
+ client = new DMaaPRestClient(this.createURL(bean), bean.getContentType(), bean.getUsername(), bean.getPassword());
+ }
+
+ private URL createURL(PropertiesBean properties) {
+ try {
+ return UriBuilder.fromUri("http://" + properties.getHost())
+ .path("events").path(properties.getTopic())
+ .path(properties.getPartition())
+ .path("consumer1")
+ .queryParam("timeout", properties.getTimeout()).build().toURL();
+ } catch (MalformedURLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public Iterable<String> fetch() {
+
+ return client.get(new GenericType<List<String>>() {});
+ }
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/RestPublisher.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/RestPublisher.java
new file mode 100644
index 0000000000..e8e685932a
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/RestPublisher.java
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client.dmaap.rest;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Properties;
+
+import javax.ws.rs.core.UriBuilder;
+import javax.ws.rs.core.UriBuilderException;
+
+import org.openecomp.mso.client.dmaap.Publisher;
+import org.openecomp.mso.client.policy.RestClient;
+
+public class RestPublisher implements Publisher {
+
+ private final RestClient client;
+
+ public RestPublisher(Properties properties) {
+ PropertiesBean bean = new PropertiesBean(properties);
+ client = new DMaaPRestClient(this.createURL(bean), bean.getContentType(), bean.getUsername(), bean.getPassword());
+ }
+
+ private URL createURL(PropertiesBean properties) {
+ try {
+ return UriBuilder.fromUri("http://" + properties.getHost())
+ .path("events").path(properties.getTopic())
+ .queryParam("timeout", properties.getTimeout()).build().toURL();
+ } catch (MalformedURLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public void send(String json) {
+ client.post(json);
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java
index 665b9052eb..e02941944a 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java
@@ -1,130 +1,138 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T 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.openecomp.mso.client.policy;
-
-import java.io.BufferedInputStream;
-
-import java.io.ByteArrayOutputStream;
-import java.io.FilterOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-import java.util.logging.Logger;
-import javax.annotation.Priority;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.client.ClientRequestContext;
-import javax.ws.rs.client.ClientRequestFilter;
-import javax.ws.rs.client.ClientResponseContext;
-import javax.ws.rs.client.ClientResponseFilter;
-import javax.ws.rs.ext.WriterInterceptor;
-import javax.ws.rs.ext.WriterInterceptorContext;
-
-@Priority(Integer.MIN_VALUE)
-public class LoggingFilter implements ClientRequestFilter, ClientResponseFilter, WriterInterceptor {
-
- private static final Logger logger = Logger.getLogger(LoggingFilter.class.getName());
- private static final String ENTITY_STREAM_PROPERTY = "LoggingFilter.entityStream";
- private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;
- private final int maxEntitySize = 1024 * 8;
-
- private void log(StringBuilder sb) {
- logger.info(sb.toString());
- }
-
- private InputStream logInboundEntity(final StringBuilder b, InputStream stream, final Charset charset)
- throws IOException {
- InputStream inputStream = stream;
- if (!inputStream.markSupported()) {
- inputStream = new BufferedInputStream(inputStream);
- }
- inputStream.mark(maxEntitySize + 1);
- final byte[] entity = new byte[maxEntitySize + 1];
- final int entitySize = inputStream.read(entity);
- b.append(new String(entity, 0, Math.min(entitySize, maxEntitySize), charset));
- if (entitySize > maxEntitySize) {
- b.append("...more...");
- }
- b.append('\n');
- inputStream.reset();
- return inputStream;
- }
-
- @Override
- public void filter(ClientRequestContext requestContext) throws IOException {
- if (requestContext.hasEntity()) {
- final OutputStream stream = new LoggingStream(requestContext.getEntityStream());
- requestContext.setEntityStream(stream);
- requestContext.setProperty(ENTITY_STREAM_PROPERTY, stream);
- }
- }
-
- @Override
- public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {
- final StringBuilder sb = new StringBuilder();
- if (responseContext.hasEntity()) {
- responseContext.setEntityStream(logInboundEntity(sb, responseContext.getEntityStream(), DEFAULT_CHARSET));
- log(sb);
- }
-
- }
-
- @Override
- public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException {
- final LoggingStream stream = (LoggingStream) context.getProperty(ENTITY_STREAM_PROPERTY);
- context.proceed();
- if (stream != null) {
- log(stream.getStringBuilder(DEFAULT_CHARSET));
- }
- }
-
- private class LoggingStream extends FilterOutputStream {
-
- private final StringBuilder sb = new StringBuilder();
- private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
- LoggingStream(OutputStream out) {
- super(out);
- }
-
- StringBuilder getStringBuilder(Charset charset) {
- // write entity to the builder
- final byte[] entity = baos.toByteArray();
-
- sb.append(new String(entity, 0, entity.length, charset));
- if (entity.length > maxEntitySize) {
- sb.append("...more...");
- }
- sb.append('\n');
-
- return sb;
- }
-
- @Override
- public void write(final int i) throws IOException {
- if (baos.size() <= maxEntitySize) {
- baos.write(i);
- }
- out.write(i);
- }
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client.policy;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.FilterOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.util.logging.Logger;
+
+import javax.annotation.Priority;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.client.ClientRequestContext;
+import javax.ws.rs.client.ClientRequestFilter;
+import javax.ws.rs.client.ClientResponseContext;
+import javax.ws.rs.client.ClientResponseFilter;
+import javax.ws.rs.ext.WriterInterceptor;
+import javax.ws.rs.ext.WriterInterceptorContext;
+
+@Priority(Integer.MIN_VALUE)
+public class LoggingFilter implements ClientRequestFilter, ClientResponseFilter, WriterInterceptor {
+
+ private static final Logger logger = Logger.getLogger(LoggingFilter.class.getName());
+ private static final String ENTITY_STREAM_PROPERTY = "LoggingFilter.entityStream";
+ private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;
+ private final int maxEntitySize;
+
+ public LoggingFilter() {
+ maxEntitySize = 1024 * 1024;
+ }
+
+ public LoggingFilter(int maxPayloadSize) {
+ this.maxEntitySize = Integer.min(maxPayloadSize, 1024 * 1024);
+ }
+
+ private void log(StringBuilder sb) {
+ logger.info(sb.toString());
+ }
+
+ private InputStream logInboundEntity(final StringBuilder b, InputStream stream, final Charset charset)
+ throws IOException {
+ if (!stream.markSupported()) {
+ stream = new BufferedInputStream(stream);
+ }
+ stream.mark(maxEntitySize + 1);
+ final byte[] entity = new byte[maxEntitySize + 1];
+ final int entitySize = stream.read(entity);
+ if (entitySize != -1) {
+ b.append(new String(entity, 0, Math.min(entitySize, maxEntitySize), charset));
+ }
+ if (entitySize > maxEntitySize) {
+ b.append("...more...");
+ }
+ b.append('\n');
+ stream.reset();
+ return stream;
+ }
+
+ @Override
+ public void filter(ClientRequestContext requestContext) throws IOException {
+ if (requestContext.hasEntity()) {
+ final OutputStream stream = new LoggingStream(requestContext.getEntityStream());
+ requestContext.setEntityStream(stream);
+ requestContext.setProperty(ENTITY_STREAM_PROPERTY, stream);
+ }
+ }
+
+ @Override
+ public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {
+ final StringBuilder sb = new StringBuilder();
+ if (responseContext.hasEntity()) {
+ responseContext.setEntityStream(logInboundEntity(sb, responseContext.getEntityStream(), DEFAULT_CHARSET));
+ log(sb);
+ }
+ }
+
+ @Override
+ public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException {
+ final LoggingStream stream = (LoggingStream) context.getProperty(ENTITY_STREAM_PROPERTY);
+ context.proceed();
+ if (stream != null) {
+ log(stream.getStringBuilder(DEFAULT_CHARSET));
+ }
+ }
+
+ private class LoggingStream extends FilterOutputStream {
+
+ private final StringBuilder sb = new StringBuilder();
+ private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+ LoggingStream(OutputStream out) {
+ super(out);
+ }
+
+ StringBuilder getStringBuilder(Charset charset) {
+ // write entity to the builder
+ final byte[] entity = baos.toByteArray();
+
+ sb.append(new String(entity, 0, entity.length, charset));
+ if (entity.length > maxEntitySize) {
+ sb.append("...more...");
+ }
+ sb.append('\n');
+
+ return sb;
+ }
+
+ @Override
+ public void write(final int i) throws IOException {
+ if (baos.size() <= maxEntitySize) {
+ baos.write(i);
+ }
+ out.write(i);
+ }
+ }
+} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyRestClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyRestClient.java
index 71ae56f55b..4ed2a887ef 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyRestClient.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyRestClient.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * ONAP - SO
+ * OPENECOMP - MSO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
@@ -20,50 +20,47 @@
package org.openecomp.mso.client.policy;
+import java.net.MalformedURLException;
import java.util.Map;
+import java.util.Optional;
import java.util.UUID;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
+import javax.ws.rs.client.ClientResponseFilter;
+import javax.ws.rs.core.UriBuilder;
+import javax.ws.rs.core.UriBuilderException;
+import org.openecomp.mso.client.ResponseExceptionMapperImpl;
+import org.openecomp.mso.client.RestProperties;
+import org.openecomp.mso.client.policy.entities.PolicyServiceType;
import org.springframework.stereotype.Service;
@Service
public class PolicyRestClient extends RestClient {
- private static final String ENDPOINT_KEY = "policy.endpoint";
private static final String X_ECOMP_REQUESTID = String.valueOf(UUID.randomUUID());
-
- public PolicyRestClient() {
- super(ENDPOINT_KEY);
+ private final PolicyRestProperties properties;
+ public PolicyRestClient(PolicyRestProperties props, PolicyServiceType serviceType) {
+ super(props, Optional.of(UriBuilder.fromPath(serviceType.toString()).build()));
+ this.properties = props;
+ this.getClient();
}
@Override
protected void initializeHeaderMap(Map<String, String> headerMap) {
- headerMap.put("ClientAuth", properties.get("policy.client.auth"));
- headerMap.put("Authorization", properties.get("policy.auth"));
- headerMap.put("Environment", properties.get("policy.environment"));
- headerMap.put("X-ECOMP-RequestID", X_ECOMP_REQUESTID);
+ headerMap.put("ClientAuth", properties.getClientAuth());
+ headerMap.put("Authorization", properties.getAuth());
+ headerMap.put("Environment", properties.getEnvironment());
+ this.addRequestId(X_ECOMP_REQUESTID);
}
- public PolicyDecision getDecision(String serviceType, String vnfType, String bbID, String workStep,
- String errorCode) {
- DecisionAttributes decisionAttributes = new DecisionAttributes();
- decisionAttributes.setServiceType(serviceType);
- decisionAttributes.setVNFType(vnfType);
- decisionAttributes.setBBID(bbID);
- decisionAttributes.setWorkStep(workStep);
- decisionAttributes.setErrorCode(errorCode);
-
- return this.getDecision(decisionAttributes);
+ @Override
+ protected Optional<ClientResponseFilter> addResponseFilter() {
+ return Optional.of(new ResponseExceptionMapperImpl());
}
- private PolicyDecision getDecision(DecisionAttributes decisionAttributes) {
- PolicyDecisionRequest decisionRequest = new PolicyDecisionRequest();
- decisionRequest.setDecisionAttributes(decisionAttributes);
- decisionRequest.setEcompcomponentName(ECOMP_COMPONENT_NAME);
-
- return this.getBuilder().accept(MediaType.APPLICATION_JSON_TYPE)
- .post(Entity.entity(decisionRequest, MediaType.APPLICATION_JSON)).readEntity(PolicyDecision.class);
+ @Override
+ public RestClient addRequestId(String requestId) {
+ this.headerMap.put("X-ECOMP-RequestID", requestId);
+ return this;
}
} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyRestProperties.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyRestProperties.java
new file mode 100644
index 0000000000..d9336768fc
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyRestProperties.java
@@ -0,0 +1,64 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client.policy;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Map;
+
+import org.openecomp.mso.bpmn.core.PropertyConfiguration;
+import org.openecomp.mso.client.RestProperties;
+
+public class PolicyRestProperties implements RestProperties {
+
+
+ final Map<String, String> props;
+ public PolicyRestProperties() {
+ this.props = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties");
+
+ }
+ @Override
+ public URL getEndpoint() {
+ try {
+ return new URL(props.getOrDefault("policy.endpoint", ""));
+ } catch (MalformedURLException e) {
+ return null;
+ }
+ }
+
+ @Override
+ public String getSystemName() {
+ return "MSO";
+ }
+
+ public String getClientAuth() {
+ return props.get("policy.client.auth");
+ }
+
+ public String getAuth() {
+ return props.get("policy.auth");
+ }
+
+ public String getEnvironment() {
+ return props.get("policy.environment");
+ }
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/RestClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/RestClient.java
index 81c072ff33..74b1c3f802 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/RestClient.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/RestClient.java
@@ -20,51 +20,104 @@
package org.openecomp.mso.client.policy;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.logging.Logger;
+import java.util.Optional;
+import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
+import javax.ws.rs.client.ClientResponseFilter;
+import javax.ws.rs.client.Entity;
import javax.ws.rs.client.Invocation.Builder;
import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriBuilder;
+import javax.ws.rs.ext.ContextResolver;
-
-import org.openecomp.mso.bpmn.core.PropertyConfiguration;
+import org.apache.log4j.Logger;
+import org.openecomp.mso.client.RestProperties;
import org.openecomp.mso.logger.MsoLogger;
import org.springframework.stereotype.Service;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
@Service
public abstract class RestClient {
protected static final String ECOMP_COMPONENT_NAME = "MSO";
-
+
+ private static final int MAX_PAYLOAD_SIZE = 1024 * 1024;
private WebTarget webTarget;
protected final Map<String, String> headerMap;
protected final MsoLogger msoLogger;
- protected Map<String, String> properties;
- protected String host;
+ protected URL host;
+ protected Optional<URI> path;
+ protected Logger logger;
+ protected String accept;
+ protected String contentType;
- protected RestClient(String endpointKey) {
- Logger logger = Logger.getLogger(getClass().getName());
+ protected RestClient(RestProperties props, Optional<URI> path) {
+ logger = Logger.getLogger(getClass().getName());
msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL);
-
- properties = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties");
+
headerMap = new HashMap<>();
- initializeHeaderMap(headerMap);
+ try {
+ host = props.getEndpoint();
+ } catch (MalformedURLException e) {
+ logger.error("url not valid", e);
+ throw new RuntimeException(e);
+ }
+
+ this.path = path;
+ initializeClient(getClient());
+ }
- host = this.getHost(endpointKey);
+ protected RestClient(RestProperties props, Optional<URI> path, String accept, String contentType) {
+ this(props, path);
+ this.accept = accept;
+ this.contentType = contentType;
- webTarget = ClientBuilder.newClient().register(logger).register(new LoggingFilter())
- .register(new CommonObjectMapperProvider()).target(host);
}
- private String getHost(String key) {
- return properties.get(key);
+ protected RestClient(URL host, String contentType) {
+ headerMap = new HashMap<>();
+ logger = Logger.getLogger(getClass().getName());
+ msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL);
+ this.path = Optional.empty();
+ this.host = host;
+ this.contentType = contentType;
+ initializeClient(getClient());
+ }
+
+ /**
+ * Override method to return false to disable logging.
+ *
+ * @return true - to enable logging, false otherwise
+ */
+ protected boolean enableLogging() {
+ return true;
+ }
+
+ /**
+ * Override method to return custom value for max payload size.
+ *
+ * @return Default value for MAX_PAYLOAD_SIZE = 1024 * 1024
+ */
+ protected int getMaxPayloadSize()
+ {
+ return MAX_PAYLOAD_SIZE;
}
protected Builder getBuilder() {
+
Builder builder = webTarget.request();
+ initializeHeaderMap(headerMap);
for (Entry<String, String> entry : headerMap.entrySet()) {
builder.header(entry.getKey(), entry.getValue());
@@ -73,4 +126,100 @@ public abstract class RestClient {
}
protected abstract void initializeHeaderMap(Map<String, String> headerMap);
+
+ protected abstract Optional<ClientResponseFilter> addResponseFilter();
+
+ public abstract RestClient addRequestId(String requestId);
+
+ protected ContextResolver<ObjectMapper> getMapper() {
+ return new CommonObjectMapperProvider();
+ }
+
+ protected String getAccept() {
+ return accept;
+ }
+
+ protected String getContentType() {
+ return contentType;
+ }
+
+ protected String getMergeContentType() {
+ return "application/merge-patch+json";
+ }
+
+ protected Client getClient() {
+ return ClientBuilder.newBuilder().build();
+ }
+
+ protected void initializeClient(Client client) {
+ if (this.enableLogging()) {
+ client.register(logger).register(new LoggingFilter(this.getMaxPayloadSize()));
+ }
+ client.register(this.getMapper());
+ Optional<ClientResponseFilter> responseFilter = this.addResponseFilter();
+ if (responseFilter.isPresent()) {
+ client.register(responseFilter.get());
+ }
+ if (!path.isPresent()) {
+ webTarget = client.target(host.toString());
+ } else {
+ webTarget = client.target(UriBuilder.fromUri(host + path.get().toString()));
+ }
+ this.accept = MediaType.APPLICATION_JSON;
+ this.contentType = MediaType.APPLICATION_JSON;
+ }
+
+ public Response get() {
+ return this.getBuilder().accept(this.getAccept()).get();
+ }
+
+ public Response post(Object obj) {
+ return this.getBuilder().accept(this.getAccept()).post(Entity.entity(obj, this.getContentType()));
+ }
+
+ public Response patch(Object obj) {
+ return this.getBuilder().header("X-HTTP-Method-Override", "PATCH").accept(this.getAccept())
+ .post(Entity.entity(obj, this.getMergeContentType()));
+ }
+
+ public Response put(Object obj) {
+ return this.getBuilder().accept(this.getAccept()).put(Entity.entity(obj, this.getContentType()));
+ }
+
+ public Response delete() {
+ return this.getBuilder().accept(this.getAccept()).delete();
+ }
+
+ public Response delete(Object obj) {
+ return this.getBuilder().header("X-HTTP-Method-Override", "DELETE").accept(this.getAccept())
+ .put(Entity.entity(obj, this.getContentType()));
+ }
+
+ public <T> T get(Class<T> resultClass) {
+ return this.get().readEntity(resultClass);
+ }
+
+ public <T> T get(GenericType<T> resultClass) {
+ return this.get().readEntity(resultClass);
+ }
+
+ public <T> T post(Object obj, Class<T> resultClass) {
+ return this.post(obj).readEntity(resultClass);
+ }
+
+ public <T> T patch(Object obj, Class<T> resultClass) {
+ return this.patch(obj).readEntity(resultClass);
+ }
+
+ public <T> T put(Object obj, Class<T> resultClass) {
+ return this.put(obj).readEntity(resultClass);
+ }
+
+ public <T> T delete(Class<T> resultClass) {
+ return this.delete().readEntity(resultClass);
+ }
+
+ public <T> T delete(Object obj, Class<T> resultClass) {
+ return this.delete(obj).readEntity(resultClass);
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/entities/PolicyServiceType.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/entities/PolicyServiceType.java
new file mode 100644
index 0000000000..b5ab63ce35
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/entities/PolicyServiceType.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client.policy.entities;
+
+public enum PolicyServiceType {
+ GET_CONFIG("getConfig"),
+ SEND_EVENT("sendEvent"),
+ PUSH_POLICY("pushPolicy"),
+ CREATE_POLICY("createPolicy"),
+ UPDATE_POLICY("updatePolicy"),
+ GET_DECISION("getDecision"),
+ GET_METRICS("getMetrics"),
+ DELETE_POLICY("deletePolicy"),
+ LIST_CONFIG("listConfig"),
+ CREATE_DICTIONARY_ITEM("createDictionaryItem"),
+ UPDATE_DICTIONARY_ITEM("updateDictionaryItem"),
+ GET_DICTIONARY_ITEMS("getDictionaryItems");
+
+ private final String name;
+
+ private PolicyServiceType(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String toString() {
+ return name;
+ }
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidator.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidator.java
index eb18e10bc3..c746c0d448 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidator.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidator.java
@@ -32,6 +32,6 @@ public interface SDNOValidator {
* @throws IOException
* @throws Exception
*/
- public void healthDiagnostic(String vnfName, String uuid) throws IOException, Exception;
+ public void healthDiagnostic(String vnfId, String requestingUserId) throws IOException, Exception;
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidatorImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidatorImpl.java
index 92a00eee65..bdb4aa94ee 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidatorImpl.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidatorImpl.java
@@ -30,7 +30,7 @@ import org.openecomp.mso.client.dmaap.DmaapPublisher;
import org.openecomp.mso.client.exceptions.SDNOException;
import org.openecomp.mso.jsonpath.JsonPathUtil;
-public class SDNOValidatorImpl implements SDNOValidator, Consumer {
+public class SDNOValidatorImpl implements SDNOValidator {
private final static String aafUserName = "something";
private final static String clientName = "MSO";
@@ -51,103 +51,4 @@ public class SDNOValidatorImpl implements SDNOValidator, Consumer {
//block and continue to poll waiting for response
}
- protected SDNO buildRequestDiagnostic(String vnfName, String uuid, String oamIp) {
-
- Input input = new Input();
- SDNO parentRequest = new SDNO();
- Body body = new Body();
- parentRequest.setBody(body);
- parentRequest.setNodeType("vPE");
- parentRequest.setOperation("health-diagnostic");
-
- body.setInput(input);
-
- RequestHealthDiagnostic request = new RequestHealthDiagnostic();
- request.setRequestClientName(clientName);
- request.setRequestNodeName(vnfName);
- request.setRequestNodeIp(oamIp); //generic-vnf oam ip
- request.setRequestUserId(aafUserName); //mech id?
- request.setRequestId(uuid); //something to identify this request by for polling
-
- input.setRequestHealthDiagnostic(request);
-
- return parentRequest;
- }
- protected void submitRequest(String json) throws FileNotFoundException, IOException, InterruptedException {
- DmaapPublisher publisher = new DmaapPublisher(this.producerFilePath);
- publisher.send(json);
- }
- protected boolean pollForResponse(DmaapConsumer consumer, String uuid) throws Exception {
- this.uuid = uuid;
- return consumer.consume(this);
- }
-
- @Override
- public boolean continuePolling() {
- return continuePolling;
- }
-
- @Override
- public void stopProcessingMessages() {
- continuePolling = false;
- }
- @Override
- public void processMessage(String message) throws Exception {
- if (isHealthDiagnostic(message, this.getRequestId())) {
- if (!healthDiagnosticSuccessful(message)) {
- Optional<String> statusMessage = this.getStatusMessage(message);
- if (statusMessage.isPresent()) {
- throw new SDNOException(statusMessage.get());
- } else {
- throw new SDNOException();
- }
- } else {
- stopProcessingMessages();
- }
- }
- }
-
- @Override
- public boolean isAccepted(String message) {
- if (isResultInfo(message)) {
- Optional<String> code = isAccepted(message, this.getRequestId());
- if (code.isPresent()) {
- if ("202".equals(code.get())) {
- return true;
- } else {
- //TODO check other statuses 400 and 500
- }
- } else {
- //TODO throw error
- }
- }
-
- return false;
- }
-
- @Override
- public String getRequestId() {
- return uuid;
- }
-
- protected Optional<String> isAccepted(String json, String uuid) {
- return JsonPathUtil.getInstance().locateResult(json, String.format("$.result-info[?(@.status=='ACCEPTED' && @.request-id=='%s')].code", uuid));
- }
-
- protected boolean isResultInfo(String json) {
- return JsonPathUtil.getInstance().pathExists(json, "$[?(@.result-info)]");
- }
-
- protected boolean isHealthDiagnostic(String json, String uuid) {
- return JsonPathUtil.getInstance().pathExists(json, String.format("$[?(@.result-info.request-id=='%s')].%s", uuid, healthDiagnosticPath));
- }
-
- protected boolean healthDiagnosticSuccessful(String json) {
- return JsonPathUtil.getInstance().pathExists(json, "$." + healthDiagnosticPath + "[?(@.response-status=='Success')]");
- }
-
- protected Optional<String> getStatusMessage(String json) {
- return JsonPathUtil.getInstance().locateResult(json, "$." + healthDiagnosticPath + ".response-details-json");
- }
-
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Body.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/Body.java
index 2db4dea069..cc8ce81dec 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Body.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/Body.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.mso.client.sdno;
+package org.openecomp.mso.client.sdno.beans;
import java.io.Serializable;
import java.util.HashMap;
@@ -41,7 +41,7 @@ public class Body implements Serializable
@JsonProperty("input")
private Input input;
@JsonIgnore
- private Map<String, Object> additionalProperties = new HashMap<>();
+ private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = 9101706044452851559L;
@JsonProperty("input")
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Input.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/Input.java
index 25eb2ed270..7b9bf6f2c7 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Input.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/Input.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.mso.client.sdno;
+package org.openecomp.mso.client.sdno.beans;
import java.io.Serializable;
import java.util.HashMap;
@@ -33,15 +33,17 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
- "request-healthdiagnostic"
+ "request-healthdiagnostic",
+ "request-hd-custom"
})
public class Input implements Serializable
{
@JsonProperty("request-healthdiagnostic")
private RequestHealthDiagnostic RequestHealthDiagnostic;
+
@JsonIgnore
- private Map<String, Object> additionalProperties = new HashMap<>();
+ private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = 7155546785389227528L;
@JsonProperty("request-healthdiagnostic")
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/RequestHealthDiagnostic.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/RequestHealthDiagnostic.java
index b1ed77b513..104dbb7ee6 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/RequestHealthDiagnostic.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/RequestHealthDiagnostic.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.mso.client.sdno;
+package org.openecomp.mso.client.sdno.beans;
import java.io.Serializable;
import java.util.HashMap;
@@ -59,7 +59,7 @@ public class RequestHealthDiagnostic implements Serializable
@JsonProperty("health-diagnostic-code")
private String healthDiagnosticCode;
@JsonIgnore
- private Map<String, Object> additionalProperties = new HashMap<>();
+ private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = 1166788526178388021L;
@JsonProperty("request-client-name")
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/ResultInfo.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/ResultInfo.java
index 0997b2df90..4d029cb8cb 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/ResultInfo.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/ResultInfo.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.mso.client.sdno;
+package org.openecomp.mso.client.sdno.beans;
import java.util.HashMap;
import java.util.Map;
@@ -51,7 +51,7 @@ private String requestId;
@JsonProperty("status")
private String status;
@JsonIgnore
-private Map<String, Object> additionalProperties = new HashMap<>();
+private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("client-name")
public String getClientName() {
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNO.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/SDNO.java
index caa3ff58e9..4edd54ca09 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNO.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/SDNO.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.mso.client.sdno;
+package org.openecomp.mso.client.sdno.beans;
import java.io.Serializable;
import java.util.HashMap;
@@ -34,6 +34,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"operation",
+ "nodeLoc",
"nodeType",
"body"
})
@@ -42,12 +43,14 @@ public class SDNO implements Serializable
@JsonProperty("operation")
private String operation;
+ @JsonProperty("nodeLoc")
+ private String nodeLoc;
@JsonProperty("nodeType")
private String nodeType;
@JsonProperty("body")
private Body body;
@JsonIgnore
- private Map<String, Object> additionalProperties = new HashMap<>();
+ private Map<String, Object> additionalProperties = new HashMap<String, Object>();
private final static long serialVersionUID = -5303297382564282650L;
@JsonProperty("operation")
@@ -59,8 +62,23 @@ public class SDNO implements Serializable
public void setOperation(String operation) {
this.operation = operation;
}
+
+ @JsonProperty("nodeLoc")
+ public String getNodeLoc() {
+ return nodeLoc;
+ }
+
+ @JsonProperty("nodeLoc")
+ public void setNodeLoc(String nodeLoc) {
+ this.nodeLoc = nodeLoc;
+ }
+
+ public SDNO withNodeLoc(String nodeLoc) {
+ this.nodeLoc = nodeLoc;
+ return this;
+ }
- public SDNO withOperation(String operation) {
+ public SDNO withOperation(String operation) {
this.operation = operation;
return this;
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/dmaap/SDNOHealthCheckDmaapConsumer.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/dmaap/SDNOHealthCheckDmaapConsumer.java
new file mode 100644
index 0000000000..f23d882b53
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/dmaap/SDNOHealthCheckDmaapConsumer.java
@@ -0,0 +1,156 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client.sdno.dmaap;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Optional;
+
+import org.openecomp.mso.client.dmaap.DmaapConsumer;
+import org.openecomp.mso.client.exceptions.SDNOException;
+import org.openecomp.mso.jsonpath.JsonPathUtil;
+
+public class SDNOHealthCheckDmaapConsumer extends DmaapConsumer {
+
+ private final String uuid;
+ private boolean continuePolling = true;
+ private final static String healthDiagnosticPath = "body.output.*";
+
+ public SDNOHealthCheckDmaapConsumer() throws FileNotFoundException, IOException {
+ this("none");
+ }
+
+ public SDNOHealthCheckDmaapConsumer(String uuid) throws FileNotFoundException, IOException {
+ super();
+ this.uuid = uuid;
+ }
+
+ @Override
+ public String getUserName() {
+ return msoProperties.get("sdno.health-check.dmaap.username");
+ }
+
+ @Override
+ public String getPassword() {
+ return msoProperties.get("sdno.health-check.dmaap.password");
+ }
+
+ @Override
+ public String getTopic() {
+ return msoProperties.get("sdno.health-check.dmaap.subscriber.topic");
+ }
+
+ @Override
+ public boolean continuePolling() {
+ return continuePolling;
+ }
+
+ @Override
+ public void stopProcessingMessages() {
+ continuePolling = false;
+ }
+ @Override
+ public void processMessage(String message) throws Exception {
+ if (isHealthDiagnostic(message, this.getRequestId())) {
+ if (!healthDiagnosticSuccessful(message)) {
+ Optional<String> statusMessage = this.getStatusMessage(message);
+ if (statusMessage.isPresent()) {
+ throw new SDNOException("failed with message " + statusMessage.get());
+ } else {
+ throw new SDNOException("failed with no status message");
+ }
+ } else {
+ auditLogger.info("successful health diagnostic found for request: " + this.getRequestId());
+ stopProcessingMessages();
+ }
+ }
+ }
+
+ @Override
+ public boolean isAccepted(String message) {
+ if (isResultInfo(message)) {
+ Optional<String> code = isAccepted(message, this.getRequestId());
+ if (code.isPresent()) {
+ if ("202".equals(code.get())) {
+ return true;
+ } else {
+ //TODO check other statuses 400 and 500
+ }
+ } else {
+ //TODO throw error
+ }
+ }
+
+ return false;
+ }
+
+ @Override
+ public boolean isFailure(String message) {
+ if (isResultInfo(message)) {
+ Optional<String> code = isFailure(message, this.getRequestId());
+ if (code.isPresent()) {
+ if ("500".equals(code.get())) {
+ return true;
+ } else {
+ //TODO check other statuses 400 and 500
+ }
+ } else {
+ //TODO throw error
+ }
+ }
+
+ return false;
+ }
+
+ @Override
+ public String getRequestId() {
+ return uuid;
+ }
+
+ protected Optional<String> isAccepted(String json, String uuid) {
+ return JsonPathUtil.getInstance().locateResult(json, String.format("$.result-info[?(@.status=='ACCEPTED' && @.request-id=='%s')].code", uuid));
+ }
+
+ protected Optional<String> isFailure(String json, String uuid) {
+ return JsonPathUtil.getInstance().locateResult(json, String.format("$.result-info[?(@.status=='FAILURE' && @.request-id=='%s')].code", uuid));
+ }
+
+ protected boolean isResultInfo(String json) {
+ return JsonPathUtil.getInstance().pathExists(json, "$[?(@.result-info)]");
+ }
+
+ protected boolean isHealthDiagnostic(String json, String uuid) {
+ return JsonPathUtil.getInstance().pathExists(json, String.format("$[?(@.result-info.request-id=='%s')].%s", uuid, healthDiagnosticPath));
+ }
+
+ protected boolean healthDiagnosticSuccessful(String json) {
+ return JsonPathUtil.getInstance().pathExists(json, "$." + healthDiagnosticPath + "[?(@.response-status=='Success')]");
+ }
+
+ protected Optional<String> getStatusMessage(String json) {
+ return JsonPathUtil.getInstance().locateResult(json, "$." + healthDiagnosticPath + ".error-message");
+ }
+
+ @Override
+ public int getMaximumElapsedTime() {
+ return 300000;
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/dmaap/SDNOHealthCheckDmaapPublisher.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/dmaap/SDNOHealthCheckDmaapPublisher.java
new file mode 100644
index 0000000000..73f06b8e58
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/dmaap/SDNOHealthCheckDmaapPublisher.java
@@ -0,0 +1,50 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.openecomp.mso.client.sdno.dmaap;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.openecomp.mso.client.dmaap.DmaapPublisher;
+
+public class SDNOHealthCheckDmaapPublisher extends DmaapPublisher {
+
+ public SDNOHealthCheckDmaapPublisher() throws FileNotFoundException, IOException {
+ super();
+ }
+
+ @Override
+ public String getUserName() {
+ return msoProperties.get("sdno.health-check.dmaap.username");
+ }
+
+ @Override
+ public String getPassword() {
+ return msoProperties.get("sdno.health-check.dmaap.password");
+ }
+
+ @Override
+ public String getTopic() {
+ return msoProperties.get("sdno.health-check.dmaap.publisher.topic");
+ }
+
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/resources/META-INF/processes.xml b/bpmn/MSOCommonBPMN/src/main/resources/META-INF/processes.xml
index d328246b2c..772867d3f2 100644
--- a/bpmn/MSOCommonBPMN/src/main/resources/META-INF/processes.xml
+++ b/bpmn/MSOCommonBPMN/src/main/resources/META-INF/processes.xml
@@ -22,7 +22,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<process-archive name="MSOCommonBPMN">
- <process-engine>infrastructure</process-engine>
+ <process-engine>default</process-engine>
<properties>
<property name="isDeleteUponUndeploy">false</property>
<property name="isScanForProcessDefinitions">true</property>
diff --git a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/applicationContext.xml b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/applicationContext.xml
deleted file mode 100644
index 6f61c8fbf4..0000000000
--- a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/applicationContext.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd">
-
- <!-- Spring bean to be invoked through the ApplicationContextElResolver -->
-
-</beans>
diff --git a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
deleted file mode 100644
index b68ebd943c..0000000000
--- a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<!--
- ============LICENSE_START=======================================================
- ECOMP MSO
- ================================================================================
- Copyright (C) 2017 AT&T 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=========================================================
- -->
-
-<jboss-deployment-structure>
- <deployment>
- <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
- <exclusions>
- <module name="org.apache.log4j" />
- <module name="org.slf4j" />
- <module name="org.slf4j.impl" />
- <module name="org.jboss.resteasy.resteasy-jackson-provider" />
- <module name="org.jboss.resteasy.resteasy-jettison-provider" />
- </exclusions>
- <dependencies>
- <module name="org.jboss.resteasy.resteasy-jackson2-provider" services="import" />
- <!-- This module contain the ProviderBase class: -->
- <module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" export="true"/>
- </dependencies>
- </deployment>
-</jboss-deployment-structure>
-
diff --git a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-web.xml b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-web.xml
deleted file mode 100644
index a9a263b684..0000000000
--- a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-web.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ============LICENSE_START=======================================================
- ECOMP MSO
- ================================================================================
- Copyright (C) 2017 AT&T 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=========================================================
- -->
-
-<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 5.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
-<jboss-web>
- <security-domain>other</security-domain>
- <context-root>/mso/common</context-root>
-</jboss-web>
diff --git a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/web.xml b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index 3a42877715..0000000000
--- a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ============LICENSE_START=======================================================
- ECOMP MSO
- ================================================================================
- Copyright (C) 2017 AT&T 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=========================================================
- -->
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
- <display-name>MSO Common BPMN Workflow Servlet</display-name>
- <servlet>
- <servlet-name>resteasy-servlet</servlet-name>
- <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
- <init-param>
- <param-name>javax.ws.rs.Application</param-name>
- <param-value>org.openecomp.mso.bpmn.common.workflow.service.WorkflowResourceApplication</param-value>
- </init-param>
- </servlet>
- <servlet-mapping>
- <servlet-name>resteasy-servlet</servlet-name>
- <url-pattern>/*</url-pattern>
- </servlet-mapping>
- <context-param>
- <param-name>contextConfigLocation</param-name>
- <param-value>/WEB-INF/applicationContext.xml</param-value>
- </context-param>
- <context-param>
- <param-name>mso.configuration</param-name>
- <param-value>MSO_PROP_TOPOLOGY=topology.properties</param-value>
- </context-param>
- <context-param>
- <param-name>log.configuration</param-name>
- <param-value>logback.bpmn.xml</param-value>
- </context-param>
- <context-param>
- <param-name>resteasy.resources</param-name>
- <param-value>org.openecomp.mso.logger.MsoLoggingServlet,org.openecomp.mso.bpmn.core.HealthCheckHandler</param-value>
- </context-param>
- <listener>
- <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
- </listener>
- <filter>
- <filter-name>LogFilter</filter-name>
- <filter-class>org.openecomp.mso.logger.LogFilter</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>LogFilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- <security-constraint>
- <web-resource-collection>
- <web-resource-name>HTTPBasicAuth</web-resource-name>
- <description>Authentication for Client Apps</description>
- <url-pattern>/workflow/*</url-pattern>
- <http-method>GET</http-method>
- <http-method>POST</http-method>
- </web-resource-collection>
- <auth-constraint>
- <role-name>BPMN-Client</role-name>
- </auth-constraint>
- </security-constraint>
- <login-config>
- <auth-method>BASIC</auth-method>
- <realm-name>ApplicationRealm</realm-name>
- </login-config>
- <security-role>
- <role-name>BPMN-Client</role-name>
- </security-role>
-</web-app> \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java
index f60d984a6d..eef9ed8ee0 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java
@@ -42,7 +42,6 @@ import org.camunda.bpm.engine.variable.impl.VariableMapImpl;
import org.jboss.resteasy.spi.AsynchronousResponse;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncCommonResource;
import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource;
import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResource;
import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
@@ -201,7 +200,7 @@ public class BPMNUtil {
* @param variables
*/
private static void executeAsyncFlow(ProcessEngineServices processEngineServices, String processKey, AsynchronousResponse asyncResponse, Map<String,String> variables) {
- WorkflowAsyncResource workflowResource = new WorkflowAsyncCommonResource();
+ WorkflowAsyncResource workflowResource = new WorkflowAsyncResource();
VariableMapImpl variableMap = new VariableMapImpl();
Map<String, Object> variableValueType = new HashMap<String, Object>();
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java
index 51a1484cf9..426bceef4b 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java
@@ -31,7 +31,7 @@ import org.camunda.bpm.engine.test.Deployment;
import org.camunda.bpm.engine.variable.impl.VariableMapImpl;
import org.jboss.resteasy.spi.AsynchronousResponse;
import org.junit.Test;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncCommonResource;
+import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource;
import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
public class WorkflowAsyncResourceTest extends WorkflowTest {
@@ -53,7 +53,7 @@ public class WorkflowAsyncResourceTest extends WorkflowTest {
}
private void executeWorkflow(String request, String requestId, AsynchronousResponse asyncResponse, String processKey) {
- WorkflowAsyncCommonResource workflowResource = new WorkflowAsyncCommonResource();
+ WorkflowAsyncResource workflowResource = new WorkflowAsyncResource();
VariableMapImpl variableMap = new VariableMapImpl();
Map<String, Object> variableValueType = new HashMap<String, Object>();
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java
index 63403f40ce..15dc4f4609 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java
@@ -75,7 +75,6 @@ import org.openecomp.mso.bpmn.common.adapter.vnf.UpdateVnfNotification;
import org.openecomp.mso.bpmn.common.adapter.vnf.VnfRollback;
import org.openecomp.mso.bpmn.common.workflow.service.SDNCAdapterCallbackServiceImpl;
import org.openecomp.mso.bpmn.common.workflow.service.VnfAdapterNotifyServiceImpl;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncCommonResource;
import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource;
import org.openecomp.mso.bpmn.common.workflow.service.WorkflowMessageResource;
import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
@@ -273,7 +272,7 @@ public class WorkflowTest {
VariableMapImpl variableMapImpl = createVariableMapImpl(variables);
System.out.println("Sending " + request + " to " + processKey + " process");
- WorkflowAsyncResource workflowResource = new WorkflowAsyncCommonResource();
+ WorkflowAsyncResource workflowResource = new WorkflowAsyncResource();
workflowResource.setProcessEngineServices4junit(processEngineRule);
TestAsyncResponse asyncResponse = new TestAsyncResponse();
@@ -306,7 +305,7 @@ public class WorkflowTest {
VariableMapImpl variableMapImpl = createVariableMapImpl(variables);
System.out.println("Sending " + request + " to " + processKey + " process");
- WorkflowAsyncResource workflowResource = new WorkflowAsyncCommonResource();
+ WorkflowAsyncResource workflowResource = new WorkflowAsyncResource();
workflowResource.setProcessEngineServices4junit(processEngineRule);
TestAsyncResponse asyncResponse = new TestAsyncResponse();
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/FileUtil.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/FileUtil.java
index 2ebb44a644..2ebb44a644 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/FileUtil.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/FileUtil.java
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/MockResource.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResource.java
index fc97e69c5c..fc97e69c5c 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/MockResource.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResource.java
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/MockResourceApplication.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResourceApplication.java
index ebbfea5cd1..ebbfea5cd1 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/MockResourceApplication.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResourceApplication.java
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterMockTransformer.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/SDNCAdapterMockTransformer.java
index 9c4e7936b1..9c4e7936b1 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterMockTransformer.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/SDNCAdapterMockTransformer.java
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterNetworkTopologyMockTransformer.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/SDNCAdapterNetworkTopologyMockTransformer.java
index e59e3b67d2..e59e3b67d2 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterNetworkTopologyMockTransformer.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/SDNCAdapterNetworkTopologyMockTransformer.java
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java
index 32f2641ddb..f9a6543387 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java
@@ -1,1069 +1,1069 @@
-/*
- * ============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.openecomp.mso.bpmn.mock;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.containing;
-import static com.github.tomakehurst.wiremock.client.WireMock.delete;
-import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.patch;
-import static com.github.tomakehurst.wiremock.client.WireMock.put;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
-
-
-/**
- * Reusable Mock StubResponses for AAI Endpoints
- *
- */
-public class StubResponseAAI {
-
- public static void setupAllMocks() {
-
- }
-
-
- /**
- * Tunnel-XConnect Mock Stub Response
- */
- public static void MockPutTunnelXConnect(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String tunnelId){
- stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId + "/tunnel-xconnects/tunnel-xconnect/" + tunnelId))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
-
- /**
- * Allotted Resource Mock StubResponses below
- */
- public static void MockGetAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String responseFile) {
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockPutAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
- stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
- public static void MockPutAllottedResource_500(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
- stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
- .willReturn(aResponse()
- .withStatus(500)));
- }
-
- public static void MockDeleteAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String resourceVersion) {
- stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId + "[?]resource-version=" + resourceVersion))
- .willReturn(aResponse()
- .withStatus(204)));
- }
-
- public static void MockPatchAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
- stubFor(patch(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
- public static void MockQueryAllottedResourceById(String allottedResourceId, String responseFile){
- stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=allotted-resource[&]filter=id:EQUALS:" + allottedResourceId))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
-
- /**
- * Service Instance Mock StubResponses below
- */
- public static void MockGetServiceInstance(String globalCustId, String subscriptionType, String serviceInstanceId, String responseFile) {
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetServiceInstance_404(String customer, String serviceSubscription, String serviceInstanceId){
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
- .willReturn(aResponse()
- .withStatus(404)));
- }
-
- public static void MockGetServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId){
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
- .willReturn(aResponse()
- .withStatus(500)));
- }
-
- public static void MockGetServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId, String responseFile){
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
- .willReturn(aResponse()
- .withStatus(500)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockNodeQueryServiceInstanceByName(String serviceInstanceName, String responseFile){
- stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance[&]filter=service-instance-name:EQUALS:" + serviceInstanceName))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockNodeQueryServiceInstanceByName_404(String serviceInstanceName){
- stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-name:EQUALS:" + serviceInstanceName))
- .willReturn(aResponse()
- .withStatus(404)));
- }
-
- public static void MockNodeQueryServiceInstanceByName_500(String serviceInstanceName){
- stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-name:EQUALS:" + serviceInstanceName))
- .willReturn(aResponse()
- .withStatus(500)));
- }
-
- public static void MockNodeQueryServiceInstanceById(String serviceInstanceId, String responseFile){
- stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance[&]filter=service-instance-id:EQUALS:" + serviceInstanceId))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockNodeQueryServiceInstanceById_404(String serviceInstanceId){
- stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-id:EQUALS:" + serviceInstanceId))
- .willReturn(aResponse()
- .withStatus(404)));
- }
-
- public static void MockNodeQueryServiceInstanceById_500(String serviceInstanceId){
- stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-id:EQUALS:" + serviceInstanceId))
- .willReturn(aResponse()
- .withStatus(500)));
- }
-
- public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
- stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
- .willReturn(aResponse()
- .withStatus(204)));
- }
-
- public static void MockGetServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
- .willReturn(aResponse()
- .withStatus(statusCode)));
- }
-
- public static void MockGetServiceInstance(String customer, String serviceSubscription, String resourceVersion, int statusCode){
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "[?]resource-version=" + resourceVersion))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")));
- }
-
- public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){
- stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
- .willReturn(aResponse()
- .withStatus(statusCode)));
- }
-
- public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String resourceVersion, int statusCode){
- stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "[?]resource-version=" +1234))
- .willReturn(aResponse()
- .withStatus(statusCode)));
- }
-
- public static void MockDeleteServiceInstance_404(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
- stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
- .willReturn(aResponse()
- .withStatus(404)));
- }
-
- public static void MockDeleteServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
- stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
- .willReturn(aResponse()
- .withStatus(500)));
- }
-
- public static void MockPutServiceInstance(String globalCustId, String subscriptionType, String serviceInstanceId, String responseFile) {
- stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockPutServiceInstance_500(String globalCustId, String subscriptionType, String serviceInstanceId) {
- stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
- .willReturn(aResponse()
- .withStatus(500)));
- }
-
- /**
- * Service-Subscription Mock StubResponses below
- */
- public static void MockGetServiceSubscription(String globalCustId, String subscriptionType, String responseFile) {
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockDeleteServiceSubscription(String globalCustId, String subscriptionType, int statusCode) {
- stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
- .willReturn(aResponse()
- .withStatus(statusCode)));
- }
-
- public static void MockDeleteServiceInstanceId(String globalCustId, String subscriptionType, String serviceInstanceId) {
- stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
- public static void MockPutServiceSubscription(String globalCustId, String subscriptionType) {
- stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
- public static void MockGetServiceSubscription(String globalCustId, String subscriptionType, int statusCode) {
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
- .willReturn(aResponse()
- .withStatus(statusCode)));
- }
-
- /**
- * Customer Mock StubResponses below
- */
- public static void MockGetCustomer(String globalCustId, String responseFile) {
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockDeleteCustomer(String globalCustId) {
- stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
- public static void MockPutCustomer(String globalCustId) {
- stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
- public static void MockPutCustomer_500(String globalCustId) {
- stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
- .willReturn(aResponse()
- .withStatus(500)));
- }
-
-
- /**
- * Generic-Vnf Mock StubResponses below
- */
-
- public static void MockGetGenericVnfById(String vnfId, String responseFile){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=1"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetGenericVnfById(String vnfId, String responseFile, int statusCode){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetGenericVnfByIdWithPriority(String vnfId, int statusCode, String responseFile) {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
- .atPriority(1)
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetGenericVnfByIdWithPriority(String vnfId, String vfModuleId, int statusCode, String responseFile, int priority) {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
- .atPriority(priority)
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetGenericVnfByIdWithDepth(String vnfId, int depth, String responseFile){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=" + depth))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetGenericVnfById_404(String vnfId){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
- .willReturn(aResponse()
- .withStatus(404)));
- }
-
- public static void MockGetGenericVnfById_500(String vnfId){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
- .willReturn(aResponse()
- .withStatus(500)));
- }
-
- public static void MockGetGenericVnfByName(String vnfName, String responseFile){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetGenericVnfByNameWithDepth(String vnfName, int depth, String responseFile){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName + "[&]depth=" + depth))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetGenericVnfByName_404(String vnfName){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName))
- .willReturn(aResponse()
- .withStatus(404)));
- }
-
- public static void MockDeleteGenericVnf(String vnfId, String resourceVersion){
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
- .willReturn(aResponse()
- .withStatus(204)));
- }
-
- public static void MockDeleteGenericVnf(String vnfId, String resourceVersion, int statusCode){
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
- .willReturn(aResponse()
- .withStatus(statusCode)));
- }
-
- public static void MockDeleteGenericVnf_500(String vnfId, String resourceVersion){
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
- .willReturn(aResponse()
- .withStatus(500)));
- }
-
- public static void MockPutGenericVnf(String vnfId){
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
- public static void MockPutGenericVnf(String vnfId, String requestBodyContaining, int statusCode) {
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
- .withRequestBody(containing(requestBodyContaining))
- .willReturn(aResponse()
- .withStatus(statusCode)));
- }
-
- public static void MockPutGenericVnf(String vnfId, int statusCode) {
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
- .willReturn(aResponse()
- .withStatus(statusCode)));
- }
-
- public static void MockPutGenericVnf_Bad(String vnfId, int statusCode){
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
- .willReturn(aResponse()
- .withStatus(statusCode)));
- }
-
- public static void MockPatchGenericVnf(String vnfId){
- stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
- .willReturn(aResponse()
- .withStatus(200)));
- }
- /**
- * Vce Mock StubResponses below
- */
- public static void MockGetVceById(String vnfId, String responseFile){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetVceByName(String vnfName, String responseFile){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=" + vnfName))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockDeleteVce(String vnfId, String resourceVersion, int statusCode){
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId + "[?]resource-version=" + resourceVersion))
- .willReturn(aResponse()
- .withStatus(statusCode)));
- }
-
- public static void MockPutVce(String vnfId){
- stubFor(put(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
- public static void MockGetGenericVceByNameWithDepth(String vnfName, int depth, String responseFile){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=" + vnfName + "[&]depth=" + depth))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetVceGenericQuery(String serviceInstanceName, int depth, int statusCode, String responseFile){
- stubFor(get(urlMatching("/aai/v[0-9]+/search/generic-query[?]key=service-instance.service-instance-name:" + serviceInstanceName + "[&]start-node-type=service-instance[&]include=vce[&]depth=" + depth))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- /**
- * Tenant Mock StubResponses below
- */
- public static void MockGetTenantGenericQuery(String customer, String serviceType, String responseFile) {
- stubFor(get(urlMatching("/aai/v[0-9]+/search/generic-query[?]key=customer.global-customer-id:" + customer + "&key=service-subscription.service-type:" + serviceType + "&start-node-type=service-subscription&include=tenant&include=service-subscription&depth=1"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetTenant(String tenantId, String responseFile) {
- stubFor(get(urlEqualTo("/aai/v2/cloud-infrastructure/tenants/tenant/" + tenantId))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- /**
- * Network Mock StubResponses below
- */
- public static void MockGetNetwork(String networkId, String responseFile, int statusCode) {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetNetworkByIdWithDepth(String networkId, String responseFile, String depth) {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId + "[?]depth=" + depth))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetNetworkCloudRegion(String responseFile, String cloudRegion) {
- stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegion))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetNetworkByName(String networkName, String responseFile) {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name="+networkName))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetNetworkByName_404(String responseFile, String networkName) {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name="+networkName))
- .willReturn(aResponse()
- .withStatus(404)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetNetworkCloudRegion_404(String cloudRegion) {
- stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegion))
- .willReturn(aResponse()
- .withStatus(404)));
- }
-
- public static void MockPutNetwork(String networkId, int statusCode, String responseFile) {
- stubFor(put(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockPutNetwork(String networkPolicyId, String responseFile, int statusCode) {
- stubFor(put(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/" + networkPolicyId))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetNetworkName(String networkPolicyName, String responseFile, int statusCode) {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name=" + networkPolicyName))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetNetworkVpnBinding(String responseFile, String vpnBinding) {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/vpn-bindings/vpn-binding/"+vpnBinding + "[?]depth=all"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetNetworkPolicy(String responseFile, String policy) {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/"+policy + "[?]depth=all"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetNetworkVpnBinding(String networkBindingId, String responseFile, int statusCode) {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/vpn-bindings/vpn-binding/" + networkBindingId))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetNetworkPolicy(String networkPolicy, String responseFile, int statusCode) {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/" + networkPolicy))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetNetworkTableReference(String responseFile, String tableReference) {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/route-table-references/route-table-reference/"+tableReference + "[?]depth=all"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockPutNetworkIdWithDepth(String responseFile, String networkId, String depth) {
- stubFor(put(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/"+networkId+"[?]depth="+depth ))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetNetworkPolicyfqdn(String networkPolicy, String responseFile, int statusCode) {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy[?]network-policy-fqdn=" + networkPolicy))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetNetworkRouteTable(String networkRouteId, String responseFile, int statusCode) {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/route-table-references/route-table-reference/" + networkRouteId))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockPatchVfModuleId(String vnfId, String vfModuleId) {
- stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
- /////////////
-
- public static void MockVNFAdapterRestVfModule() {
- stubFor(put(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules/supercool"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- stubFor(post(urlMatching("/vnfs/v1/vnfs/.*/vf-modules"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- stubFor(post(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- stubFor(put(urlEqualTo("/vnfs/v1/volume-groups/78987"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- }
-
- public static void MockDBUpdateVfModule(){
- stubFor(post(urlEqualTo("/dbadapters/RequestsDbAdapter"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("VfModularity/DBUpdateResponse.xml")));
- }
-
- // start of mocks used locally and by other VF Module unit tests
- public static void MockSDNCAdapterVfModule() {
- // simplified the implementation to return "success" for all requests
- stubFor(post(urlEqualTo("/SDNCAdapter"))
-// .withRequestBody(containing("SvcInstanceId><"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
-
- }
-
- // start of mocks used locally and by other VF Module unit tests
- public static void MockAAIVfModule() {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool"))
- .atPriority(1)
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("VfModularity/VfModule-supercool.xml")));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/lukewarm"))
- .atPriority(2)
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("VfModularity/VfModule-lukewarm.xml")));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
- .atPriority(5)
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("VfModularity/VfModule-new.xml")));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask[?]depth=1"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("VfModularity/GenericVnf.xml")));
- stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool"))
-// .withRequestBody(containing("PCRF"))
- .willReturn(aResponse()
- .withStatus(200)));
- stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
-// .withRequestBody(containing("PCRF"))
- .willReturn(aResponse()
- .withStatus(200)));
- // HTTP PUT stub still used by CreateAAIvfModuleVolumeGroup
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
- .withRequestBody(containing("PCRF"))
- .willReturn(aResponse()
- .withStatus(200)));
- // HTTP PUT stub still used by DoCreateVfModuleTest
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
- .withRequestBody(containing("MODULELABEL"))
- .willReturn(aResponse()
- .withStatus(200)));
- stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group[?]volume-group-id=78987"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("VfModularity/ConfirmVolumeGroupTenantResponse.xml")));
- stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group[?]volume-group-id=78987"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("VfModularity/ConfirmVolumeGroupTenantResponse.xml")));
- stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/MDTWNJ21/volume-groups/volume-group/78987"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("VfModularity/VolumeGroup.xml")));
- stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups/volume-group/78987"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("VfModularity/VolumeGroup.xml")));
- stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group/78987[?]resource-version=0000020"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("DeleteCinderVolumeV1/DeleteVolumeId_AAIResponse_Success.xml")));
- stubFor(put(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/.*"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("VfModularity/AddNetworkPolicy_AAIResponse_Success.xml")));
- stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/NEWvBNGModuleId"))
- .withRequestBody(containing("NEWvBNGModuleId"))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
-
-
- //////////////
-
- /**
- * Cloud infrastructure below
- */
-
- public static void MockGetCloudRegion(String cloudRegionId, int statusCode, String responseFile) {
- stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- /**
- * Volume Group StubResponse below
- */
- public static void MockGetVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile) {
- stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockPutVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile, int statusCode) {
- stubFor(put(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetVolumeGroupByName(String cloudRegionId, String volumeGroupName, String responseFile, int statusCode) {
- stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockDeleteVolumeGroupById(String cloudRegionId, String volumeGroupId, String resourceVersion, int statusCode) {
- stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))
- .willReturn(aResponse()
- .withStatus(statusCode)));
- }
-
- public static void MockGetVolumeGroupByName_404(String cloudRegionId, String volumeGroupName) {
- stubFor(get(urlMatching("/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName))
- .willReturn(aResponse()
- .withStatus(404)));
- }
-
- public static void MockDeleteVolumeGroup(String cloudRegionId, String volumeGroupId, String resourceVersion) {
- stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
- /**
- * VF-Module StubResponse below
- * @param statusCode TODO
- */
- public static void MockGetVfModuleId(String vnfId, String vfModuleId, String responseFile, int statusCode) {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetVfModuleByNameWithDepth(String vnfId, String vfModuleName, int depth, String responseFile, int statusCode) {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module[?]vf-module-name=" + vfModuleName + "[?]depth=" + depth))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetVfModuleIdNoResponse(String vnfId, String requestContaining, String vfModuleId) {
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
- .withRequestBody(containing(requestContaining))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")));
- }
-
- public static void MockPutVfModuleIdNoResponse(String vnfId, String requestContaining, String vfModuleId) {
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId +"/vf-modules/vf-module/" +vfModuleId))
- .withRequestBody(containing(requestContaining))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
- public static void MockPutVfModuleId(String vnfId, String vfModuleId) {
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
- public static void MockPutVfModuleId(String vnfId, String vfModuleId, int returnCode) {
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
- .willReturn(aResponse()
- .withStatus(returnCode)));
- }
-
- public static void MockDeleteVfModuleId(String vnfId, String vfModuleId, String resourceVersion, int returnCode) {
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId + "/[?]resource-version=" + resourceVersion))
- .willReturn(aResponse()
- .withStatus(returnCode)));
- }
-
- public static void MockAAIVfModuleBadPatch(String endpoint, int statusCode) {
- stubFor(patch(urlMatching(endpoint))
- .willReturn(aResponse()
- .withStatus(statusCode)));
- }
-
- /* AAI Pserver Queries */
- public static void MockGetPserverByVnfId(String vnfId, String responseFile, int statusCode) {
- stubFor(put(urlMatching("/v10/query.*"))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "application/json")
- .withBodyFile(responseFile)));
- }
-
- public static void MockGetGenericVnfsByVnfId(String vnfId, String responseFile, int statusCode) {
- stubFor(get(urlMatching("/v10/network/generic-vnfs/.*"))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "application/json; charset=utf-8")
- .withBodyFile(responseFile)));
- }
-
- public static void MockSetInMaintFlagByVnfId(String vnfId, int statusCode) {
- stubFor(patch(urlMatching("/v10/network/generic-vnfs/.*"))
- .willReturn(aResponse()
- .withStatus(statusCode)
- ));
- }
-
- //// Deprecated Stubs below - to be deleted once unit test that reference them are refactored to use common ones above ////
- @Deprecated
- public static void MockGetVceById(){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123?depth=1"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("GenericFlows/getVceResponse.xml")));
- }
- @Deprecated
- public static void MockGetVceByName(){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=testVnfName123"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("GenericFlows/getVceByNameResponse.xml")));
- }
- @Deprecated
- public static void MockPutVce(){
- stubFor(put(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123"))
- .willReturn(aResponse()
- .withStatus(200)));
- }
- @Deprecated
- public static void MockDeleteVce(){
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123[?]resource-version=testReVer123"))
- .willReturn(aResponse()
- .withStatus(204)));
- }
- @Deprecated
- public static void MockDeleteVce_404(){
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123[?]resource-version=testReVer123"))
- .willReturn(aResponse()
- .withStatus(404)));
- }
-
- @Deprecated
- public static void MockDeleteServiceSubscription(){
- stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET[?]resource-version=1234"))
- .willReturn(aResponse()
- .withStatus(204)));
- }
- @Deprecated
- public static void MockGetServiceSubscription(){
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("GenericFlows/getServiceSubscription.xml")));
- }
- @Deprecated
- public static void MockGetServiceSubscription_200Empty(){
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET[?]resource-version=1234"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBody(" ")));
- }
- @Deprecated
- public static void MockGetServiceSubscription_404() {
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))
- .willReturn(aResponse()
- .withStatus(404)));
- }
- @Deprecated
- public static void MockGENPSIPutServiceInstance(){
- stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml")));
- }
-
- @Deprecated
- public static void MockGENPSIPutServiceSubscription(){
- stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml")));
- }
- @Deprecated
- public static void MockGENPSIPutServiceInstance_get500(){
- stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET"))
- .willReturn(aResponse()
- .withStatus(500)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("GenericPutServiceInstance/aaiFault.xml")));
- }
-
- @Deprecated
- public static void MockGetGenericVnfById(){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("GenericFlows/getGenericVnfByNameResponse.xml")));
- }
- @Deprecated
- public static void MockGetGenericVnfById_404(){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
- .willReturn(aResponse()
- .withStatus(404)));
- }
- @Deprecated
- public static void MockGetGenericVnfByName(){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("GenericFlows/getGenericVnfResponse.xml")));
- }
- @Deprecated
- public static void MockGetGenericVnfByName_hasRelationships(){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("GenericFlows/getGenericVnfResponse_hasRelationships.xml")));
- }
- @Deprecated
- public static void MockGetGenericVnfById_hasRelationships(){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile("GenericFlows/getGenericVnfResponse_hasRelationships.xml")));
- }
- @Deprecated
- public static void MockGetGenericVnfById_500(){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
- .willReturn(aResponse()
- .withStatus(500)));
- }
- @Deprecated
- public static void MockGetGenericVnfByName_404(){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
- .willReturn(aResponse()
- .withStatus(404)));
- }
- @Deprecated
- public static void MockPutGenericVnf(){
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
- .willReturn(aResponse()
- .withStatus(200)));
- }
- @Deprecated
- public static void MockPutGenericVnf_400(){
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
- .willReturn(aResponse()
- .withStatus(400)));
- }
- @Deprecated
- public static void MockDeleteGenericVnf(){
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))
- .willReturn(aResponse()
- .withStatus(204)));
- }
- @Deprecated
- public static void MockDeleteGenericVnf_404(){
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))
- .willReturn(aResponse()
- .withStatus(404)));
- }
- @Deprecated
- public static void MockDeleteGenericVnf_500(){
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))
- .willReturn(aResponse()
- .withStatus(500)));
- }
- @Deprecated
- public static void MockDeleteGenericVnf_412(){
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[[?]]resource-version=testReVer123"))
- .willReturn(aResponse()
- .withStatus(412)));
- }
-
-}
+/*
+ * ============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.openecomp.mso.bpmn.mock;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.containing;
+import static com.github.tomakehurst.wiremock.client.WireMock.delete;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.patch;
+import static com.github.tomakehurst.wiremock.client.WireMock.put;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+
+
+/**
+ * Reusable Mock StubResponses for AAI Endpoints
+ *
+ */
+public class StubResponseAAI {
+
+ public static void setupAllMocks() {
+
+ }
+
+
+ /**
+ * Tunnel-XConnect Mock Stub Response
+ */
+ public static void MockPutTunnelXConnect(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String tunnelId){
+ stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId + "/tunnel-xconnects/tunnel-xconnect/" + tunnelId))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+
+
+ /**
+ * Allotted Resource Mock StubResponses below
+ */
+ public static void MockGetAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String responseFile) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockPutAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
+ stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+
+ public static void MockPutAllottedResource_500(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
+ stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
+ .willReturn(aResponse()
+ .withStatus(500)));
+ }
+
+ public static void MockDeleteAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String resourceVersion) {
+ stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId + "[?]resource-version=" + resourceVersion))
+ .willReturn(aResponse()
+ .withStatus(204)));
+ }
+
+ public static void MockPatchAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
+ stubFor(patch(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+
+ public static void MockQueryAllottedResourceById(String allottedResourceId, String responseFile){
+ stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=allotted-resource[&]filter=id:EQUALS:" + allottedResourceId))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+
+ /**
+ * Service Instance Mock StubResponses below
+ */
+ public static void MockGetServiceInstance(String globalCustId, String subscriptionType, String serviceInstanceId, String responseFile) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetServiceInstance_404(String customer, String serviceSubscription, String serviceInstanceId){
+ stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
+ .willReturn(aResponse()
+ .withStatus(404)));
+ }
+
+ public static void MockGetServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId){
+ stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
+ .willReturn(aResponse()
+ .withStatus(500)));
+ }
+
+ public static void MockGetServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId, String responseFile){
+ stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
+ .willReturn(aResponse()
+ .withStatus(500)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockNodeQueryServiceInstanceByName(String serviceInstanceName, String responseFile){
+ stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance[&]filter=service-instance-name:EQUALS:" + serviceInstanceName))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockNodeQueryServiceInstanceByName_404(String serviceInstanceName){
+ stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-name:EQUALS:" + serviceInstanceName))
+ .willReturn(aResponse()
+ .withStatus(404)));
+ }
+
+ public static void MockNodeQueryServiceInstanceByName_500(String serviceInstanceName){
+ stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-name:EQUALS:" + serviceInstanceName))
+ .willReturn(aResponse()
+ .withStatus(500)));
+ }
+
+ public static void MockNodeQueryServiceInstanceById(String serviceInstanceId, String responseFile){
+ stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance[&]filter=service-instance-id:EQUALS:" + serviceInstanceId))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockNodeQueryServiceInstanceById_404(String serviceInstanceId){
+ stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-id:EQUALS:" + serviceInstanceId))
+ .willReturn(aResponse()
+ .withStatus(404)));
+ }
+
+ public static void MockNodeQueryServiceInstanceById_500(String serviceInstanceId){
+ stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-id:EQUALS:" + serviceInstanceId))
+ .willReturn(aResponse()
+ .withStatus(500)));
+ }
+
+ public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
+ stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
+ .willReturn(aResponse()
+ .withStatus(204)));
+ }
+
+ public static void MockGetServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){
+ stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
+ .willReturn(aResponse()
+ .withStatus(statusCode)));
+ }
+
+ public static void MockGetServiceInstance(String customer, String serviceSubscription, String resourceVersion, int statusCode){
+ stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "[?]resource-version=" + resourceVersion))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")));
+ }
+
+ public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){
+ stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
+ .willReturn(aResponse()
+ .withStatus(statusCode)));
+ }
+
+ public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String resourceVersion, int statusCode){
+ stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "[?]resource-version=" +1234))
+ .willReturn(aResponse()
+ .withStatus(statusCode)));
+ }
+
+ public static void MockDeleteServiceInstance_404(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
+ stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
+ .willReturn(aResponse()
+ .withStatus(404)));
+ }
+
+ public static void MockDeleteServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
+ stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
+ .willReturn(aResponse()
+ .withStatus(500)));
+ }
+
+ public static void MockPutServiceInstance(String globalCustId, String subscriptionType, String serviceInstanceId, String responseFile) {
+ stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockPutServiceInstance_500(String globalCustId, String subscriptionType, String serviceInstanceId) {
+ stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
+ .willReturn(aResponse()
+ .withStatus(500)));
+ }
+
+ /**
+ * Service-Subscription Mock StubResponses below
+ */
+ public static void MockGetServiceSubscription(String globalCustId, String subscriptionType, String responseFile) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockDeleteServiceSubscription(String globalCustId, String subscriptionType, int statusCode) {
+ stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
+ .willReturn(aResponse()
+ .withStatus(statusCode)));
+ }
+
+ public static void MockDeleteServiceInstanceId(String globalCustId, String subscriptionType, String serviceInstanceId) {
+ stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+
+ public static void MockPutServiceSubscription(String globalCustId, String subscriptionType) {
+ stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+
+ public static void MockGetServiceSubscription(String globalCustId, String subscriptionType, int statusCode) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
+ .willReturn(aResponse()
+ .withStatus(statusCode)));
+ }
+
+ /**
+ * Customer Mock StubResponses below
+ */
+ public static void MockGetCustomer(String globalCustId, String responseFile) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockDeleteCustomer(String globalCustId) {
+ stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+
+ public static void MockPutCustomer(String globalCustId) {
+ stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+
+ public static void MockPutCustomer_500(String globalCustId) {
+ stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
+ .willReturn(aResponse()
+ .withStatus(500)));
+ }
+
+
+ /**
+ * Generic-Vnf Mock StubResponses below
+ */
+
+ public static void MockGetGenericVnfById(String vnfId, String responseFile){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=1"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetGenericVnfById(String vnfId, String responseFile, int statusCode){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetGenericVnfByIdWithPriority(String vnfId, int statusCode, String responseFile) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
+ .atPriority(1)
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetGenericVnfByIdWithPriority(String vnfId, String vfModuleId, int statusCode, String responseFile, int priority) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
+ .atPriority(priority)
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetGenericVnfByIdWithDepth(String vnfId, int depth, String responseFile){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=" + depth))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetGenericVnfById_404(String vnfId){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
+ .willReturn(aResponse()
+ .withStatus(404)));
+ }
+
+ public static void MockGetGenericVnfById_500(String vnfId){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
+ .willReturn(aResponse()
+ .withStatus(500)));
+ }
+
+ public static void MockGetGenericVnfByName(String vnfName, String responseFile){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetGenericVnfByNameWithDepth(String vnfName, int depth, String responseFile){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName + "[&]depth=" + depth))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetGenericVnfByName_404(String vnfName){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName))
+ .willReturn(aResponse()
+ .withStatus(404)));
+ }
+
+ public static void MockDeleteGenericVnf(String vnfId, String resourceVersion){
+ stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
+ .willReturn(aResponse()
+ .withStatus(204)));
+ }
+
+ public static void MockDeleteGenericVnf(String vnfId, String resourceVersion, int statusCode){
+ stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
+ .willReturn(aResponse()
+ .withStatus(statusCode)));
+ }
+
+ public static void MockDeleteGenericVnf_500(String vnfId, String resourceVersion){
+ stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
+ .willReturn(aResponse()
+ .withStatus(500)));
+ }
+
+ public static void MockPutGenericVnf(String vnfId){
+ stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+
+ public static void MockPutGenericVnf(String vnfId, String requestBodyContaining, int statusCode) {
+ stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
+ .withRequestBody(containing(requestBodyContaining))
+ .willReturn(aResponse()
+ .withStatus(statusCode)));
+ }
+
+ public static void MockPutGenericVnf(String vnfId, int statusCode) {
+ stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
+ .willReturn(aResponse()
+ .withStatus(statusCode)));
+ }
+
+ public static void MockPutGenericVnf_Bad(String vnfId, int statusCode){
+ stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
+ .willReturn(aResponse()
+ .withStatus(statusCode)));
+ }
+
+ public static void MockPatchGenericVnf(String vnfId){
+ stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+ /**
+ * Vce Mock StubResponses below
+ */
+ public static void MockGetVceById(String vnfId, String responseFile){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetVceByName(String vnfName, String responseFile){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=" + vnfName))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockDeleteVce(String vnfId, String resourceVersion, int statusCode){
+ stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId + "[?]resource-version=" + resourceVersion))
+ .willReturn(aResponse()
+ .withStatus(statusCode)));
+ }
+
+ public static void MockPutVce(String vnfId){
+ stubFor(put(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+
+ public static void MockGetGenericVceByNameWithDepth(String vnfName, int depth, String responseFile){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=" + vnfName + "[&]depth=" + depth))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetVceGenericQuery(String serviceInstanceName, int depth, int statusCode, String responseFile){
+ stubFor(get(urlMatching("/aai/v[0-9]+/search/generic-query[?]key=service-instance.service-instance-name:" + serviceInstanceName + "[&]start-node-type=service-instance[&]include=vce[&]depth=" + depth))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ /**
+ * Tenant Mock StubResponses below
+ */
+ public static void MockGetTenantGenericQuery(String customer, String serviceType, String responseFile) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/search/generic-query[?]key=customer.global-customer-id:" + customer + "&key=service-subscription.service-type:" + serviceType + "&start-node-type=service-subscription&include=tenant&include=service-subscription&depth=1"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetTenant(String tenantId, String responseFile) {
+ stubFor(get(urlEqualTo("/aai/v2/cloud-infrastructure/tenants/tenant/" + tenantId))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ /**
+ * Network Mock StubResponses below
+ */
+ public static void MockGetNetwork(String networkId, String responseFile, int statusCode) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetNetworkByIdWithDepth(String networkId, String responseFile, String depth) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId + "[?]depth=" + depth))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetNetworkCloudRegion(String responseFile, String cloudRegion) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegion))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetNetworkByName(String networkName, String responseFile) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name="+networkName))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetNetworkByName_404(String responseFile, String networkName) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name="+networkName))
+ .willReturn(aResponse()
+ .withStatus(404)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetNetworkCloudRegion_404(String cloudRegion) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegion))
+ .willReturn(aResponse()
+ .withStatus(404)));
+ }
+
+ public static void MockPutNetwork(String networkId, int statusCode, String responseFile) {
+ stubFor(put(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockPutNetwork(String networkPolicyId, String responseFile, int statusCode) {
+ stubFor(put(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/" + networkPolicyId))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetNetworkName(String networkPolicyName, String responseFile, int statusCode) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name=" + networkPolicyName))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetNetworkVpnBinding(String responseFile, String vpnBinding) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/vpn-bindings/vpn-binding/"+vpnBinding + "[?]depth=all"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetNetworkPolicy(String responseFile, String policy) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/"+policy + "[?]depth=all"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetNetworkVpnBinding(String networkBindingId, String responseFile, int statusCode) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/vpn-bindings/vpn-binding/" + networkBindingId))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetNetworkPolicy(String networkPolicy, String responseFile, int statusCode) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/" + networkPolicy))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetNetworkTableReference(String responseFile, String tableReference) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/route-table-references/route-table-reference/"+tableReference + "[?]depth=all"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockPutNetworkIdWithDepth(String responseFile, String networkId, String depth) {
+ stubFor(put(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/"+networkId+"[?]depth="+depth ))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetNetworkPolicyfqdn(String networkPolicy, String responseFile, int statusCode) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy[?]network-policy-fqdn=" + networkPolicy))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetNetworkRouteTable(String networkRouteId, String responseFile, int statusCode) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/route-table-references/route-table-reference/" + networkRouteId))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockPatchVfModuleId(String vnfId, String vfModuleId) {
+ stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+
+ /////////////
+
+ public static void MockVNFAdapterRestVfModule() {
+ stubFor(put(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules/supercool"))
+ .willReturn(aResponse()
+ .withStatus(202)
+ .withHeader("Content-Type", "application/xml")));
+ stubFor(post(urlMatching("/vnfs/v1/vnfs/.*/vf-modules"))
+ .willReturn(aResponse()
+ .withStatus(202)
+ .withHeader("Content-Type", "application/xml")));
+ stubFor(post(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules"))
+ .willReturn(aResponse()
+ .withStatus(202)
+ .withHeader("Content-Type", "application/xml")));
+ stubFor(put(urlEqualTo("/vnfs/v1/volume-groups/78987"))
+ .willReturn(aResponse()
+ .withStatus(202)
+ .withHeader("Content-Type", "application/xml")));
+ }
+
+ public static void MockDBUpdateVfModule(){
+ stubFor(post(urlEqualTo("/dbadapters/RequestsDbAdapter"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VfModularity/DBUpdateResponse.xml")));
+ }
+
+ // start of mocks used locally and by other VF Module unit tests
+ public static void MockSDNCAdapterVfModule() {
+ // simplified the implementation to return "success" for all requests
+ stubFor(post(urlEqualTo("/SDNCAdapter"))
+// .withRequestBody(containing("SvcInstanceId><"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
+
+ }
+
+ // start of mocks used locally and by other VF Module unit tests
+ public static void MockAAIVfModule() {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool"))
+ .atPriority(1)
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VfModularity/VfModule-supercool.xml")));
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/lukewarm"))
+ .atPriority(2)
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VfModularity/VfModule-lukewarm.xml")));
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
+ .atPriority(5)
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VfModularity/VfModule-new.xml")));
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask[?]depth=1"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VfModularity/GenericVnf.xml")));
+ stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool"))
+// .withRequestBody(containing("PCRF"))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
+// .withRequestBody(containing("PCRF"))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ // HTTP PUT stub still used by CreateAAIvfModuleVolumeGroup
+ stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
+ .withRequestBody(containing("PCRF"))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ // HTTP PUT stub still used by DoCreateVfModuleTest
+ stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
+ .withRequestBody(containing("MODULELABEL"))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group[?]volume-group-id=78987"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VfModularity/ConfirmVolumeGroupTenantResponse.xml")));
+ stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group[?]volume-group-id=78987"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VfModularity/ConfirmVolumeGroupTenantResponse.xml")));
+ stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/MDTWNJ21/volume-groups/volume-group/78987"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VfModularity/VolumeGroup.xml")));
+ stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups/volume-group/78987"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VfModularity/VolumeGroup.xml")));
+ stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group/78987[?]resource-version=0000020"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("DeleteCinderVolumeV1/DeleteVolumeId_AAIResponse_Success.xml")));
+ stubFor(put(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/.*"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("VfModularity/AddNetworkPolicy_AAIResponse_Success.xml")));
+ stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/NEWvBNGModuleId"))
+ .withRequestBody(containing("NEWvBNGModuleId"))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+
+
+
+ //////////////
+
+ /**
+ * Cloud infrastructure below
+ */
+
+ public static void MockGetCloudRegion(String cloudRegionId, int statusCode, String responseFile) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ /**
+ * Volume Group StubResponse below
+ */
+ public static void MockGetVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockPutVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile, int statusCode) {
+ stubFor(put(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetVolumeGroupByName(String cloudRegionId, String volumeGroupName, String responseFile, int statusCode) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockDeleteVolumeGroupById(String cloudRegionId, String volumeGroupId, String resourceVersion, int statusCode) {
+ stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))
+ .willReturn(aResponse()
+ .withStatus(statusCode)));
+ }
+
+ public static void MockGetVolumeGroupByName_404(String cloudRegionId, String volumeGroupName) {
+ stubFor(get(urlMatching("/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName))
+ .willReturn(aResponse()
+ .withStatus(404)));
+ }
+
+ public static void MockDeleteVolumeGroup(String cloudRegionId, String volumeGroupId, String resourceVersion) {
+ stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+
+ /**
+ * VF-Module StubResponse below
+ * @param statusCode TODO
+ */
+ public static void MockGetVfModuleId(String vnfId, String vfModuleId, String responseFile, int statusCode) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetVfModuleByNameWithDepth(String vnfId, String vfModuleName, int depth, String responseFile, int statusCode) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module[?]vf-module-name=" + vfModuleName + "[?]depth=" + depth))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetVfModuleIdNoResponse(String vnfId, String requestContaining, String vfModuleId) {
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
+ .withRequestBody(containing(requestContaining))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")));
+ }
+
+ public static void MockPutVfModuleIdNoResponse(String vnfId, String requestContaining, String vfModuleId) {
+ stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId +"/vf-modules/vf-module/" +vfModuleId))
+ .withRequestBody(containing(requestContaining))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+
+ public static void MockPutVfModuleId(String vnfId, String vfModuleId) {
+ stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+
+ public static void MockPutVfModuleId(String vnfId, String vfModuleId, int returnCode) {
+ stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
+ .willReturn(aResponse()
+ .withStatus(returnCode)));
+ }
+
+ public static void MockDeleteVfModuleId(String vnfId, String vfModuleId, String resourceVersion, int returnCode) {
+ stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId + "/[?]resource-version=" + resourceVersion))
+ .willReturn(aResponse()
+ .withStatus(returnCode)));
+ }
+
+ public static void MockAAIVfModuleBadPatch(String endpoint, int statusCode) {
+ stubFor(patch(urlMatching(endpoint))
+ .willReturn(aResponse()
+ .withStatus(statusCode)));
+ }
+
+ /* AAI Pserver Queries */
+ public static void MockGetPserverByVnfId(String vnfId, String responseFile, int statusCode) {
+ stubFor(put(urlMatching("/v10/query.*"))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "application/json")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockGetGenericVnfsByVnfId(String vnfId, String responseFile, int statusCode) {
+ stubFor(get(urlMatching("/v10/network/generic-vnfs/.*"))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "application/json; charset=utf-8")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void MockSetInMaintFlagByVnfId(String vnfId, int statusCode) {
+ stubFor(patch(urlMatching("/v10/network/generic-vnfs/.*"))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ ));
+ }
+
+ //// Deprecated Stubs below - to be deleted once unit test that reference them are refactored to use common ones above ////
+ @Deprecated
+ public static void MockGetVceById(){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123?depth=1"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("GenericFlows/getVceResponse.xml")));
+ }
+ @Deprecated
+ public static void MockGetVceByName(){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=testVnfName123"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("GenericFlows/getVceByNameResponse.xml")));
+ }
+ @Deprecated
+ public static void MockPutVce(){
+ stubFor(put(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123"))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+ @Deprecated
+ public static void MockDeleteVce(){
+ stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123[?]resource-version=testReVer123"))
+ .willReturn(aResponse()
+ .withStatus(204)));
+ }
+ @Deprecated
+ public static void MockDeleteVce_404(){
+ stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123[?]resource-version=testReVer123"))
+ .willReturn(aResponse()
+ .withStatus(404)));
+ }
+
+ @Deprecated
+ public static void MockDeleteServiceSubscription(){
+ stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET[?]resource-version=1234"))
+ .willReturn(aResponse()
+ .withStatus(204)));
+ }
+ @Deprecated
+ public static void MockGetServiceSubscription(){
+ stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("GenericFlows/getServiceSubscription.xml")));
+ }
+ @Deprecated
+ public static void MockGetServiceSubscription_200Empty(){
+ stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET[?]resource-version=1234"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBody(" ")));
+ }
+ @Deprecated
+ public static void MockGetServiceSubscription_404() {
+ stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))
+ .willReturn(aResponse()
+ .withStatus(404)));
+ }
+ @Deprecated
+ public static void MockGENPSIPutServiceInstance(){
+ stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml")));
+ }
+
+ @Deprecated
+ public static void MockGENPSIPutServiceSubscription(){
+ stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml")));
+ }
+ @Deprecated
+ public static void MockGENPSIPutServiceInstance_get500(){
+ stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET"))
+ .willReturn(aResponse()
+ .withStatus(500)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("GenericPutServiceInstance/aaiFault.xml")));
+ }
+
+ @Deprecated
+ public static void MockGetGenericVnfById(){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("GenericFlows/getGenericVnfByNameResponse.xml")));
+ }
+ @Deprecated
+ public static void MockGetGenericVnfById_404(){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
+ .willReturn(aResponse()
+ .withStatus(404)));
+ }
+ @Deprecated
+ public static void MockGetGenericVnfByName(){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("GenericFlows/getGenericVnfResponse.xml")));
+ }
+ @Deprecated
+ public static void MockGetGenericVnfByName_hasRelationships(){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("GenericFlows/getGenericVnfResponse_hasRelationships.xml")));
+ }
+ @Deprecated
+ public static void MockGetGenericVnfById_hasRelationships(){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile("GenericFlows/getGenericVnfResponse_hasRelationships.xml")));
+ }
+ @Deprecated
+ public static void MockGetGenericVnfById_500(){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
+ .willReturn(aResponse()
+ .withStatus(500)));
+ }
+ @Deprecated
+ public static void MockGetGenericVnfByName_404(){
+ stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
+ .willReturn(aResponse()
+ .withStatus(404)));
+ }
+ @Deprecated
+ public static void MockPutGenericVnf(){
+ stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+ @Deprecated
+ public static void MockPutGenericVnf_400(){
+ stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
+ .willReturn(aResponse()
+ .withStatus(400)));
+ }
+ @Deprecated
+ public static void MockDeleteGenericVnf(){
+ stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))
+ .willReturn(aResponse()
+ .withStatus(204)));
+ }
+ @Deprecated
+ public static void MockDeleteGenericVnf_404(){
+ stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))
+ .willReturn(aResponse()
+ .withStatus(404)));
+ }
+ @Deprecated
+ public static void MockDeleteGenericVnf_500(){
+ stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))
+ .willReturn(aResponse()
+ .withStatus(500)));
+ }
+ @Deprecated
+ public static void MockDeleteGenericVnf_412(){
+ stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[[?]]resource-version=testReVer123"))
+ .willReturn(aResponse()
+ .withStatus(412)));
+ }
+
+}
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseDatabase.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseDatabase.java
index c9f64d9b26..c9f64d9b26 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseDatabase.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseDatabase.java
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseNetworkAdapter.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseNetworkAdapter.java
index 8baeb1b137..8baeb1b137 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseNetworkAdapter.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseNetworkAdapter.java
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponsePolicy.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponsePolicy.java
index 38b81c54c6..fdaede1b39 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponsePolicy.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponsePolicy.java
@@ -1,94 +1,94 @@
-/*
- * ============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.openecomp.mso.bpmn.mock;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.containing;
-import static com.github.tomakehurst.wiremock.client.WireMock.delete;
-import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.patch;
-import static com.github.tomakehurst.wiremock.client.WireMock.put;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
-
-/**
- * Reusable Mock StubResponses for Policy
- *
- */
-public class StubResponsePolicy {
-
- public static void setupAllMocks() {
-
- }
-
- // start of Policy mocks
- public static void MockPolicyAbort() {
- stubFor(post(urlEqualTo("/pdp/api/getDecision"))
- .withRequestBody(containing("BB1"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "application/json")
- .withBodyFile("policyAbortResponse.json")));
-
- stubFor(post(urlEqualTo("/pdp/api/getDecision"))
- .withRequestBody(containing("UPDVnfI"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "application/json")
- .withBodyFile("policyAbortResponse.json")));
-
- stubFor(post(urlEqualTo("/pdp/api/getDecision"))
- .withRequestBody(containing("RPLVnfI"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "application/json")
- .withBodyFile("policyAbortResponse.json")));
-
-
- }
-
- public static void MockPolicySkip() {
- stubFor(post(urlEqualTo("/pdp/api/getDecision"))
- .withRequestBody(containing("BB1"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "application/json")
- .withBodyFile("Policy/policySkipResponse.json")));
-
- stubFor(post(urlEqualTo("/pdp/api/getDecision"))
- .withRequestBody(containing("UPDVnfI"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "application/json")
- .withBodyFile("Policy/policySkipResponse.json")));
-
- stubFor(post(urlEqualTo("/pdp/api/getDecision"))
- .withRequestBody(containing("RPLVnfI"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "application/json")
- .withBodyFile("Policy/policySkipResponse.json")));
-
-
- }
-
-
-}
+/*
+ * ============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.openecomp.mso.bpmn.mock;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.containing;
+import static com.github.tomakehurst.wiremock.client.WireMock.delete;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.patch;
+import static com.github.tomakehurst.wiremock.client.WireMock.put;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+
+/**
+ * Reusable Mock StubResponses for Policy
+ *
+ */
+public class StubResponsePolicy {
+
+ public static void setupAllMocks() {
+
+ }
+
+ // start of Policy mocks
+ public static void MockPolicyAbort() {
+ stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+ .withRequestBody(containing("BB1"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "application/json")
+ .withBodyFile("policyAbortResponse.json")));
+
+ stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+ .withRequestBody(containing("UPDVnfI"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "application/json")
+ .withBodyFile("policyAbortResponse.json")));
+
+ stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+ .withRequestBody(containing("RPLVnfI"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "application/json")
+ .withBodyFile("policyAbortResponse.json")));
+
+
+ }
+
+ public static void MockPolicySkip() {
+ stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+ .withRequestBody(containing("BB1"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "application/json")
+ .withBodyFile("Policy/policySkipResponse.json")));
+
+ stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+ .withRequestBody(containing("UPDVnfI"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "application/json")
+ .withBodyFile("Policy/policySkipResponse.json")));
+
+ stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+ .withRequestBody(containing("RPLVnfI"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "application/json")
+ .withBodyFile("Policy/policySkipResponse.json")));
+
+
+ }
+
+
+}
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseSDNCAdapter.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseSDNCAdapter.java
index f41d6d7dba..f41d6d7dba 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseSDNCAdapter.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseSDNCAdapter.java
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseSNIRO.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseSNIRO.java
index a8f4db80aa..c16ac43d41 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseSNIRO.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseSNIRO.java
@@ -1,69 +1,69 @@
-/*
- * ============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=========================================================
- */
-
-/*
- * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
- */
-package org.openecomp.mso.bpmn.mock;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-
-/**
- * Please describe the StubResponseSNIRO.java class
- *
- * @author cb645j
- */
-public class StubResponseSNIRO {
-
- public static void setupAllMocks() {
-
- }
-
- public static void mockSNIRO() {
- stubFor(post(urlEqualTo("/sniro/api/v2/placement"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/json")));
- }
-
- public static void mockSNIRO(String responseFile) {
- stubFor(post(urlEqualTo("/sniro/api/v2/placement"))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/json")
- .withBodyFile(responseFile)));
- }
-
- public static void mockSNIRO_400() {
- stubFor(post(urlEqualTo("/sniro/api/v2/placement"))
- .willReturn(aResponse()
- .withStatus(400)
- .withHeader("Content-Type", "application/json")));
- }
-
- public static void mockSNIRO_500() {
- stubFor(post(urlEqualTo("/sniro/api/v2/placement"))
- .willReturn(aResponse()
- .withStatus(500)
- .withHeader("Content-Type", "application/json")));
- }
-
-}
+/*
+ * ============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=========================================================
+ */
+
+/*
+ * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
+ */
+package org.openecomp.mso.bpmn.mock;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+
+/**
+ * Please describe the StubResponseSNIRO.java class
+ *
+ * @author cb645j
+ */
+public class StubResponseSNIRO {
+
+ public static void setupAllMocks() {
+
+ }
+
+ public static void mockSNIRO() {
+ stubFor(post(urlEqualTo("/sniro/api/v2/placement"))
+ .willReturn(aResponse()
+ .withStatus(202)
+ .withHeader("Content-Type", "application/json")));
+ }
+
+ public static void mockSNIRO(String responseFile) {
+ stubFor(post(urlEqualTo("/sniro/api/v2/placement"))
+ .willReturn(aResponse()
+ .withStatus(202)
+ .withHeader("Content-Type", "application/json")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void mockSNIRO_400() {
+ stubFor(post(urlEqualTo("/sniro/api/v2/placement"))
+ .willReturn(aResponse()
+ .withStatus(400)
+ .withHeader("Content-Type", "application/json")));
+ }
+
+ public static void mockSNIRO_500() {
+ stubFor(post(urlEqualTo("/sniro/api/v2/placement"))
+ .willReturn(aResponse()
+ .withStatus(500)
+ .withHeader("Content-Type", "application/json")));
+ }
+
+}
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseVNFAdapter.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseVNFAdapter.java
index b4aca5081e..b4aca5081e 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseVNFAdapter.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseVNFAdapter.java
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterCreateMockTransformer.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterCreateMockTransformer.java
index 23921da8d8..23921da8d8 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterCreateMockTransformer.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterCreateMockTransformer.java
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterDeleteMockTransformer.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterDeleteMockTransformer.java
index ee6972e46e..ee6972e46e 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterDeleteMockTransformer.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterDeleteMockTransformer.java
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterQueryMockTransformer.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterQueryMockTransformer.java
index 1582071d3a..1582071d3a 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterQueryMockTransformer.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterQueryMockTransformer.java
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterRollbackMockTransformer.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterRollbackMockTransformer.java
index 186fd35b6f..186fd35b6f 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterRollbackMockTransformer.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterRollbackMockTransformer.java
diff --git a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterUpdateMockTransformer.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterUpdateMockTransformer.java
index 7808b47d24..7808b47d24 100644
--- a/bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterUpdateMockTransformer.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterUpdateMockTransformer.java
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/policy/PolicyDecisionTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/policy/PolicyDecisionTest.java
deleted file mode 100644
index 8370f74851..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/policy/PolicyDecisionTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T 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.openecomp.mso.client.policy;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Map;
-
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-public class PolicyDecisionTest {
-
- @BeforeClass
- public static void setUp() {
- System.setProperty("mso.config.path", "src/test/resources");
- }
- @Test
- public void successReadProperties() throws IOException, Exception {
- PolicyRestClient client = new PolicyRestClient();
- Map<String, String> headerMap = client.headerMap;
-
- assertEquals("Found expected Client Auth", headerMap.get("ClientAuth"), "Basic bTAzNzQzOnBvbGljeVIwY2sk");
- assertEquals("Found expected Authorization", headerMap.get("Authorization"), "Basic dGVzdHBkcDphbHBoYTEyMw==");
- assertEquals("Found expected Environment", headerMap.get("Environment"), "TEST");
- assertEquals("Has X-ECOMP-RequestID", headerMap.containsKey("X-ECOMP-RequestID"), true);
- }
-
- @Test
- @Ignore // IGNORED FOR 1710 MERGE TO ONAP
- public void restEndpointCall() throws IOException, Exception {
- PolicyRestClient client = new PolicyRestClient();
- PolicyDecision decision = client.getDecision("X", "Y", "BB1", "1", "123");
- assertEquals("Decision is correct", decision.getDecision(), "PERMIT");
- assertEquals("Decision details is correct", decision.getDetails(), "Abort");
- }
-/*
- @Test
- public void failure() throws IOException, Exception {
- when(dmaapConsumer.getMRConsumer()).thenReturn(mrConsumer);
- when(mrConsumer.fetch())
- .thenReturn(Arrays.asList(new String[] { getJson("response.json"), getJson("output-failure.json") }));
-
- SDNOValidatorImpl validator = new SDNOValidatorImpl();
- thrown.expect(SDNOException.class);
- thrown.expectMessage("my message");
- boolean result = validator.pollForResponse(dmaapConsumer, "xyz123");
-
- }*/
-}
diff --git a/bpmn/MSOInfrastructureBPMN/pom.xml b/bpmn/MSOInfrastructureBPMN/pom.xml
index 5ba7c3aae2..53888dd23e 100644
--- a/bpmn/MSOInfrastructureBPMN/pom.xml
+++ b/bpmn/MSOInfrastructureBPMN/pom.xml
@@ -329,13 +329,6 @@
<version>4.3.2.RELEASE</version>
</dependency>
<dependency>
- <groupId>org.openecomp.so</groupId>
- <artifactId>MSOMockServer</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <classifier>classes</classifier>
- </dependency>
- <dependency>
<groupId>org.openecomp.so</groupId>
<artifactId>MSORESTClient</artifactId>
<version>${project.version}</version>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnfAndModules.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnfAndModules.groovy
index d74174dcee..862c46ad19 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnfAndModules.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnfAndModules.groovy
@@ -63,9 +63,9 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
* @param - execution
*/
public void preProcessRequest(Execution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+ def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
- utils.log("DEBUG", " *** STARTED DoCreateVnfAndModules PreProcessRequest Process*** ", isDebugEnabled)
+ utils.log("DEBUG", " *** STARTED DoCreateVnfAndModules PreProcessRequest Process*** ", isDebugLogEnabled)
setBasicDBAuthHeader(execution, isDebugLogEnabled)
try{
@@ -78,21 +78,21 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
String requestId = execution.getVariable("msoRequestId")
execution.setVariable("requestId", requestId)
execution.setVariable("mso-request-id", requestId)
- utils.log("DEBUG", "Incoming Request Id is: " + requestId, isDebugEnabled)
+ utils.log("DEBUG", "Incoming Request Id is: " + requestId, isDebugLogEnabled)
String serviceInstanceId = execution.getVariable("serviceInstanceId")
- utils.log("DEBUG", "Incoming Service Instance Id is: " + serviceInstanceId, isDebugEnabled)
+ utils.log("DEBUG", "Incoming Service Instance Id is: " + serviceInstanceId, isDebugLogEnabled)
String vnfName = execution.getVariable("vnfName")
execution.setVariable("CREVI_vnfName", vnfName)
- utils.log("DEBUG", "Incoming Vnf Name is: " + vnfName, isDebugEnabled)
+ utils.log("DEBUG", "Incoming Vnf Name is: " + vnfName, isDebugLogEnabled)
String productFamilyId = execution.getVariable("productFamilyId")
- utils.log("DEBUG", "Incoming Product Family Id is: " + productFamilyId, isDebugEnabled)
+ utils.log("DEBUG", "Incoming Product Family Id is: " + productFamilyId, isDebugLogEnabled)
String source = "VID"
execution.setVariable("source", source)
- utils.log("DEBUG", "Incoming Source is: " + source, isDebugEnabled)
+ utils.log("DEBUG", "Incoming Source is: " + source, isDebugLogEnabled)
String lcpCloudRegionId = execution.getVariable("lcpCloudRegionId")
utils.log("DEBUG", "Incoming LCP Cloud Region Id is: " + lcpCloudRegionId)
@@ -101,17 +101,17 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
utils.log("DEBUG", "Incoming Tenant Id is: " + tenantId)
String disableRollback = execution.getVariable("disableRollback")
- utils.log("DEBUG", "Incoming Disable Rollback is: " + disableRollback, isDebugEnabled)
+ utils.log("DEBUG", "Incoming Disable Rollback is: " + disableRollback, isDebugLogEnabled)
String asdcServiceModelVersion = execution.getVariable("asdcServiceModelVersion")
- utils.log("DEBUG", "Incoming asdcServiceModelVersion: " + asdcServiceModelVersion, isDebugEnabled)
+ utils.log("DEBUG", "Incoming asdcServiceModelVersion: " + asdcServiceModelVersion, isDebugLogEnabled)
String vnfId = execution.getVariable("testVnfId") // for junits
if(isBlank(vnfId)){
vnfId = execution.getVariable("vnfId")
if (isBlank(vnfId)) {
vnfId = UUID.randomUUID().toString()
- utils.log("DEBUG", "Generated Vnf Id is: " + vnfId, isDebugEnabled)
+ utils.log("DEBUG", "Generated Vnf Id is: " + vnfId, isDebugLogEnabled)
}
}
execution.setVariable("vnfId", vnfId)
@@ -135,50 +135,50 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
}catch(BpmnError b){
- utils.log("DEBUG", "Rethrowing MSOWorkflowException", isDebugEnabled)
+ utils.log("DEBUG", "Rethrowing MSOWorkflowException", isDebugLogEnabled)
throw b
}catch(Exception e){
- utils.log("DEBUG", " Error Occured in DoCreateVnfAndModules PreProcessRequest method!" + e.getMessage(), isDebugEnabled)
+ utils.log("DEBUG", " Error Occured in DoCreateVnfAndModules PreProcessRequest method!" + e.getMessage(), isDebugLogEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf PreProcessRequest")
}
- utils.log("DEBUG", "*** COMPLETED DoCreateVnfAndModules PreProcessRequest Process ***", isDebugEnabled)
+ utils.log("DEBUG", "*** COMPLETED DoCreateVnfAndModules PreProcessRequest Process ***", isDebugLogEnabled)
}
public void queryCatalogDB (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
- utils.log("DEBUG", " *** STARTED DoCreateVnfAndModules QueryCatalogDB Process *** ", isDebugEnabled)
+ utils.log("DEBUG", " *** STARTED DoCreateVnfAndModules QueryCatalogDB Process *** ", isDebugLogEnabled)
try {
VnfResource vnf = null
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
// if serviceDecomposition is specified, get info from serviceDecomposition
if (serviceDecomposition != null) {
- utils.log("DEBUG", "Getting Catalog DB data from ServiceDecomposition object: " + serviceDecomposition.toJsonString(), isDebugEnabled)
+ utils.log("DEBUG", "Getting Catalog DB data from ServiceDecomposition object: " + serviceDecomposition.toJsonString(), isDebugLogEnabled)
List<VnfResource> vnfs = serviceDecomposition.getServiceVnfs()
- utils.log("DEBUG", "Read vnfs", isDebugEnabled)
+ utils.log("DEBUG", "Read vnfs", isDebugLogEnabled)
if (vnfs == null) {
- utils.log("DEBUG", "Error - vnfs are empty in serviceDecomposition object", isDebugEnabled)
+ utils.log("DEBUG", "Error - vnfs are empty in serviceDecomposition object", isDebugLogEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf queryCatalogDB, vnfs are empty")
}
vnf = vnfs[0]
String serviceModelName = serviceDecomposition.getModelInfo().getModelName()
vnf.constructVnfType(serviceModelName)
String vnfType = vnf.getVnfType()
- utils.log("DEBUG", "Incoming Vnf Type is: " + vnfType, isDebugEnabled)
+ utils.log("DEBUG", "Incoming Vnf Type is: " + vnfType, isDebugLogEnabled)
execution.setVariable("vnfType", vnfType)
}
else {
//Get Vnf Info
String vnfModelInfo = execution.getVariable("vnfModelInfo")
- utils.log("DEBUG", "vnfModelInfo: " + vnfModelInfo, isDebugEnabled)
+ utils.log("DEBUG", "vnfModelInfo: " + vnfModelInfo, isDebugLogEnabled)
String vnfModelCustomizationUuid = jsonUtil.getJsonValueForKey(vnfModelInfo, "modelCustomizationUuid")
if (vnfModelCustomizationUuid == null) {
vnfModelCustomizationUuid = ""
}
- utils.log("DEBUG", "querying Catalog DB by vnfModelCustomizationUuid: " + vnfModelCustomizationUuid, isDebugEnabled)
+ utils.log("DEBUG", "querying Catalog DB by vnfModelCustomizationUuid: " + vnfModelCustomizationUuid, isDebugLogEnabled)
JSONArray vnfs = cutils.getAllVnfsByVnfModelCustomizationUuid(execution,
vnfModelCustomizationUuid)
@@ -187,24 +187,24 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
JSONObject vnfObject = vnfs[0]
vnf = decomposeJsonUtil.JsonToVnfResource(vnfObject.toString())
}
- utils.log("DEBUG", "Read vnfResource", isDebugEnabled)
+ utils.log("DEBUG", "Read vnfResource", isDebugLogEnabled)
if (vnf == null) {
- utils.log("DEBUG", "Error - vnf is empty in serviceDecomposition object", isDebugEnabled)
+ utils.log("DEBUG", "Error - vnf is empty in serviceDecomposition object", isDebugLogEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf queryCatalogDB, vnf is null")
}
execution.setVariable("vnfResourceDecomposition", vnf)
List<ModuleResource> vfModules = vnf.getAllVfModuleObjects()
- utils.log("DEBUG", "Read vfModules", isDebugEnabled)
+ utils.log("DEBUG", "Read vfModules", isDebugLogEnabled)
if (vfModules == null) {
- utils.log("DEBUG", "Error - vfModules are empty in serviceDecomposition object", isDebugEnabled)
+ utils.log("DEBUG", "Error - vfModules are empty in serviceDecomposition object", isDebugLogEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf queryCatalogDB, vf modules are empty")
}
ModuleResource baseVfModule = null
for (int i = 0; i < vfModules.size; i++) {
- utils.log("DEBUG", "handling VF Module ", isDebugEnabled)
+ utils.log("DEBUG", "handling VF Module ", isDebugLogEnabled)
ModuleResource vfModule = vfModules[i]
boolean isBase = vfModule.getIsBase()
if (isBase) {
@@ -236,7 +236,7 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
execution.setVariable("addOnModulesDeployed", 0)
}catch(Exception ex) {
- utils.log("DEBUG", "Error Occured in DoCreateVnfAndModules QueryCatalogDB Process " + ex.getMessage(), isDebugEnabled)
+ utils.log("DEBUG", "Error Occured in DoCreateVnfAndModules QueryCatalogDB Process " + ex.getMessage(), isDebugLogEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnfAndModules QueryCatalogDB Process")
}
@@ -249,7 +249,7 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
execution.setVariable("vnfId", "skask")
}
- utils.log("DEBUG", "*** COMPLETED DoCreateVnfAndModules QueryCatalogDB Process ***", isDebugEnabled)
+ utils.log("DEBUG", "*** COMPLETED DoCreateVnfAndModules QueryCatalogDB Process ***", isDebugLogEnabled)
}
public void preProcessAddOnModule(Execution execution){
@@ -364,45 +364,45 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
}
public void preProcessRollback (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("DEBUG"," ***** preProcessRollback ***** ", isDebugEnabled)
+ def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG"," ***** preProcessRollback ***** ", isDebugLogEnabled)
try {
Object workflowException = execution.getVariable("WorkflowException");
if (workflowException instanceof WorkflowException) {
- utils.log("DEBUG", "Prev workflowException: " + workflowException.getErrorMessage(), isDebugEnabled)
+ utils.log("DEBUG", "Prev workflowException: " + workflowException.getErrorMessage(), isDebugLogEnabled)
execution.setVariable("prevWorkflowException", workflowException);
//execution.setVariable("WorkflowException", null);
}
} catch (BpmnError e) {
- utils.log("DEBUG", "BPMN Error during preProcessRollback", isDebugEnabled)
+ utils.log("DEBUG", "BPMN Error during preProcessRollback", isDebugLogEnabled)
} catch(Exception ex) {
String msg = "Exception in preProcessRollback. " + ex.getMessage()
- utils.log("DEBUG", msg, isDebugEnabled)
+ utils.log("DEBUG", msg, isDebugLogEnabled)
}
- utils.log("DEBUG"," *** Exit preProcessRollback *** ", isDebugEnabled)
+ utils.log("DEBUG"," *** Exit preProcessRollback *** ", isDebugLogEnabled)
}
public void postProcessRollback (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("DEBUG"," ***** postProcessRollback ***** ", isDebugEnabled)
+ def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG"," ***** postProcessRollback ***** ", isDebugLogEnabled)
String msg = ""
try {
Object workflowException = execution.getVariable("prevWorkflowException");
if (workflowException instanceof WorkflowException) {
- utils.log("DEBUG", "Setting prevException to WorkflowException: ", isDebugEnabled)
+ utils.log("DEBUG", "Setting prevException to WorkflowException: ", isDebugLogEnabled)
execution.setVariable("WorkflowException", workflowException);
}
execution.setVariable("rollbackData", null)
} catch (BpmnError b) {
- utils.log("DEBUG", "BPMN Error during postProcessRollback", isDebugEnabled)
+ utils.log("DEBUG", "BPMN Error during postProcessRollback", isDebugLogEnabled)
throw b;
} catch(Exception ex) {
msg = "Exception in postProcessRollback. " + ex.getMessage()
- utils.log("DEBUG", msg, isDebugEnabled)
+ utils.log("DEBUG", msg, isDebugLogEnabled)
}
- utils.log("DEBUG"," *** Exit postProcessRollback *** ", isDebugEnabled)
+ utils.log("DEBUG"," *** Exit postProcessRollback *** ", isDebugLogEnabled)
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy
index 8c158db1da..3f7ffbf28c 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy
@@ -230,19 +230,10 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
utils.logAudit("AAI endPoint: " + endPoint)
try {
- RESTConfig config = new RESTConfig(endPoint);
- def responseData = ''
- def aaiRequestId = UUID.randomUUID().toString()
- RESTClient client = new RESTClient(config).
- addHeader('X-TransactionId', aaiRequestId).
- addHeader('X-FromAppId', 'MSO').
- addHeader('Content-Type', 'application/xml').
- addHeader('Accept','application/xml');
- logDebug('sending GET to AAI endpoint \'' + endPoint + '\'', isDebugLogEnabled)
- APIResponse response = client.httpGet()
utils.logAudit("createVfModule - invoking httpGet() to AAI")
+ APIResponse response = aaiUriUtil.executeAAIGetCall(execution, endPoint)
- responseData = response.getResponseBodyAsString()
+ def responseData = response.getResponseBodyAsString()
if (responseData != null) {
logDebug("Received generic VNF data: " + responseData, isDebugLogEnabled)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
index 85ff43946d..703ea8be6d 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
@@ -40,6 +40,7 @@ import org.json.JSONArray;
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.util.UriUtils;
+import static org.apache.commons.lang3.StringUtils.*
/**
* This groovy class supports the <class>CreateVcpeResCustService.bpmn</class> process.
@@ -93,6 +94,16 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
// initialize flow variables
InitializeProcessVariables(execution)
+ //Config Inputs
+ String aaiDistDelay = execution.getVariable('URN_mso_workflow_aai_distribution_delay')
+ if (isBlank(aaiDistDelay)) {
+ msg = "URN_mso_workflow_aai_distribution_delay is null"
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ }
+ execution.setVariable("aaiDistDelay", aaiDistDelay)
+ utils.log("DEBUG","AAI distribution delay: " + aaiDistDelay, isDebugEnabled)
+
// check for incoming json message/input
String createVcpeServiceRequest = execution.getVariable("bpmnRequest")
utils.logAudit(createVcpeServiceRequest)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy
index 04eb4c7d7e..77ef3f6fe0 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy
@@ -135,10 +135,13 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
utils.log("DEBUG", "Incoming subscriptionServiceType is: " + subscriptionServiceType, isDebugEnabled)
// extract cloud configuration
- String lcpCloudRegionId = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.cloudConfiguration.lcpCloudRegionId")
+ String cloudConfiguration = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.cloudConfiguration")
+ execution.setVariable("cloudConfiguration", cloudConfiguration)
+ utils.log("DEBUG","cloudConfiguration: "+ cloudConfiguration, isDebugEnabled)
+ String lcpCloudRegionId = jsonUtil.getJsonValue(cloudConfiguration, "lcpCloudRegionId")
execution.setVariable("lcpCloudRegionId", lcpCloudRegionId)
utils.log("DEBUG","lcpCloudRegionId: "+ lcpCloudRegionId, isDebugEnabled)
- String tenantId = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.cloudConfiguration.tenantId")
+ String tenantId = jsonUtil.getJsonValue(cloudConfiguration, "tenantId")
execution.setVariable("tenantId", tenantId)
utils.log("DEBUG","tenantId: "+ tenantId, isDebugEnabled)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy
index b46721c88e..997757aa2c 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy
@@ -45,6 +45,8 @@ import static org.apache.commons.lang3.StringUtils.*
* @param - disableRollback
* @param - failExists - O
* @param - serviceInstanceId
+ * @param - globalCustomerId - O
+ * @param - subscriptionServiceType - O
* @param - parentServiceInstanceId
* @param - allottedReourceId - O
* @param - allottedResourceModelInfo
@@ -89,6 +91,15 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
utils.log("DEBUG","SDNC Callback URL: " + sdncCallbackUrl, isDebugEnabled)
+ String sdncReplDelay = execution.getVariable('URN_mso_workflow_sdnc_replication_delay')
+ if (isBlank(sdncReplDelay)) {
+ msg = "URN_mso_workflow_sdnc_replication_delay is null"
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ }
+ execution.setVariable("sdncReplDelay", sdncReplDelay)
+ utils.log("DEBUG","SDNC replication delay: " + sdncReplDelay, isDebugEnabled)
+
//Request Inputs
if (isBlank(execution.getVariable("serviceInstanceId"))){
msg = "Input serviceInstanceId is null"
@@ -312,6 +323,8 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
String allottedResourceId = execution.getVariable("allottedResourceId")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
+ String globalCustomerId = execution.getVariable("globalCustomerId")
+ String subscriptionServiceType = execution.getVariable("subscriptionServiceType")
String parentServiceInstanceId = execution.getVariable("parentServiceInstanceId")
String callbackUrl = execution.getVariable("sdncCallbackUrl")
String requestId = execution.getVariable("msoRequestId")
@@ -365,11 +378,11 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
</request-information>
<service-information>
<service-id></service-id>
- <subscription-service-type></subscription-service-type>
+ <subscription-service-type>${subscriptionServiceType}</subscription-service-type>
<onap-model-information></onap-model-information>
- <service-instance-id>${parentServiceInstanceId}</service-instance-id>
+ <service-instance-id>${serviceInstanceId}</service-instance-id>
<subscriber-name/>
- <global-customer-id></global-customer-id>
+ <global-customer-id>${globalCustomerId}</global-customer-id>
</service-information>
<allotted-resource-information>
<allotted-resource-id>${allottedResourceId}</allotted-resource-id>
@@ -562,11 +575,6 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
String serviceInstanceId = execution.getVariable("serviceInstanceId")
String sdncRequestId = UUID.randomUUID().toString()
-
- String tsleep = execution.getVariable("junitSleepMs")
-
- //workaround for sdnc replication issue
- sleep(tsleep == null ? 5000 : tsleep as Long)
//neeed the same url as used by vfmodules
String SDNCGetRequest =
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy
index c721ae833b..602df6bc1f 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy
@@ -45,6 +45,8 @@ import static org.apache.commons.lang3.StringUtils.*
* @param - disableRollback
* @param - failExists - O
* @param - serviceInstanceId
+ * @param - globalCustomerId - O
+ * @param - subscriptionServiceType - O
* @param - parentServiceInstanceId
* @param - allottedReourceId - O
* @param - allottedResourceModelInfo
@@ -80,18 +82,7 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
try {
String msoRequestId = execution.getVariable("msoRequestId")
utils.log("DEBUG", " msoRequestId = " + msoRequestId, isDebugEnabled)
-
- if ((msoRequestId == null) || ("testRequestId".equals(msoRequestId)) || ("testRequestId123".equals(msoRequestId)))
- {
- utils.log("DEBUG"," ***** NOT sleeping 30 seconds for Junit *****", isDebugEnabled)
- }
- else
- {
- utils.log("DEBUG"," ***** sleeping 30 seconds for AAI replication *****", isDebugEnabled)
- sleep(30000);
- utils.log("DEBUG"," ***** sleep over *****", isDebugEnabled)
- }
-
+
execution.setVariable("prefix", Prefix)
//Config Inputs
@@ -104,6 +95,15 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
utils.log("DEBUG","SDNC Callback URL: " + sdncCallbackUrl, isDebugEnabled)
+ String sdncReplDelay = execution.getVariable('URN_mso_workflow_sdnc_replication_delay')
+ if (isBlank(sdncReplDelay)) {
+ msg = "URN_mso_workflow_sdnc_replication_delay is null"
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ }
+ execution.setVariable("sdncReplDelay", sdncReplDelay)
+ utils.log("DEBUG","SDNC replication delay: " + sdncReplDelay, isDebugEnabled)
+
//Request Inputs
if (isBlank(execution.getVariable("serviceInstanceId"))){
msg = "Input serviceInstanceId is null"
@@ -318,6 +318,8 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
String allottedResourceId = execution.getVariable("allottedResourceId")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
+ String globalCustomerId = execution.getVariable("globalCustomerId")
+ String subscriptionServiceType = execution.getVariable("subscriptionServiceType")
String parentServiceInstanceId = execution.getVariable("parentServiceInstanceId")
String serviceChainServiceInstanceId = execution.getVariable("serviceChainServiceInstanceId")
String callbackUrl = execution.getVariable("sdncCallbackUrl")
@@ -370,11 +372,11 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
</request-information>
<service-information>
<service-id></service-id>
- <subscription-service-type></subscription-service-type>
+ <subscription-service-type>${subscriptionServiceType}</subscription-service-type>
<onap-model-information></onap-model-information>
- <service-instance-id>${parentServiceInstanceId}</service-instance-id>
+ <service-instance-id>${serviceInstanceId}</service-instance-id>
<subscriber-name/>
- <global-customer-id></global-customer-id>
+ <global-customer-id>${globalCustomerId}</global-customer-id>
</service-information>
<allotted-resource-information>
<allotted-resource-id>${allottedResourceId}</allotted-resource-id>
@@ -565,11 +567,6 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
String serviceInstanceId = execution.getVariable("serviceInstanceId")
String sdncRequestId = UUID.randomUUID().toString()
-
- String tsleep = execution.getVariable("junitSleepMs")
-
- //workaround for sdnc replication issue
- sleep(tsleep == null ? 5000 : tsleep as Long)
//neeed the same url as used by vfmodules
String SDNCGetRequest =
@@ -617,8 +614,8 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
String txca = utils.getNodeXml(arData, "tunnelxconn-assignments")
execution.setVariable("vni", utils.getNodeText1(txca, "vni"))
- execution.setVariable("vgmuxBearerIP", utils.getNodeText1(txca, "vgmux_bearer_ip"))
- execution.setVariable("vgmuxLanIP", utils.getNodeText1(txca, "vgmux_lan_ip"))
+ execution.setVariable("vgmuxBearerIP", utils.getNodeText1(txca, "vgmux-bearer-ip"))
+ execution.setVariable("vgmuxLanIP", utils.getNodeText1(txca, "vgmux-lan-ip"))
String ari = utils.getNodeXml(arData, "allotted-resource-identifiers")
execution.setVariable("allotedResourceName", utils.getNodeText1(ari, "allotted-resource-name"))
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowAsyncInfrastructureResource.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowAsyncInfrastructureResource.java
deleted file mode 100644
index 33b40b7bf0..0000000000
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowAsyncInfrastructureResource.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T 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.openecomp.mso.bpmn.infrastructure.workflow.service;
-
-import javax.ws.rs.Path;
-
-import org.camunda.bpm.engine.ProcessEngineServices;
-import org.camunda.bpm.engine.ProcessEngines;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource;
-
-
-/**
- *
- * @version 1.0
- * Asynchronous Workflow processing using JAX RS RESTeasy implementation
- * Both Synchronous and Asynchronous BPMN process can benefit from this implementation since the workflow gets executed in the background
- * and the server thread is freed up, server scales better to process more incoming requests
- *
- * Usage: For synchronous process, when you are ready to send the response invoke the callback to write the response
- * For asynchronous process - the activity may send a acknowledgement response and then proceed further on executing the process
- */
-@Path("/async")
-public class WorkflowAsyncInfrastructureResource extends WorkflowAsyncResource {
-
- protected ProcessEngineServices getProcessEngineServices() {
- return pes4junit.orElse(ProcessEngines.getProcessEngine("infrastructure"));
- }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java
index 16811979c1..80b11bbdf5 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java
+++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java
@@ -26,14 +26,10 @@ import java.util.Set;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
+import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource;
import org.openecomp.mso.bpmn.common.workflow.service.WorkflowMessageResource;
import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResource;
-/**
- * @version 1.0
- * RESTeasy workflow application which wires synchronous and asynchronous response
- *
- */
@ApplicationPath("/")
public class WorkflowResourceApplication extends Application {
private Set<Object> singletons = new HashSet<Object>();
@@ -41,7 +37,7 @@ public class WorkflowResourceApplication extends Application {
public WorkflowResourceApplication() {
singletons.add(new WorkflowResource());
- singletons.add(new WorkflowAsyncInfrastructureResource());
+ singletons.add(new WorkflowAsyncResource());
singletons.add(new WorkflowMessageResource());
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/META-INF/processes.xml b/bpmn/MSOInfrastructureBPMN/src/main/resources/META-INF/processes.xml
index 4053de8e28..3e81a6a136 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/META-INF/processes.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/META-INF/processes.xml
@@ -23,7 +23,7 @@
<process-application
xmlns="http://www.camunda.org/schema/1.0/ProcessApplication"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <process-engine name="infrastructure">
+ <process-engine name="default">
<configuration>org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration</configuration>
<datasource>java:jboss/datasources/ProcessEngine</datasource>
<properties>
@@ -71,7 +71,7 @@
<process-archive name="MSOInfrastructureBPMN">
- <process-engine>infrastructure</process-engine>
+ <process-engine>default</process-engine>
<properties>
<property name="isDeleteUponUndeploy">false</property>
<property name="isScanForProcessDefinitions">true</property>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn
index 02f7f4815a..9fe6815570 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn
@@ -366,9 +366,8 @@ CreateVcpeResCustService.prepareCreateServiceInstance(execution)]]></bpmn2:scrip
</camunda:connector>
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_0vj46ej</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_13uceka</bpmn2:outgoing>
+ <bpmn2:outgoing>SequenceFlow_0sjpja4</bpmn2:outgoing>
</bpmn2:serviceTask>
- <bpmn2:sequenceFlow id="SequenceFlow_13uceka" sourceRef="updateInfraRequest" targetRef="IntermediateThrowEvent_1as6hoa" />
<bpmn2:scriptTask id="ScriptTask_1qd3uwb" name="Post Process&#10;Create&#10;Service&#10;" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_1ky2sv9</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0vj46ej</bpmn2:outgoing>
@@ -431,7 +430,7 @@ CreateVcpeResCustService.prepareCreateAllottedResourceTXC(execution)]]></bpmn2:s
<bpmn2:linkEventDefinition name="StartService" />
</bpmn2:intermediateCatchEvent>
<bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_1as6hoa" name="GoToCreateAllottedResourcesTXC">
- <bpmn2:incoming>SequenceFlow_13uceka</bpmn2:incoming>
+ <bpmn2:incoming>SequenceFlow_1db0ri1</bpmn2:incoming>
<bpmn2:linkEventDefinition name="CreateAllottedResourcesTXC" />
</bpmn2:intermediateThrowEvent>
<bpmn2:sequenceFlow id="SequenceFlow_15odbkz" sourceRef="IntermediateCatchEvent_1i1nwfx" targetRef="prepareCreateService_scriptTask" />
@@ -471,36 +470,11 @@ CreateVcpeResCustService.prepareCreateAllottedResourceTXC(execution)]]></bpmn2:s
<bpmn2:incoming>SequenceFlow_0e9e6fo</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0hwsm6n</bpmn2:outgoing>
</bpmn2:exclusiveGateway>
- <bpmn2:callActivity id="CallActivity_0xt1l8t" name="Call Create BRG Allotted Resource&#10;" calledElement="DoCreateAllottedResourceBRG">
- <bpmn2:extensionElements>
- <camunda:in source="msoRequestId" target="msoRequestId" />
- <camunda:in source="disableRollback" target="disableRollback" />
- <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
- <camunda:in source="failExists" target="failExists" />
- <camunda:in source="serviceInstanceId" target="serviceInstanceId" />
- <camunda:in source="parentServiceInstanceIdBRG" target="parentServiceInstanceId" />
- <camunda:in source="allottedResourceIdBRG" target="allottedResourceId" />
- <camunda:in source="allottedResourceModelInfoBRG" target="allottedResourceModelInfo" />
- <camunda:in source="allottedResourceRoleBRG" target="allottedResourceRole" />
- <camunda:out source="rollbackData" target="DCARBRG_rollbackData" />
- <camunda:out source="rolledBack" target="rolledBack" />
- <camunda:out source="WorkflowException" target="WorkflowException" />
- <camunda:out source="allottedResourceId" target="DCARBRG_allottedResourceId" />
- <camunda:out source="allottedResourceName" target="DCARBRG_allottedResourceName" />
- <camunda:in source="allottedResourceTypeBRG" target="allottedResourceType" />
- <camunda:in source="vni" target="vni" />
- <camunda:in source="vgmuxBearerIP" target="vgmuxBearerIP" />
- <camunda:in source="brgWanMacAddress" target="brgWanMacAddress" />
- </bpmn2:extensionElements>
- <bpmn2:incoming>SequenceFlow_0b5ztoe</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_0e9e6fo</bpmn2:outgoing>
- </bpmn2:callActivity>
<bpmn2:sequenceFlow id="SequenceFlow_0hwsm6n" sourceRef="ExclusiveGateway_0jqgskx" targetRef="IntermediateThrowEvent_0lt5ltv" />
<bpmn2:sequenceFlow id="SequenceFlow_0loks1u" name="No" sourceRef="ExclusiveGateway_1xwfgxs" targetRef="ExclusiveGateway_0jqgskx" />
<bpmn2:sequenceFlow id="SequenceFlow_0b5ztoe" name="Yes" sourceRef="ExclusiveGateway_1xwfgxs" targetRef="CallActivity_0xt1l8t">
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{ execution.getVariable("createBRGAR") != null && execution.getVariable("createBRGAR") == true }]]></bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
- <bpmn2:sequenceFlow id="SequenceFlow_0e9e6fo" sourceRef="CallActivity_0xt1l8t" targetRef="ExclusiveGateway_0jqgskx" />
<bpmn2:scriptTask id="ScriptTask_05epj75" name="Prepare to create Allotted Resources BRG" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_15vce9o</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0yecpl2</bpmn2:outgoing>
@@ -595,6 +569,8 @@ CreateVcpeResCustService.prepareVnfAndModulesCreate(execution)]]></bpmn2:script>
<camunda:out source="vgmuxLanIP" target="vgmuxLanIP" />
<camunda:in source="allottedResourceTypeTXC" target="allottedResourceType" />
<camunda:in source="brgWanMacAddress" target="brgWanMacAddress" />
+ <camunda:in source="globalCustomerId" target="globalCustomerId" />
+ <camunda:in source="subscriptionServiceType" target="subscriptionServiceType" />
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_16qob4p</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_1cgpklo</bpmn2:outgoing>
@@ -616,6 +592,42 @@ def CreateVcpeResCustService= new CreateVcpeResCustService()
CreateVcpeResCustService.validateVnfCreate(execution)]]></bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:sequenceFlow id="SequenceFlow_0k5vcuu" sourceRef="ScriptTask_18w0jud" targetRef="ExclusiveGateway_1hlbkue" />
+ <bpmn2:callActivity id="CallActivity_0xt1l8t" name="Call Create BRG Allotted Resource&#10;" calledElement="DoCreateAllottedResourceBRG">
+ <bpmn2:extensionElements>
+ <camunda:in source="msoRequestId" target="msoRequestId" />
+ <camunda:in source="disableRollback" target="disableRollback" />
+ <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
+ <camunda:in source="failExists" target="failExists" />
+ <camunda:in source="serviceInstanceId" target="serviceInstanceId" />
+ <camunda:in source="parentServiceInstanceIdBRG" target="parentServiceInstanceId" />
+ <camunda:in source="allottedResourceIdBRG" target="allottedResourceId" />
+ <camunda:in source="allottedResourceModelInfoBRG" target="allottedResourceModelInfo" />
+ <camunda:in source="allottedResourceRoleBRG" target="allottedResourceRole" />
+ <camunda:out source="rollbackData" target="DCARBRG_rollbackData" />
+ <camunda:out source="rolledBack" target="rolledBack" />
+ <camunda:out source="WorkflowException" target="WorkflowException" />
+ <camunda:out source="allottedResourceId" target="DCARBRG_allottedResourceId" />
+ <camunda:out source="allottedResourceName" target="DCARBRG_allottedResourceName" />
+ <camunda:in source="allottedResourceTypeBRG" target="allottedResourceType" />
+ <camunda:in source="vni" target="vni" />
+ <camunda:in source="vgmuxBearerIP" target="vgmuxBearerIP" />
+ <camunda:in source="brgWanMacAddress" target="brgWanMacAddress" />
+ <camunda:in source="subscriptionServiceType" target="subscriptionServiceType" />
+ <camunda:in source="globalCustomerId" target="globalCustomerId" />
+ </bpmn2:extensionElements>
+ <bpmn2:incoming>SequenceFlow_0b5ztoe</bpmn2:incoming>
+ <bpmn2:outgoing>SequenceFlow_0e9e6fo</bpmn2:outgoing>
+ </bpmn2:callActivity>
+ <bpmn2:sequenceFlow id="SequenceFlow_0e9e6fo" sourceRef="CallActivity_0xt1l8t" targetRef="ExclusiveGateway_0jqgskx" />
+ <bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_1x88t9v" name="Await AAI Distribution&#10;&#10;">
+ <bpmn2:incoming>SequenceFlow_0sjpja4</bpmn2:incoming>
+ <bpmn2:outgoing>SequenceFlow_1db0ri1</bpmn2:outgoing>
+ <bpmn2:timerEventDefinition>
+ <bpmn2:timeDuration xsi:type="bpmn2:tFormalExpression">${aaiDistDelay}</bpmn2:timeDuration>
+ </bpmn2:timerEventDefinition>
+ </bpmn2:intermediateCatchEvent>
+ <bpmn2:sequenceFlow id="SequenceFlow_0sjpja4" sourceRef="updateInfraRequest" targetRef="IntermediateCatchEvent_1x88t9v" />
+ <bpmn2:sequenceFlow id="SequenceFlow_1db0ri1" sourceRef="IntermediateCatchEvent_1x88t9v" targetRef="IntermediateThrowEvent_1as6hoa" />
</bpmn2:process>
<bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
<bpmn2:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" />
@@ -913,13 +925,6 @@ CreateVcpeResCustService.validateVnfCreate(execution)]]></bpmn2:script>
<bpmndi:BPMNShape id="ServiceTask_16yhzej_di" bpmnElement="updateInfraRequest">
<dc:Bounds x="794" y="543" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_13uceka_di" bpmnElement="SequenceFlow_13uceka">
- <di:waypoint xsi:type="dc:Point" x="894" y="583" />
- <di:waypoint xsi:type="dc:Point" x="1053" y="583" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="974" y="568" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_1qd3uwb_di" bpmnElement="ScriptTask_1qd3uwb">
<dc:Bounds x="623" y="543" width="100" height="80" />
</bpmndi:BPMNShape>
@@ -1143,9 +1148,9 @@ CreateVcpeResCustService.validateVnfCreate(execution)]]></bpmn2:script>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="IntermediateThrowEvent_1as6hoa_di" bpmnElement="IntermediateThrowEvent_1as6hoa">
- <dc:Bounds x="1056" y="565" width="36" height="36" />
+ <dc:Bounds x="1027" y="666" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1037" y="606" width="72" height="24" />
+ <dc:Bounds x="1002" y="707" width="85" height="36" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_15odbkz_di" bpmnElement="SequenceFlow_15odbkz">
@@ -1261,9 +1266,6 @@ CreateVcpeResCustService.validateVnfCreate(execution)]]></bpmn2:script>
<dc:Bounds x="515" y="1317" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="CallActivity_0xt1l8t_di" bpmnElement="CallActivity_0xt1l8t">
- <dc:Bounds x="400" y="1151" width="100" height="80" />
- </bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0hwsm6n_di" bpmnElement="SequenceFlow_0hwsm6n">
<di:waypoint xsi:type="dc:Point" x="585" y="1292" />
<di:waypoint xsi:type="dc:Point" x="628" y="1292" />
@@ -1287,15 +1289,7 @@ CreateVcpeResCustService.validateVnfCreate(execution)]]></bpmn2:script>
<di:waypoint xsi:type="dc:Point" x="337" y="1191" />
<di:waypoint xsi:type="dc:Point" x="395" y="1191" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="353" y="1216.4242424242425" width="21" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0e9e6fo_di" bpmnElement="SequenceFlow_0e9e6fo">
- <di:waypoint xsi:type="dc:Point" x="500" y="1191" />
- <di:waypoint xsi:type="dc:Point" x="560" y="1191" />
- <di:waypoint xsi:type="dc:Point" x="560" y="1267" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="485" y="1166" width="0" height="12" />
+ <dc:Bounds x="354" y="1216" width="19" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_05epj75_di" bpmnElement="ScriptTask_05epj75">
@@ -1500,6 +1494,37 @@ CreateVcpeResCustService.validateVnfCreate(execution)]]></bpmn2:script>
<dc:Bounds x="883" y="961" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="CallActivity_0xt1l8t_di" bpmnElement="CallActivity_0xt1l8t">
+ <dc:Bounds x="400" y="1151" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0e9e6fo_di" bpmnElement="SequenceFlow_0e9e6fo">
+ <di:waypoint xsi:type="dc:Point" x="500" y="1191" />
+ <di:waypoint xsi:type="dc:Point" x="560" y="1191" />
+ <di:waypoint xsi:type="dc:Point" x="560" y="1267" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="440" y="1166" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="IntermediateCatchEvent_1x88t9v_di" bpmnElement="IntermediateCatchEvent_1x88t9v">
+ <dc:Bounds x="1027" y="565" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1018" y="530" width="54" height="48" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0sjpja4_di" bpmnElement="SequenceFlow_0sjpja4">
+ <di:waypoint xsi:type="dc:Point" x="894" y="583" />
+ <di:waypoint xsi:type="dc:Point" x="1027" y="583" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="960.5" y="562" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1db0ri1_di" bpmnElement="SequenceFlow_1db0ri1">
+ <di:waypoint xsi:type="dc:Point" x="1045" y="601" />
+ <di:waypoint xsi:type="dc:Point" x="1045" y="666" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1060" y="627.5" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteVcpeResCustService.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteVcpeResCustService.bpmn
index 38e1d43910..88c45afda2 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteVcpeResCustService.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteVcpeResCustService.bpmn
@@ -253,6 +253,7 @@ DeleteVcpeResCustService.prepareServiceDelete(execution)]]></bpmn2:script>
<camunda:out source="rolledBack" target="rolledBack" />
<camunda:in source="lcpCloudRegionId" target="lcpCloudRegionId" />
<camunda:in source="tenantId" target="tenantId" />
+ <camunda:in source="cloudConfiguration" target="cloudConfiguration" />
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_128485i</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_04fys47</bpmn2:outgoing>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceBRG.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceBRG.bpmn
index a35371e97c..b925b007cd 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceBRG.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceBRG.bpmn
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_DkzPAHB4EeaJwpcpVN5gXw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_DkzPAHB4EeaJwpcpVN5gXw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.9.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="DoCreateAllottedResourceBRG" name="DoCreateAllottedResourceBRG" isExecutable="true">
<bpmn2:startEvent id="StartEvent_1">
<bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
@@ -180,7 +180,7 @@ dcar.validateSDNCResp(execution, response, "activate" )]]></bpmn2:script>
<bpmn2:outgoing>SequenceFlow_0q1hz2p</bpmn2:outgoing>
</bpmn2:callActivity>
<bpmn2:sequenceFlow id="SequenceFlow_1iy3cqb" sourceRef="postProcessSDNCGetResponse" targetRef="generateOutputs" />
- <bpmn2:sequenceFlow id="SequenceFlow_1dgzhsm" sourceRef="UpdateAAIARActive" targetRef="PreProcessSDNCGet" />
+ <bpmn2:sequenceFlow id="SequenceFlow_1dgzhsm" sourceRef="UpdateAAIARActive" targetRef="IntermediateCatchEvent_1f4tse6" />
<bpmn2:callActivity id="GetAAIParentSI" name="Get AAI Parent ServiceInstance&#10;" calledElement="GenericGetService">
<bpmn2:extensionElements>
<camunda:in source="parentServiceInstanceId" target="GENGS_serviceInstanceId" />
@@ -277,8 +277,8 @@ DoCreateAllottedResourceBRG dcar = new DoCreateAllottedResourceBRG()
dcar.updateAaiAROrchStatus(execution, "Created")]]></bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:scriptTask id="PreProcessSDNCGet" name="PreProcess SDNC Get" scriptFormat="groovy">
- <bpmn2:incoming>SequenceFlow_1dgzhsm</bpmn2:incoming>
<bpmn2:incoming>SequenceFlow_0z8luou</bpmn2:incoming>
+ <bpmn2:incoming>SequenceFlow_0ec9eiq</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_030mhcm</bpmn2:outgoing>
<bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.vcpe.scripts.*
DoCreateAllottedResourceBRG dcar = new DoCreateAllottedResourceBRG()
@@ -326,6 +326,14 @@ DoCreateAllottedResourceBRG dcar = new DoCreateAllottedResourceBRG()
dcar.generateOutputs(execution)]]></bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:sequenceFlow id="SequenceFlow_09xwplc" sourceRef="generateOutputs" targetRef="EndEvent_3" />
+ <bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_1f4tse6" name="Await SDNC Replication&#10;&#10;">
+ <bpmn2:incoming>SequenceFlow_1dgzhsm</bpmn2:incoming>
+ <bpmn2:outgoing>SequenceFlow_0ec9eiq</bpmn2:outgoing>
+ <bpmn2:timerEventDefinition>
+ <bpmn2:timeDuration xsi:type="bpmn2:tFormalExpression">${sdncReplDelay}</bpmn2:timeDuration>
+ </bpmn2:timerEventDefinition>
+ </bpmn2:intermediateCatchEvent>
+ <bpmn2:sequenceFlow id="SequenceFlow_0ec9eiq" sourceRef="IntermediateCatchEvent_1f4tse6" targetRef="PreProcessSDNCGet" />
</bpmn2:process>
<bpmn2:error id="Error_1" name="Java Lang Exception" errorCode="java.lang.Exception" />
<bpmn2:error id="Error_2" name="MSO Workflow Exception" errorCode="MSOWorkflowException" />
@@ -532,10 +540,9 @@ dcar.generateOutputs(execution)]]></bpmn2:script>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1dgzhsm_di" bpmnElement="SequenceFlow_1dgzhsm">
<di:waypoint xsi:type="dc:Point" x="964" y="624" />
- <di:waypoint xsi:type="dc:Point" x="964" y="545" />
- <di:waypoint xsi:type="dc:Point" x="1140" y="545" />
+ <di:waypoint xsi:type="dc:Point" x="964" y="563" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="979" y="584.5" width="0" height="0" />
+ <dc:Bounds x="934" y="593.5" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="CallActivity_0e73um9_di" bpmnElement="GetAAIParentSI">
@@ -730,6 +737,19 @@ dcar.generateOutputs(execution)]]></bpmn2:script>
<dc:Bounds x="575" y="980" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="IntermediateCatchEvent_1f4tse6_di" bpmnElement="IntermediateCatchEvent_1f4tse6">
+ <dc:Bounds x="946" y="527" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="933" y="492" width="61" height="48" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0ec9eiq_di" bpmnElement="SequenceFlow_0ec9eiq">
+ <di:waypoint xsi:type="dc:Point" x="982" y="545" />
+ <di:waypoint xsi:type="dc:Point" x="1140" y="545" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1061" y="524" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceTXC.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceTXC.bpmn
index 178534f797..a240bb5ffa 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceTXC.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceTXC.bpmn
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_DkzPAHB4EeaJwpcpVN5gXw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_DkzPAHB4EeaJwpcpVN5gXw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.9.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="DoCreateAllottedResourceTXC" name="DoCreateAllottedResourceTXC" isExecutable="true">
<bpmn2:startEvent id="StartEvent_1">
<bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
@@ -180,7 +180,6 @@ dcar.validateSDNCResp(execution, response, "activate" )]]></bpmn2:script>
<bpmn2:outgoing>SequenceFlow_0q1hz2p</bpmn2:outgoing>
</bpmn2:callActivity>
<bpmn2:sequenceFlow id="SequenceFlow_1iy3cqb" sourceRef="postProcessSDNCGetResponse" targetRef="generateOutputs" />
- <bpmn2:sequenceFlow id="SequenceFlow_1dgzhsm" sourceRef="UpdateAAIARActive" targetRef="PreProcessSDNCGet" />
<bpmn2:callActivity id="GetAAIParentSI" name="Get AAI Parent ServiceInstance&#10;" calledElement="GenericGetService">
<bpmn2:extensionElements>
<camunda:in source="parentServiceInstanceId" target="GENGS_serviceInstanceId" />
@@ -262,7 +261,7 @@ dcar.postProcessRollback(execution)]]></bpmn2:script>
</bpmn2:subProcess>
<bpmn2:scriptTask id="UpdateAAIARActive" name="Update AAI AR Active" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_00i7x43</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_1dgzhsm</bpmn2:outgoing>
+ <bpmn2:outgoing>SequenceFlow_07kxd8t</bpmn2:outgoing>
<bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.vcpe.scripts.*
DoCreateAllottedResourceTXC dcar = new DoCreateAllottedResourceTXC()
@@ -277,8 +276,8 @@ DoCreateAllottedResourceTXC dcar = new DoCreateAllottedResourceTXC()
dcar.updateAaiAROrchStatus(execution, "Created")]]></bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:scriptTask id="PreProcessSDNCGet" name="PreProcess SDNC Get" scriptFormat="groovy">
- <bpmn2:incoming>SequenceFlow_1dgzhsm</bpmn2:incoming>
<bpmn2:incoming>SequenceFlow_0z8luou</bpmn2:incoming>
+ <bpmn2:incoming>SequenceFlow_08hhqb2</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_030mhcm</bpmn2:outgoing>
<bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.vcpe.scripts.*
DoCreateAllottedResourceTXC dcar = new DoCreateAllottedResourceTXC()
@@ -326,6 +325,15 @@ DoCreateAllottedResourceTXC dcar = new DoCreateAllottedResourceTXC()
dcar.generateOutputs(execution)]]></bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:sequenceFlow id="SequenceFlow_09xwplc" sourceRef="generateOutputs" targetRef="EndEvent_3" />
+ <bpmn2:sequenceFlow id="SequenceFlow_07kxd8t" sourceRef="UpdateAAIARActive" targetRef="IntermediateThrowEvent_0ti2fv8" />
+ <bpmn2:intermediateCatchEvent id="IntermediateThrowEvent_0ti2fv8" name="Await SDNC Replication&#10;&#10;">
+ <bpmn2:incoming>SequenceFlow_07kxd8t</bpmn2:incoming>
+ <bpmn2:outgoing>SequenceFlow_08hhqb2</bpmn2:outgoing>
+ <bpmn2:timerEventDefinition>
+ <bpmn2:timeDuration xsi:type="bpmn2:tFormalExpression">${sdncReplDelay}</bpmn2:timeDuration>
+ </bpmn2:timerEventDefinition>
+ </bpmn2:intermediateCatchEvent>
+ <bpmn2:sequenceFlow id="SequenceFlow_08hhqb2" sourceRef="IntermediateThrowEvent_0ti2fv8" targetRef="PreProcessSDNCGet" />
</bpmn2:process>
<bpmn2:error id="Error_1" name="Java Lang Exception" errorCode="java.lang.Exception" />
<bpmn2:error id="Error_2" name="MSO Workflow Exception" errorCode="MSOWorkflowException" />
@@ -530,14 +538,6 @@ dcar.generateOutputs(execution)]]></bpmn2:script>
<dc:Bounds x="1277" y="779" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1dgzhsm_di" bpmnElement="SequenceFlow_1dgzhsm">
- <di:waypoint xsi:type="dc:Point" x="964" y="624" />
- <di:waypoint xsi:type="dc:Point" x="964" y="545" />
- <di:waypoint xsi:type="dc:Point" x="1140" y="545" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="979" y="584.5" width="0" height="0" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="CallActivity_0e73um9_di" bpmnElement="GetAAIParentSI">
<dc:Bounds x="843" y="199" width="100" height="80" />
</bpmndi:BPMNShape>
@@ -730,6 +730,26 @@ dcar.generateOutputs(execution)]]></bpmn2:script>
<dc:Bounds x="575" y="980" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_07kxd8t_di" bpmnElement="SequenceFlow_07kxd8t">
+ <di:waypoint xsi:type="dc:Point" x="964" y="624" />
+ <di:waypoint xsi:type="dc:Point" x="964" y="563" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="979" y="587.5" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="IntermediateCatchEvent_038xgwf_di" bpmnElement="IntermediateThrowEvent_0ti2fv8">
+ <dc:Bounds x="946" y="527" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="933" y="492" width="61" height="48" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_08hhqb2_di" bpmnElement="SequenceFlow_08hhqb2">
+ <di:waypoint xsi:type="dc:Point" x="982" y="545" />
+ <di:waypoint xsi:type="dc:Point" x="1140" y="545" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1061" y="524" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstanceTest.groovy
new file mode 100644
index 0000000000..8ccb18a625
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstanceTest.groovy
@@ -0,0 +1,160 @@
+package org.openecomp.mso.bpmn.infrastructure.scripts
+
+import com.github.tomakehurst.wiremock.junit.WireMockRule
+import org.camunda.bpm.engine.ProcessEngineServices
+import org.camunda.bpm.engine.RepositoryService
+import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
+import org.camunda.bpm.engine.repository.ProcessDefinition
+import org.camunda.bpm.engine.runtime.Execution
+import org.junit.Before
+import org.junit.BeforeClass
+import org.junit.Rule
+import org.junit.Test
+import org.mockito.MockitoAnnotations
+import org.openecomp.mso.bpmn.core.json.JsonUtils
+import org.openecomp.mso.bpmn.infrastructure.scripts.DeleteCustomE2EServiceInstance
+import org.openecomp.mso.bpmn.mock.FileUtil
+import org.openecomp.mso.bpmn.vcpe.scripts.GroovyTestBase
+
+import static org.junit.Assert.assertTrue
+import static org.junit.Assert.assertTrue
+import static org.junit.Assert.assertTrue
+import static org.mockito.Mockito.mock
+import static org.mockito.Mockito.mock
+import static org.mockito.Mockito.mock
+import static org.mockito.Mockito.mock
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+
+class DeleteCustomE2EServiceInstanceTest extends GroovyTestBase {
+
+ private static String request
+
+ @Rule
+ public WireMockRule wireMockRule = new WireMockRule(GroovyTestBase.PORT)
+
+ String Prefix = "CVRCS_"
+ String RbType = "DCRENI_"
+
+ @BeforeClass
+ public static void setUpBeforeClass() {
+ request = FileUtil.readResourceFile("__files/InfrastructureFlows/DeleteCustomE2EService.json")
+ }
+
+ @Before
+ public void init()
+ {
+ MockitoAnnotations.initMocks(this)
+ }
+
+ public DeleteCustomE2EServiceInstanceTest(){
+ super("DeleteCustomE2EServiceInstance")
+ }
+ @Test
+ public void preProcessRequestTest () {
+ ExecutionEntity mex = setupMock()
+ def map = setupMap(mex)
+ initPreProcess(mex)
+ DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance()
+ mex.setVariable("isDebugLogEnabled","true")
+ instance.preProcessRequest(mex);
+
+ verify(mex).getVariable(GroovyTestBase.DBGFLAG)
+
+ verify(mex).setVariable("globalSubscriberId", "38829939920000")
+ verify(mex).setVariable("operationId", "59960003992")
+ verify(mex).setVariable("URN_mso_adapters_openecomp_db_endpoint", "http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")
+ }
+
+ @Test
+ public void sendSyncResponseTest() {
+ ExecutionEntity mex = setupMock()
+ def map = setupMap(mex)
+ initPreProcess(mex)
+ DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance()
+ instance.sendSyncResponse(mex)
+ verify(mex).setVariable("DeleteCustomE2EServiceInstanceWorkflowResponseSent", "true")
+ }
+
+ @Test
+ public void prepareCompletionRequestTest(){
+ ExecutionEntity mex = setupMock()
+ def map = setupMap(mex)
+ initPreProcess(mex)
+ DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance()
+ instance.prepareCompletionRequest(mex)
+ String msoComplitionRequest = FileUtil.readResourceFile("__files/GenericFlows/MsoCompletionRequest.xml")
+ //verify(mex).setVariable("completionRequest", msoComplitionRequest)
+ }
+
+ @Test
+ public void sendSyncErrorTest(){
+ ExecutionEntity mex = setupMock()
+ def map = setupMap(mex)
+ initPreProcess(mex)
+ DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance()
+ instance.sendSyncError(mex)
+
+ }
+
+ @Test
+ public void prepareFalloutRequest(){
+ ExecutionEntity mex = setupMock()
+ def map = setupMap(mex)
+ initPreProcess(mex)
+ DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance()
+ instance.prepareFalloutRequest(mex)
+ String requestInfo =
+ """<request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <request-id>null</request-id>
+ <action>DELETE</action>
+ <source>null</source>
+ </request-info>"""
+ //verify(mex).setVariable("falloutRequest", requestInfo)
+ }
+
+ @Test
+ public void processJavaExceptionTest(){
+ ExecutionEntity mex = setupMock()
+ def map = setupMap(mex)
+ initPreProcess(mex)
+ DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance()
+ instance.processJavaException()
+ }
+
+
+ private void initPreProcess(ExecutionEntity mex) {
+ when(mex.getVariable(GroovyTestBase.DBGFLAG)).thenReturn("true")
+ when(mex.getVariable("bpmnRequest")).thenReturn(request)
+ when(mex.getVariable("mso-request-id")).thenReturn("mri")
+ when(mex.getVariable("serviceType")).thenReturn("VoLTE")
+ when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
+ when(mex.getVariable("requestAction")).thenReturn("ra")
+ when(mex.getVariable("operationId")).thenReturn("59960003992")
+ }
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceTest.groovy
new file mode 100644
index 0000000000..2cf09fe144
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceTest.groovy
@@ -0,0 +1,143 @@
+package org.openecomp.mso.bpmn.infrastructure.scripts
+
+import com.github.tomakehurst.wiremock.junit.WireMockRule
+import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
+import org.junit.Before
+import org.junit.BeforeClass
+import org.junit.Ignore
+import org.junit.Rule
+import org.junit.Test
+import org.mockito.MockitoAnnotations
+import org.openecomp.mso.bpmn.infrastructure.scripts.DoCustomDeleteE2EServiceInstance
+import org.openecomp.mso.bpmn.mock.FileUtil
+import org.openecomp.mso.bpmn.vcpe.scripts.GroovyTestBase
+
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+
+class DoCustomDeleteE2EServiceInstanceTest extends GroovyTestBase {
+
+ private static String request
+
+ @Rule
+ public WireMockRule wireMockRule = new WireMockRule(GroovyTestBase.PORT)
+
+ String Prefix = "CVRCS_"
+ String RbType = "DCRENI_"
+
+ @BeforeClass
+ public static void setUpBeforeClass() {
+ request = FileUtil.readResourceFile("__files/InfrastructureFlows/DeleteCustomE2EService.json")
+ }
+
+ @Before
+ public void init()
+ {
+ MockitoAnnotations.initMocks(this)
+ }
+ public DoCustomDeleteE2EServiceInstanceTest(){
+ super("DoCustomDeleteE2EServiceInstance")
+ }
+
+ @Test
+ public void preProcessRequestTest(){
+
+ ExecutionEntity mex = setupMock()
+ def map = setupMap(mex)
+ initPreProcess(mex)
+
+ DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance()
+ instance.preProcessRequest(mex)
+ verify(mex).setVariable("sdncCallbackUrl", "/mso/sdncadapter/")
+ verify(mex).setVariable("siParamsXml", "")
+ }
+
+ @Ignore
+ @Test
+ public void postProcessAAIGETTest(){
+ ExecutionEntity mex = setupMock()
+ def map = setupMap(mex)
+ initPreProcess(mex)
+ when(mex.getVariable("GENGS_SuccessIndicator")).thenReturn(true)
+
+ String aaiGetResponse = FileUtil.readResourceFile("__files/GenericFlows/aaiGetResponse.xml")
+ when(mex.getVariable("GENGS_service")).thenReturn(aaiGetResponse)
+ DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance()
+ instance.postProcessAAIGET(mex)
+ // TODO: what to test here?
+// verify(mex).setVariable("subscriptionServiceType", "e2eserviceInstance/delete")
+ }
+
+ @Ignore
+ @Test
+ public void preInitResourcesOperStatusTest(){
+ ExecutionEntity mex = setupMock()
+ def map = setupMap(mex)
+ initPreProcess(mex)
+ when(mex.getVariable("serviceRelationShip")).thenReturn("[{\"resourceInstanceId\":\"3333\",\"resourceType\":\"overlay\"},{\"resourceInstanceId\":\"4444\",\"resourceType\":\"underlay\"},{\"resourceInstanceId\":\"1111\",\"resourceType\":\"vIMS\"},{\"resourceInstanceId\":\"222\",\"resourceType\":\"vEPC\"}]")
+ DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance()
+ instance.preInitResourcesOperStatus(mex)
+ // TODO: what to test here?
+// verify(mex).setVariable("CVFMI_dbAdapterEndpoint", "http://localhost:8080/mso")
+ }
+
+ @Test
+ public void preResourceDeleteTest() {
+ ExecutionEntity mex = setupMock()
+ def map = setupMap(mex)
+ initPreProcess(mex)
+ when(mex.getVariable("serviceRelationShip")).thenReturn("[{\"resourceInstanceId\":\"3333\",\"resourceType\":\"overlay\"},{\"resourceInstanceId\":\"4444\",\"resourceType\":\"underlay\"},{\"resourceInstanceId\":\"1111\",\"resourceType\":\"vIMS\"},{\"resourceInstanceId\":\"222\",\"resourceType\":\"vEPC\"}]")
+ DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance()
+ instance.preResourceDelete(mex,"overlay")
+ verify(mex).setVariable("resourceType", "overlay")
+ }
+
+ @Ignore
+ @Test
+ public void postProcessSDNCDeleteTest(){
+ ExecutionEntity mex = setupMock()
+ def map = setupMap(mex)
+ initPreProcess(mex)
+ when(mex.getVariable("SDNCA_SuccessIndicator")).thenReturn("true")
+ when(mex.getVariable("DDELSI_sdncResponseSuccess")).thenReturn("true")
+ when(mex.getVariable("prefix")).thenReturn("DDELSI_")
+ DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance()
+ String response = FileUtil.readResourceFile("__files/GenericFlows/SDNCDeleteResponse.xml")
+ String method = "deleteE2E";
+ instance.postProcessSDNCDelete(mex, response, method)
+ // TODO: what to test here?
+// verify(mex).setVariable("DDELSI_sdncRequestDataResponseCode", "0")
+ }
+
+ @Test
+ public void postProcessAAIDELTest() {
+ ExecutionEntity mex = setupMock()
+ def map = setupMap(mex)
+ initPreProcess(mex)
+ when(mex.getVariable("GENDS_SuccessIndicator")).thenReturn("true")
+ DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance()
+ instance.postProcessAAIDEL(mex)
+ }
+
+ private void initPreProcess(ExecutionEntity mex) {
+ when(mex.getVariable(GroovyTestBase.DBGFLAG)).thenReturn("true")
+ when(mex.getVariable("bpmnRequest")).thenReturn(request)
+ when(mex.getVariable("mso-request-id")).thenReturn("mri")
+ when(mex.getVariable("serviceType")).thenReturn("VoLTE")
+ when(mex.getVariable("serviceInstanceId")).thenReturn("e151059a-d924-4629-845f-264db19e50b4")
+ when(mex.getVariable("requestAction")).thenReturn("ra")
+ when(mex.getVariable("operationId")).thenReturn("59960003992")
+ when(mex.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("/mso/sdncadapter/")
+ when(mex.getVariable("GENGS_FoundIndicator")).thenReturn("true")
+ when(mex.getVariable("GENGS_siResourceLink")).thenReturn("/service-subscription/e2eserviceInstance/delete/service-instances/")
+ when(mex.getVariable("globalSubscriberId")).thenReturn("4993921112123")
+ when(mex.getVariable("GENGS_service")).thenReturn("test3434")
+ when(mex.getVariable("URN_mso_openecomp_adapters_db_endpoint")).thenReturn("http://localhost:8080/mso")
+ }
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy
index 0b29219dd8..f0645b2bc7 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy
@@ -85,7 +85,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
// ***** preProcessRequest *****
@Test
-// @Ignore
+ // @Ignore
public void preProcessRequest() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -96,6 +96,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
verify(mex).getVariable(DBGFLAG)
verify(mex).setVariable("prefix", Prefix)
+ verify(mex).setVariable("aaiDistDelay", "aaidelay")
verify(mex).setVariable("createVcpeServiceRequest", request)
verify(mex).setVariable("msoRequestId", "mri")
assertEquals("sii", map.get("serviceInstanceId"))
@@ -118,7 +119,21 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
+ public void preProcessRequest_MissingAaiDistDelay() {
+ ExecutionEntity mex = setupMock()
+ def map = setupMap(mex)
+ initPreProcess(mex)
+
+ when(mex.getVariable("URN_mso_workflow_aai_distribution_delay")).thenReturn(null)
+
+ CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService()
+
+ assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.preProcessRequest(mex) }))
+ }
+
+ @Test
+ // @Ignore
public void preProcessRequest_EmptyParts() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -160,7 +175,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void preProcessRequest_MissingSubscriberId() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -178,7 +193,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void preProcessRequest_BpmnError() {
ExecutionEntity mex = setupMock()
initPreProcess(mex)
@@ -191,7 +206,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void preProcessRequest_Ex() {
ExecutionEntity mex = setupMock()
initPreProcess(mex)
@@ -206,7 +221,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
// ***** sendSyncResponse *****
@Test
-// @Ignore
+ // @Ignore
public void sendSyncResponse() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -229,7 +244,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void sendSyncResponse_Ex() {
ExecutionEntity mex = setupMock()
initSendSyncResponse(mex)
@@ -245,7 +260,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
// ***** prepareDecomposeService *****
@Test
-// @Ignore
+ // @Ignore
public void prepareDecomposeService() {
ExecutionEntity mex = setupMock()
initPrepareDecomposeService(mex)
@@ -258,7 +273,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void prepareDecomposeService_Ex() {
ExecutionEntity mex = setupMock()
initPrepareDecomposeService(mex)
@@ -274,7 +289,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
// ***** prepareCreateServiceInstance *****
@Test
- @Ignore
+ // @Ignore
public void prepareCreateServiceInstance() {
ExecutionEntity mex = setupMock()
initPrepareCreateServiceInstance(mex)
@@ -288,7 +303,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void prepareCreateServiceInstance_Ex() {
ExecutionEntity mex = setupMock()
initPrepareCreateServiceInstance(mex)
@@ -304,7 +319,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
// ***** postProcessServiceInstanceCreate *****
@Test
-// @Ignore
+ // @Ignore
public void postProcessServiceInstanceCreate() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -323,7 +338,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void postProcessServiceInstanceCreate_BpmnError() {
ExecutionEntity mex = setupMock()
initPostProcessServiceInstanceCreate(mex)
@@ -336,7 +351,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void postProcessServiceInstanceCreate_Ex() {
ExecutionEntity mex = setupMock()
initPostProcessServiceInstanceCreate(mex)
@@ -352,7 +367,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
// ***** processDecomposition *****
@Test
-// @Ignore
+ // @Ignore
public void processDecomposition() {
ExecutionEntity mex = setupMock()
def svcdecomp = initProcessDecomposition(mex, true, true)
@@ -371,7 +386,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void processDecomposition_EmptyNet_EmptyVnf() {
ExecutionEntity mex = setupMock()
def svcdecomp = initProcessDecomposition(mex, true, true)
@@ -392,7 +407,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void processDecomposition_Ex() {
ExecutionEntity mex = setupMock()
def svcdecomp = initProcessDecomposition(mex, true, true)
@@ -408,7 +423,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
// ***** prepareCreateAllottedResourceTXC *****
@Test
- @Ignore
+ // @Ignore
public void prepareCreateAllottedResourceTXC() {
ExecutionEntity mex = setupMock()
initPrepareCreateAllottedResourceTXC(mex)
@@ -426,7 +441,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void prepareCreateAllottedResourceTXC_NullArList() {
ExecutionEntity mex = setupMock()
def svcdecomp = initPrepareCreateAllottedResourceTXC(mex)
@@ -446,7 +461,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void prepareCreateAllottedResourceTXC_Ex() {
ExecutionEntity mex = setupMock()
initPrepareCreateAllottedResourceTXC(mex)
@@ -462,7 +477,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
// ***** prepareCreateAllottedResourceBRG *****
@Test
- @Ignore
+ // @Ignore
public void prepareCreateAllottedResourceBRG() {
ExecutionEntity mex = setupMock()
initPrepareCreateAllottedResourceBRG(mex)
@@ -480,7 +495,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void prepareCreateAllottedResourceBRG_NullArList() {
ExecutionEntity mex = setupMock()
def svcdecomp = initPrepareCreateAllottedResourceBRG(mex)
@@ -500,7 +515,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void prepareCreateAllottedResourceBRG_Ex() {
ExecutionEntity mex = setupMock()
initPrepareCreateAllottedResourceBRG(mex)
@@ -516,7 +531,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
// ***** prepareVnfAndModulesCreate *****
@Test
-// @Ignore
+ // @Ignore
public void prepareVnfAndModulesCreate() {
ExecutionEntity mex = setupMock()
initPrepareVnfAndModulesCreate(mex)
@@ -532,7 +547,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void prepareVnfAndModulesCreate_EmptyList() {
ExecutionEntity mex = setupMock()
initPrepareVnfAndModulesCreate(mex)
@@ -550,7 +565,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void prepareVnfAndModulesCreate_NullList() {
ExecutionEntity mex = setupMock()
initPrepareVnfAndModulesCreate(mex)
@@ -568,7 +583,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void prepareVnfAndModulesCreate_Ex() {
ExecutionEntity mex = setupMock()
initPrepareVnfAndModulesCreate(mex)
@@ -584,7 +599,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
// ***** validateVnfCreate *****
@Test
-// @Ignore
+ // @Ignore
public void validateVnfCreate() {
ExecutionEntity mex = setupMock()
initValidateVnfCreate(mex)
@@ -598,7 +613,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void validateVnfCreate_Ex() {
ExecutionEntity mex = setupMock()
initValidateVnfCreate(mex)
@@ -614,7 +629,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
// ***** postProcessResponse *****
@Test
-// @Ignore
+ // @Ignore
public void postProcessResponse() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -635,7 +650,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void postProcessResponse_BpmnError() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -649,7 +664,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void postProcessResponse_Ex() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -666,7 +681,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
// ***** preProcessRollback *****
@Test
-// @Ignore
+ // @Ignore
public void preProcessRollback() {
ExecutionEntity mex = setupMock()
def wfe = initPreProcessRollback(mex)
@@ -680,7 +695,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void preProcessRollback_NullWfe() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -697,7 +712,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void preProcessRollback_BpmnError() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -714,7 +729,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void preProcessRollback_Ex() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -734,7 +749,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
// ***** postProcessRollback *****
@Test
-// @Ignore
+ // @Ignore
public void postProcessRollback() {
ExecutionEntity mex = setupMock()
def wfe = initPostProcessRollback(mex)
@@ -748,7 +763,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void postProcessRollback_NullWfe() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -765,7 +780,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void postProcessRollback_BpmnError() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -778,7 +793,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void postProcessRollback_Ex() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -798,7 +813,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
// ***** prepareFalloutRequest *****
@Test
-// @Ignore
+ // @Ignore
public void prepareFalloutRequest() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -817,7 +832,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void prepareFalloutRequest_Ex() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -833,7 +848,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
// ***** sendSyncError *****
@Test
-// @Ignore
+ // @Ignore
public void sendSyncError() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -857,7 +872,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void sendSyncError_NotWfe() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -883,7 +898,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void sendSyncError_NullWfe() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -909,7 +924,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void sendSyncError_Ex() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -928,7 +943,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
// ***** processJavaException *****
@Test
-// @Ignore
+ // @Ignore
public void processJavaException() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -948,7 +963,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void processJavaException_BpmnError() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -964,7 +979,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void processJavaException_Ex() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -985,6 +1000,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
private void initPreProcess(ExecutionEntity mex) {
when(mex.getVariable(DBGFLAG)).thenReturn("true")
when(mex.getVariable("bpmnRequest")).thenReturn(request)
+ when(mex.getVariable("URN_mso_workflow_aai_distribution_delay")).thenReturn("aaidelay")
when(mex.getVariable("mso-request-id")).thenReturn("mri")
when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
when(mex.getVariable("requestAction")).thenReturn("ra")
@@ -1008,7 +1024,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
when(mex.getVariable("createVcpeServiceRequest")).thenReturn(request)
when(mex.getVariable("serviceDecomposition")).thenReturn(svcdecomp)
- when(svcdecomp.toJsonString()).thenReturn("mydecomp")
+ when(svcdecomp.toJsonStringNoRootName()).thenReturn("mydecomp")
}
private void initPostProcessServiceInstanceCreate(ExecutionEntity mex) {
@@ -1037,6 +1053,10 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
return svcdecomp
}
+ private initAwaitAaiDistribution(ExecutionEntity mex) {
+ when(mex.getVariable(DBGFLAG)).thenReturn("true")
+ }
+
private ServiceDecomposition initPrepareCreateAllottedResourceTXC(ExecutionEntity mex) {
ServiceDecomposition svcdecomp = mock(ServiceDecomposition.class)
List<AllottedResource> arlst = new LinkedList<>()
@@ -1078,13 +1098,13 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
ModelInfo mod = mock(ModelInfo.class)
HomingSolution home = mock(HomingSolution.class)
- when(ar.toJsonString()).thenReturn("json"+id)
+ when(ar.toJsonStringNoRootName()).thenReturn("json"+id)
when(ar.getAllottedResourceType()).thenReturn("TunnelXConn")
when(ar.getModelInfo()).thenReturn(mod)
when(ar.getAllottedResourceRole()).thenReturn("TXCr")
when(ar.getHomingSolution()).thenReturn(home)
- when(mod.toJsonString()).thenReturn("model"+id)
+ when(mod.toJsonStringNoRootName()).thenReturn("model"+id)
when(home.getServiceInstanceId()).thenReturn("home"+id)
@@ -1096,13 +1116,13 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
ModelInfo mod = mock(ModelInfo.class)
HomingSolution home = mock(HomingSolution.class)
- when(ar.toJsonString()).thenReturn("json"+id)
+ when(ar.toJsonStringNoRootName()).thenReturn("json"+id)
when(ar.getAllottedResourceType()).thenReturn("BRG")
when(ar.getModelInfo()).thenReturn(mod)
when(ar.getAllottedResourceRole()).thenReturn("BRGr")
when(ar.getHomingSolution()).thenReturn(home)
- when(mod.toJsonString()).thenReturn("model"+id)
+ when(mod.toJsonStringNoRootName()).thenReturn("model"+id)
when(home.getServiceInstanceId()).thenReturn("home"+id)
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy
index df7c0cff97..fc53744b8b 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy
@@ -108,6 +108,7 @@ class DeleteVcpeResCustServiceTest extends GroovyTestBase {
verify(mex).setVariable("lcpCloudRegionId", "mdt1")
verify(mex).setVariable("tenantId", "8b1df54faa3b49078e3416e21370a3ba")
+ assertEquals("""{"tenantId":"8b1df54faa3b49078e3416e21370a3ba","lcpCloudRegionId":"mdt1"}""", map.get("cloudConfiguration"))
verify(mex).setVariable("sdncVersion", "1702")
verify(mex).setVariable("GENGS_type", "service-instance")
assertTrue(map.containsKey(Prefix+"requestInfo"))
@@ -146,6 +147,7 @@ class DeleteVcpeResCustServiceTest extends GroovyTestBase {
verify(mex).setVariable("lcpCloudRegionId", "mdt1")
verify(mex).setVariable("tenantId", "8b1df54faa3b49078e3416e21370a3ba")
+ assertEquals("""{"tenantId":"8b1df54faa3b49078e3416e21370a3ba","lcpCloudRegionId":"mdt1"}""", map.get("cloudConfiguration"))
verify(mex).setVariable("sdncVersion", "1702")
verify(mex).setVariable("GENGS_type", "service-instance")
assertTrue(map.containsKey(Prefix+"requestInfo"))
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy
index 1d4d3ea5a3..89c13f179c 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy
@@ -89,6 +89,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
verify(mex).setVariable("prefix", Prefix)
assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdncadapter_callback"))
+ assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdnc_replication_delay"))
assertTrue(checkMissingPreProcessRequest("serviceInstanceId"))
assertTrue(checkMissingPreProcessRequest("parentServiceInstanceId"))
assertTrue(checkMissingPreProcessRequest("allottedResourceModelInfo"))
@@ -296,8 +297,10 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
assertTrue(result.indexOf("<sdncadapter:SvcAction>myact</") >= 0)
assertTrue(result.indexOf("<allotted-resource-id>ari</") >= 0)
assertTrue(result.indexOf("<sdncadapter:SvcInstanceId>sii</") >= 0)
- assertTrue(result.indexOf("<service-instance-id>psii</") >= 0)
+ assertTrue(result.indexOf("<service-instance-id>sii</") >= 0)
assertTrue(result.indexOf("<parent-service-instance-id>psii</") >= 0)
+ assertTrue(result.indexOf("<subscription-service-type>sst</") >= 0)
+ assertTrue(result.indexOf("<global-customer-id>gci</") >= 0)
assertTrue(result.indexOf("<sdncadapter:CallbackUrl>scu</") >= 0)
assertTrue(result.indexOf("<request-id>mri</") >= 0)
assertTrue(result.indexOf("<brg-wan-mac-address>bwma</") >= 0)
@@ -326,8 +329,10 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
assertTrue(result.indexOf("<sdncadapter:SvcAction>myact</") >= 0)
assertTrue(result.indexOf("<allotted-resource-id>ari</") >= 0)
assertTrue(result.indexOf("<sdncadapter:SvcInstanceId>sii</") >= 0)
- assertTrue(result.indexOf("<service-instance-id>psii</") >= 0)
+ assertTrue(result.indexOf("<service-instance-id>sii</") >= 0)
assertTrue(result.indexOf("<parent-service-instance-id>psii</") >= 0)
+ assertTrue(result.indexOf("<subscription-service-type>sst</") >= 0)
+ assertTrue(result.indexOf("<global-customer-id>gci</") >= 0)
assertTrue(result.indexOf("<sdncadapter:CallbackUrl>scu</") >= 0)
assertTrue(result.indexOf("<request-id>mri</") >= 0)
assertTrue(result.indexOf("<brg-wan-mac-address>bwma</") >= 0)
@@ -886,6 +891,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
private void initPreProcess(ExecutionEntity mex) {
when(mex.getVariable(DBGFLAG)).thenReturn("true")
when(mex.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("sdncurn")
+ when(mex.getVariable("URN_mso_workflow_sdnc_replication_delay")).thenReturn("sdncdelay")
when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii")
when(mex.getVariable("allottedResourceModelInfo")).thenReturn("armi")
@@ -931,6 +937,8 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
when(mex.getVariable("allottedResourceId")).thenReturn("ari")
when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii")
+ when(mex.getVariable("subscriptionServiceType")).thenReturn("sst")
+ when(mex.getVariable("globalCustomerId")).thenReturn("gci")
when(mex.getVariable("sdncCallbackUrl")).thenReturn("scu")
when(mex.getVariable("msoRequestId")).thenReturn("mri")
when(mex.getVariable("brgWanMacAddress")).thenReturn("bwma")
@@ -963,7 +971,6 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
when(mex.getVariable("aaiARGetResponse")).thenReturn("<selflink>arlink</selflink>")
when(mex.getVariable("sdncAssignResponse")).thenReturn("<response-data>&lt;object-path&gt;assignlink&lt;/object-path&gt;</response-data>")
when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
- when(mex.getVariable("junitSleepMs")).thenReturn("5")
when(mex.getVariable("sdncCallbackUrl")).thenReturn("myurl")
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy
index 2b6d4ba6a0..b27e368316 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy
@@ -83,7 +83,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
// ***** preProcessRequest *****
@Test
-// @Ignore
+ // @Ignore
public void preProcessRequest() {
ExecutionEntity mex = setupMock()
initPreProcess(mex)
@@ -95,6 +95,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
verify(mex).setVariable("prefix", Prefix)
assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdncadapter_callback"))
+ assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdnc_replication_delay"))
assertTrue(checkMissingPreProcessRequest("serviceInstanceId"))
assertTrue(checkMissingPreProcessRequest("parentServiceInstanceId"))
assertTrue(checkMissingPreProcessRequest("allottedResourceModelInfo"))
@@ -107,7 +108,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
// ***** getAaiAR *****
@Test
-// @Ignore
+ // @Ignore
public void getAaiAR() {
MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
@@ -121,7 +122,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void getAaiAR_Duplicate() {
MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
@@ -137,7 +138,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void getAaiAR_NotActive() {
MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
@@ -153,7 +154,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void getAaiAR_NoStatus() {
MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
@@ -172,7 +173,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
// ***** createAaiAR *****
@Test
-// @Ignore
+ // @Ignore
public void createAaiAR() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -196,7 +197,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void createAaiAR_NoArid_NoModelUuids() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -226,7 +227,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void createAaiAR_MissingPsiLink() {
ExecutionEntity mex = setupMock()
initCreateAaiAr(mex)
@@ -241,7 +242,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void createAaiAR_HttpFailed() {
ExecutionEntity mex = setupMock()
initCreateAaiAr(mex)
@@ -254,7 +255,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void createAaiAR_BpmnError() {
ExecutionEntity mex = setupMock()
initCreateAaiAr(mex)
@@ -269,7 +270,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void createAaiAR_Ex() {
ExecutionEntity mex = setupMock()
initCreateAaiAr(mex)
@@ -287,7 +288,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
// ***** buildSDNCRequest *****
@Test
-// @Ignore
+ // @Ignore
public void buildSDNCRequest() {
ExecutionEntity mex = setupMock()
initBuildSDNCRequest(mex)
@@ -300,8 +301,10 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
assertTrue(result.indexOf("<sdncadapter:SvcAction>myact</") >= 0)
assertTrue(result.indexOf("<allotted-resource-id>ari</") >= 0)
assertTrue(result.indexOf("<sdncadapter:SvcInstanceId>sii</") >= 0)
- assertTrue(result.indexOf("<service-instance-id>psii</") >= 0)
+ assertTrue(result.indexOf("<service-instance-id>sii</") >= 0)
assertTrue(result.indexOf("<parent-service-instance-id>psii</") >= 0)
+ assertTrue(result.indexOf("<subscription-service-type>sst</") >= 0)
+ assertTrue(result.indexOf("<global-customer-id>gci</") >= 0)
assertTrue(result.indexOf("<sdncadapter:CallbackUrl>scu</") >= 0)
assertTrue(result.indexOf("<request-id>mri</") >= 0)
assertTrue(result.indexOf("<model-invariant-uuid/>") >= 0)
@@ -312,7 +315,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void buildSDNCRequest_Ex() {
ExecutionEntity mex = setupMock()
initBuildSDNCRequest(mex)
@@ -328,7 +331,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
// ***** preProcessSDNCAssign *****
@Test
-// @Ignore
+ // @Ignore
public void preProcessSDNCAssign() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -354,7 +357,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void preProcessSDNCAssign_BpmnError() {
ExecutionEntity mex = setupMock()
initPreProcessSDNC(mex)
@@ -367,7 +370,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void preProcessSDNCAssign_Ex() {
ExecutionEntity mex = setupMock()
initPreProcessSDNC(mex)
@@ -383,7 +386,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
// ***** preProcessSDNCCreate *****
@Test
-// @Ignore
+ // @Ignore
public void preProcessSDNCCreate() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -410,7 +413,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void preProcessSDNCCreate_BpmnError() {
ExecutionEntity mex = setupMock()
initPreProcessSDNC(mex)
@@ -423,7 +426,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void preProcessSDNCCreate_Ex() {
ExecutionEntity mex = setupMock()
initPreProcessSDNC(mex)
@@ -439,7 +442,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
// ***** preProcessSDNCActivate *****
@Test
-// @Ignore
+ // @Ignore
public void preProcessSDNCActivate() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -466,7 +469,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void preProcessSDNCActivate_BpmnError() {
ExecutionEntity mex = setupMock()
initPreProcessSDNC(mex)
@@ -479,7 +482,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void preProcessSDNCActivate_Ex() {
ExecutionEntity mex = setupMock()
initPreProcessSDNC(mex)
@@ -495,7 +498,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
// ***** validateSDNCResp *****
@Test
-// @Ignore
+ // @Ignore
public void validateSDNCResp() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -519,7 +522,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void validateSDNCResp_Get() {
ExecutionEntity mex = setupMock()
def data = initValidateSDNCResp(mex)
@@ -538,7 +541,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void validateSDNCResp_Unsuccessful() {
ExecutionEntity mex = setupMock()
initValidateSDNCResp(mex)
@@ -553,7 +556,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void validateSDNCResp_BpmnError() {
ExecutionEntity mex = setupMock()
initValidateSDNCResp(mex)
@@ -567,7 +570,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void validateSDNCResp_Ex() {
ExecutionEntity mex = setupMock()
initValidateSDNCResp(mex)
@@ -584,7 +587,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
// ***** preProcessSDNCGet *****
@Test
-// @Ignore
+ // @Ignore
public void preProcessSDNCGet_FoundAR() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -603,7 +606,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void preProcessSDNCGet_NotFoundAR() {
ExecutionEntity mex = setupMock()
def map = setupMap(mex)
@@ -624,7 +627,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void preProcessSDNCGet_Ex() {
ExecutionEntity mex = setupMock()
initPreProcessSDNCGet(mex)
@@ -640,7 +643,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
// ***** updateAaiAROrchStatus *****
@Test
-// @Ignore
+ // @Ignore
public void updateAaiAROrchStatus() {
MockPatchAllottedResource(CUST, SVC, INST, ARID)
@@ -655,7 +658,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
// ***** generateOutputs *****
@Test
-// @Ignore
+ // @Ignore
public void generateOutputs() {
ExecutionEntity mex = setupMock()
def txctop = FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml")
@@ -674,7 +677,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void generateOutputs_BadXml() {
ExecutionEntity mex = setupMock()
@@ -689,7 +692,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void generateOutputs_BpmnError() {
ExecutionEntity mex = setupMock()
@@ -704,7 +707,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void generateOutputs_Ex() {
ExecutionEntity mex = setupMock()
@@ -722,7 +725,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
// ***** preProcessRollback *****
@Test
-// @Ignore
+ // @Ignore
public void preProcessRollback() {
ExecutionEntity mex = setupMock()
WorkflowException wfe = mock(WorkflowException.class)
@@ -738,7 +741,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void preProcessRollback_NotWFE() {
ExecutionEntity mex = setupMock()
@@ -753,7 +756,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void preProcessRollback_BpmnError() {
ExecutionEntity mex = setupMock()
@@ -767,7 +770,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void preProcessRollback_Ex() {
ExecutionEntity mex = setupMock()
@@ -784,7 +787,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
// ***** postProcessRollback *****
@Test
-// @Ignore
+ // @Ignore
public void postProcessRollback() {
ExecutionEntity mex = setupMock()
WorkflowException wfe = mock(WorkflowException.class)
@@ -801,7 +804,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void postProcessRollback_NotWFE() {
ExecutionEntity mex = setupMock()
@@ -817,7 +820,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void postProcessRollback_BpmnError() {
ExecutionEntity mex = setupMock()
@@ -832,7 +835,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
}
@Test
-// @Ignore
+ // @Ignore
public void postProcessRollback_Ex() {
ExecutionEntity mex = setupMock()
@@ -860,6 +863,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
private void initPreProcess(ExecutionEntity mex) {
when(mex.getVariable(DBGFLAG)).thenReturn("true")
when(mex.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("sdncurn")
+ when(mex.getVariable("URN_mso_workflow_sdnc_replication_delay")).thenReturn("sdncdelay")
when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii")
when(mex.getVariable("allottedResourceModelInfo")).thenReturn("armi")
@@ -903,6 +907,8 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
when(mex.getVariable("allottedResourceId")).thenReturn("ari")
when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii")
+ when(mex.getVariable("subscriptionServiceType")).thenReturn("sst")
+ when(mex.getVariable("globalCustomerId")).thenReturn("gci")
when(mex.getVariable("sdncCallbackUrl")).thenReturn("scu")
when(mex.getVariable("msoRequestId")).thenReturn("mri")
}
@@ -923,7 +929,6 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
when(mex.getVariable("aaiARGetResponse")).thenReturn("<selflink>arlink</selflink>")
when(mex.getVariable("sdncAssignResponse")).thenReturn("<response-data>&lt;object-path&gt;assignlink&lt;/object-path&gt;</response-data>")
when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
- when(mex.getVariable("junitSleepMs")).thenReturn("5")
when(mex.getVariable("sdncCallbackUrl")).thenReturn("myurl")
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java
index 38461de5a0..0af43a2c42 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java
@@ -371,7 +371,6 @@ public class CreateVcpeResCustServiceTest extends AbstractTestBase {
variables.put("request-id", "testRequestId");
variables.put("serviceInstanceId", DEC_INST);
variables.put("allottedResourceId", ARID);
- variables.put("junitSleepMs", "5");
return variables;
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java
index 5b6f74fc7d..0373266ce1 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java
@@ -277,7 +277,6 @@ public class DoCreateAllottedResourceBRGTest extends AbstractTestBase {
variables.put("vni", "BRG");
variables.put("vgmuxBearerIP", "bearerip");
variables.put("brgWanMacAddress", "wanmac");
- variables.put("junitSleepMs", "5");
variables.put("serviceInstanceId", DEC_INST);
variables.put("parentServiceInstanceId", DEC_PARENT_INST);
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java
index 4323ccae1a..9cf059c24c 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java
@@ -283,7 +283,6 @@ public class DoCreateAllottedResourceTXCTest extends AbstractTestBase {
variables.put("allottedResourceType", "TXC");
variables.put("allottedResourceId", ARID);
variables.put("brgWanMacAddress", "wanmac");
- variables.put("junitSleepMs", "5");
variables.put("serviceInstanceId", DEC_INST);
variables.put("parentServiceInstanceId", DEC_PARENT_INST);
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml
index 9b201d9808..05583cd7aa 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml
@@ -16,8 +16,8 @@
</allotted-resource-identifiers>
<tunnelxconn-assignments>
<vni>my-vni</vni>
- <vgmux_bearer_ip>my-bearer-ip</vgmux_bearer_ip>
- <vgmux_lan_ip>my-lan-ip</vgmux_lan_ip>
+ <vgmux-bearer-ip>my-bearer-ip</vgmux-bearer-ip>
+ <vgmux-lan-ip>my-lan-ip</vgmux-lan-ip>
</tunnelxconn-assignments>
</tunnelxconn-topology>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml
index 9b201d9808..05583cd7aa 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml
@@ -16,8 +16,8 @@
</allotted-resource-identifiers>
<tunnelxconn-assignments>
<vni>my-vni</vni>
- <vgmux_bearer_ip>my-bearer-ip</vgmux_bearer_ip>
- <vgmux_lan_ip>my-lan-ip</vgmux_lan_ip>
+ <vgmux-bearer-ip>my-bearer-ip</vgmux-bearer-ip>
+ <vgmux-lan-ip>my-lan-ip</vgmux-lan-ip>
</tunnelxconn-assignments>
</tunnelxconn-topology>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties b/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties
index aad79b00f0..325ee3ce97 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties
+++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties
@@ -40,6 +40,8 @@ mso.sdnc.timeout.ucpe.async.hours=120
mso.sdnc.timeout.ucpe.async.minutes=5
mso.workflow.message.endpoint=http://localhost:28080/mso/WorkflowMesssage
mso.workflow.sdncadapter.callback=http://localhost:28080/mso/SDNCAdapterCallbackService
+mso.workflow.sdnc.replication.delay=PT0.01S
+mso.workflow.aai.distribution.delay=PT0.01S
mso.catalog.db.endpoint=http://localhost:28090
diff --git a/bpmn/MSOMockServer/.gitignore b/bpmn/MSOMockServer/.gitignore
deleted file mode 100644
index f6c8fbcdef..0000000000
--- a/bpmn/MSOMockServer/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/bin
-/target
-/target
-/target
diff --git a/bpmn/MSOMockServer/WebContent/META-INF/MANIFEST.MF b/bpmn/MSOMockServer/WebContent/META-INF/MANIFEST.MF
deleted file mode 100644
index 254272e1c0..0000000000
--- a/bpmn/MSOMockServer/WebContent/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Class-Path:
-
diff --git a/bpmn/MSOMockServer/WebContent/WEB-INF/jboss-deployment-structure.xml b/bpmn/MSOMockServer/WebContent/WEB-INF/jboss-deployment-structure.xml
deleted file mode 100644
index fb268917f2..0000000000
--- a/bpmn/MSOMockServer/WebContent/WEB-INF/jboss-deployment-structure.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<jboss-deployment-structure>
- <deployment>
- <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
- <exclusions>
- <module name="org.apache.log4j" />
- <module name="org.slf4j" />
- <module name="org.slf4j.impl" />
- <module name="org.jboss.resteasy.resteasy-jackson-provider" />
- <module name="org.jboss.resteasy.resteasy-jettison-provider" />
- </exclusions>
- <dependencies>
- <module name="org.jboss.jandex" slot="main" />
- <module name="org.javassist" slot="main" />
- <module name="org.antlr" slot="main" />
- <module name="org.dom4j" slot="main" />
- <module name="org.jboss.resteasy.resteasy-jackson2-provider" services="import" />
- <!-- This module contain the ProviderBase class: -->
- <module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" export="true" />
- </dependencies>
- </deployment>
-</jboss-deployment-structure>
diff --git a/bpmn/MSOMockServer/WebContent/WEB-INF/web.xml b/bpmn/MSOMockServer/WebContent/WEB-INF/web.xml
deleted file mode 100644
index 1aa8cdb8d7..0000000000
--- a/bpmn/MSOMockServer/WebContent/WEB-INF/web.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
-</web-app> \ No newline at end of file
diff --git a/bpmn/MSOMockServer/pom.xml b/bpmn/MSOMockServer/pom.xml
deleted file mode 100644
index 500535d740..0000000000
--- a/bpmn/MSOMockServer/pom.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.openecomp.so</groupId>
- <artifactId>bpmn</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.openecomp.so</groupId>
- <artifactId>MSOMockServer</artifactId>
- <packaging>war</packaging>
-
- <build>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.4</version>
- <configuration>
- <attachClasses>true</attachClasses>
- <archiveClasses>true</archiveClasses>
- <failOnMissingWebXml>false</failOnMissingWebXml>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
-
- <dependency>
- <groupId>com.github.tomakehurst</groupId>
- <artifactId>wiremock</artifactId>
- <version>1.56</version>
- <classifier>standalone</classifier>
- <exclusions>
- <exclusion>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.skyscreamer</groupId>
- <artifactId>jsonassert</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xmlunit</groupId>
- <artifactId>xmlunit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.jayway.jsonpath</groupId>
- <artifactId>json-path</artifactId>
- </exclusion>
- <exclusion>
- <groupId>net.sf.jopt-simple</groupId>
- <artifactId>jopt-simple</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.openecomp.so</groupId>
- <artifactId>common</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>javax.ws.rs-api</artifactId>
- <version>2.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-client</artifactId>
- <version>3.0.8.Final</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
-</project> \ No newline at end of file
diff --git a/bpmn/MSOMockServer/src/main/resources/__files/sdncSimResponse.xml b/bpmn/MSOMockServer/src/main/resources/__files/sdncSimResponse.xml
deleted file mode 100644
index bef293dfde..0000000000
--- a/bpmn/MSOMockServer/src/main/resources/__files/sdncSimResponse.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:v1="http://domain2.openecomp.org/workflow/sdnc/adapter/schema/v1">
- <soapenv:Header />
- <soapenv:Body>
- <SDNCAdapterCallbackRequest
- xmlns="http://domain2.openecomp.org/workflow/sdnc/adapter/schema/v1">
- <CallbackHeader>
- <RequestId>d325c9a7-84c0-4081-b979-9cc773a0976d</RequestId>
- <ResponseCode>200</ResponseCode>
- <ResponseMessage>OK</ResponseMessage>
- </CallbackHeader>
- <RequestData xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">&lt;layer3-service-list
- xmlns="com:att:sdnctl:l3api"&gt;&lt;service-instance-id&gt;0XX/VXXX/003717//Shakeout&lt;/service-instance-id&gt;&lt;service-status&gt;&lt;rpc-name&gt;svc-topology-operation&lt;/rpc-name&gt;&lt;rpc-action&gt;delete&lt;/rpc-action&gt;&lt;request-status&gt;synccomplete&lt;/request-status&gt;&lt;final-indicator&gt;Y&lt;/final-indicator&gt;&lt;l3sdn-action&gt;DisconnectLayer3ServiceRequest&lt;/l3sdn-action&gt;&lt;response-timestamp&gt;2015-10-22T02:11:52.010Z&lt;/response-timestamp&gt;&lt;/service-status&gt;&lt;service-data&gt;&lt;svc-config-additional-data/&gt;&lt;/service-data&gt;&lt;/layer3-service-list&gt;
- </RequestData>
- </SDNCAdapterCallbackRequest>
- </soapenv:Body>
-</soapenv:Envelope>
diff --git a/bpmn/MSOMockServer/src/main/webapp/WEB-INF/jboss-web.xml b/bpmn/MSOMockServer/src/main/webapp/WEB-INF/jboss-web.xml
deleted file mode 100644
index cca27bb062..0000000000
--- a/bpmn/MSOMockServer/src/main/webapp/WEB-INF/jboss-web.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 5.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
-<jboss-web>
- <security-domain>other</security-domain>
- <context-root>/msomock</context-root>
-</jboss-web> \ No newline at end of file
diff --git a/bpmn/pom.xml b/bpmn/pom.xml
index 4f96cc1ffe..a83e85f148 100644
--- a/bpmn/pom.xml
+++ b/bpmn/pom.xml
@@ -31,7 +31,6 @@
<modules>
<module>MSOCoreBPMN</module>
- <module>MSOMockServer</module>
<module>MSORESTClient</module>
<module>MSOCommonBPMN</module>
<module>MSOInfrastructureBPMN</module>
diff --git a/docs/BPMN_Main_Process_Flows.rst b/docs/BPMN_Main_Process_Flows.rst
new file mode 100644
index 0000000000..abc006e813
--- /dev/null
+++ b/docs/BPMN_Main_Process_Flows.rst
@@ -0,0 +1,40 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+BPMN Main Process Flows
+========================
+
+Characteristics
+----------------
+
+**Invoked by an API Handler**
+
+ The BPMN application (war) exposes a REST endpoint to which the API Handler(s) send requests for flow execution. The message sent by the API Handler to this endpoint is a JSON wrapper containing:
+
+ * The original request received by the API handler from the portal or other client.
+ * Metadata such as the request-id generated by the API Handler for the request.
+ * The name of the BPMN process to execute (obtained by the API Handler from the mso_catalog.service_recipe table.
+
+**Asynchronous Service Model**
+
+ All main process flows implement an asynchronous service model. The connection to the API Handler is kept open until the main process flow sends back a response. In the flow shown below, this is done by the "Send Sync Ack Response" script task. A flow is expected to send a response after validating the request, but before performing any long running tasks or tasks that could cause the process to be suspended.
+
+ After the synchronous response is sent, the flow continues to execute. When the flow ends, it may optionally send an asynchronous notification to a callback URL provided in the original request (behavior depends on the API agreement)
+
+**Typically calls one or more subprocess flows**
+
+ Main process flows usually implement the high-level service logic, delegating the "real" work to reusable subflows (Building Blocks) or custom subflows
+
+**Handles "Completion" and "Fallout" tasks**
+
+ "Completion" tasks are those that occur when the process ends successfully, and "Fallout" tasks are those that occur when the process fails. Activities include:
+
+ * Updating the mso_requests database.
+ * Rolling back uncompleted work.
+ * Sending an asynchronous callback notification.
+
+Example: CreateVfModuleVolumeInfraV1.bpmn
+------------------------------------------
+
+.. image:: images/BPMN_Main_Process_Flows_1.png \ No newline at end of file
diff --git a/docs/BPMN_Project_Deployment_Strategy.rst b/docs/BPMN_Project_Deployment_Strategy.rst
new file mode 100644
index 0000000000..50f48363ed
--- /dev/null
+++ b/docs/BPMN_Project_Deployment_Strategy.rst
@@ -0,0 +1,35 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+BPMN Project Deployment Strategy
+==================================
+
+Single Application with Embedded Process Engine
+------------------------------------------------
+
+Deployment in SO is currently limited to a single process application: MSOInfrastructureBPMN. The WAR file for this application contains everything needed to execute the infrastructure process flows, including:
+
+ * BPMN process flows, java classes, groovy scripts, and resource files from MSOInfrastructureBPMN itself.
+
+ * BPMN process flows, java classes, groovy scripts, and resource files from other SO projects, like MSOCommonBPMN and MSOCoreBPMN.
+
+ * An embedded Camunda Process Engine to execute the flows.
+
+The process application exposes a REST endpoint to the API Handler(s) for receiving flow execution requests.
+
+Development is required in SO to be able to support one a more versatile deployment strategy, probably one of the following:
+
+Shared Process Engine
+----------------------
+
+The Camunda Process Engine is created and manged as a Wildfly module. This single engine is shared by all process applications.
+
+Multiple Applications, each with an Embedded Process Engine
+-------------------------------------------------------------
+
+More than one application could be deployed, each having its own embedded process engine.
+
+
+
+
diff --git a/docs/BPMN_Project_Structure.rst b/docs/BPMN_Project_Structure.rst
new file mode 100644
index 0000000000..3c5ccc3e7d
--- /dev/null
+++ b/docs/BPMN_Project_Structure.rst
@@ -0,0 +1,47 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+BPMN Project Structure
+=======================
+
+BPMN main process flow
+----------------------
+
+A BPMN main process flow is a top-level flow. All main process flows are under the src/main/resources/process folder.
+
+CreateVfModuleVolumeInfraV1 is a main process flow.
+
+.. image:: images/bpmn_project_structure_1.png
+
+Open BPMN files with the camunda modeler (standalone application). To launch the modeler from eclipse, right-click→open-with→Other→Browse. Select Check the boxes on the dialog so that eclipse will open all .bpmn files with the camunda-modeler executable.
+
+BPMN subprocess flow
+---------------------
+
+A BPMN subprocess flow is meant to be invoked by other flows (either main process flows or other subprocess flows). All subprocess flows are under the src/main/resources/subprocess folder.
+
+The CreateVfModuleVolumeInfraV1 process flow is delivered with two custom subflows: DoCreateVfModuleVolumeV2 and DoCreateVfModuleVolumeRollback.
+
+.. image:: images/bpmn_project_structure_2.png
+
+Groovy scripts
+---------------
+
+There is one groovy script for each BPMN file. Groovy scripts are invoked by script tasks within the BPMN flows.
+
+.. image:: images/bpmn_project_structure_3.png
+
+Unit Tests
+-----------
+
+Normally, we create a unit test class for every flow. This one is missing a unit test for its rollback flow.
+
+.. image:: images/bpmn_project_structure_4.png
+
+Unit Test Resource Files
+------------------------
+
+Any files needed by the unit tests are kept under the src/test/resources/__files folder.
+
+.. image:: images/bpmn_project_structure_5.png \ No newline at end of file
diff --git a/docs/BPMN_Subprocess_Process_Flows.rst b/docs/BPMN_Subprocess_Process_Flows.rst
new file mode 100644
index 0000000000..cf2da40e87
--- /dev/null
+++ b/docs/BPMN_Subprocess_Process_Flows.rst
@@ -0,0 +1,32 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+BPMN Subprocess Process Flows
+==============================
+
+Characteristics
+----------------
+
+**Invoked by other flows**
+
+ A BPMN Call_Activity_ provides the mechanism to invoke subprocess flows. The Called Element attribute of the Call Activity specifies the name of the subprocess to execute.
+
+.. _Call_Activity: https://docs.camunda.org/manual/7.7/reference/bpmn20/subprocesses/call-activity/
+
+**Input and Output variable mapping**
+
+ In the modeler, you can specify a list of "In Mappings". With this, you can map execution variables from the calling flow to the subprocess. The subprocess always has its own copy of each variable. To transfer values back to the calling flow, you specify "Out Mappings".
+
+**May throw MSOWorkflowException**
+
+ The current best practice for reporting errors from subprocess is described here:
+
+ * The subprocess should create a WorkflowException object and store it in an execution called WorkflowException.
+ * The WorkflowException object contains an error code and an error message.
+ * The subprocess should then throw an MSOWorkflowException BPMN event which may be handled by the calling flow.
+
+Example: VnfAdapterRestV1.bpmn
+-------------------------------
+
+.. image:: images/BPMN_Subprocess_process_flows_1.png
diff --git a/docs/Building_SO.rst b/docs/Building_SO.rst
new file mode 100644
index 0000000000..29ff6bd0e8
--- /dev/null
+++ b/docs/Building_SO.rst
@@ -0,0 +1,79 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Building SO
+============
+
+Build software with unit tests
+------------------------------
+
+.. code-block:: bash
+
+ cd $HOME/onap/workspace/SO/libs
+
+ $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml clean install
+
+ cd $HOME/onap/workspace/SO/so
+
+ $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml clean install
+
+Build software without unit tests
+----------------------------------
+
+.. code-block:: bash
+
+ cd $HOME/onap/workspace/SO/libs
+
+ $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml -DskipTests -Dmaven.test.skip=true clean install
+
+ cd $HOME/onap/workspace/SO/so
+
+ $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml -DskipTests -Dmaven.test.skip=true clean install
+
+Build docker images
+--------------------
+
+SO docker images are built using the "docker" maven profile. During the build, the chef-repo and so-docker repositories are cloned from gerrit into the "so" directory structure. Extra definitions are required in the build environment to make this happen. You may need to adjust the definition of mso.chef.git.url.prefix to match the way you authenticate yourself when performing git clone.
+
+If you are behind a corporate firewall, you can specify proxy definitions for the constructed docker images.
+
+**Remove existing docker containers and images**
+
+.. code-block:: bash
+
+ docker stop $(docker ps -qa)
+
+ docker rm $(docker ps -aq)
+
+ docker rmi -f $(docker images -q)
+
+**Build docker images (without proxy definition):**
+
+.. code-block:: bash
+
+ cd $HOME/onap/workspace/SO/so/packages
+
+ $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml clean install -P docker
+ -Dmso.chef.git.url.prefix=ssh://$USER@gerrit.onap.org:29418 -Dmso.chef.git.branchname=master
+ -Dmso.chef.git.url.suffix.chef.repo=so/chef-repo -Dmso.chef.git.url.suffix.chef.config=so/so-config
+ -Ddocker.buildArg.http_proxy=http://one.proxy.att.com:8080
+ -Ddocker.buildArg.https_proxy=http://one.proxy.att.com:8080
+
+**Build docker images (with proxy definition):**
+
+.. code-block:: bash
+
+ cd $HOME/onap/workspace/SO/so/packages
+
+ $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml clean install -P docker
+ -Dmso.chef.git.url.prefix=ssh://$USER@gerrit.onap.org:29418 -Dmso.chef.git.branchname=master
+ -Dmso.chef.git.url.suffix.chef.repo=so/chef-repo -Dmso.chef.git.url.suffix.chef.config=so/so-config
+ -Ddocker.buildArg.http_proxy=http://proxyhost:port -Ddocker.buildArg.https_proxy=http://proxyhost:port
+
+Build with Integration Tests
+-----------------------------
+
+This is done exactly as described for building docker images, except that the maven profile to use is "with-integration-tests" instead of "docker". Integration tests are executed inside docker containers constructed by the build.
+
+
diff --git a/docs/Camunda_Cockpit_Community_Edition.rst b/docs/Camunda_Cockpit_Community_Edition.rst
new file mode 100644
index 0000000000..a9379decc9
--- /dev/null
+++ b/docs/Camunda_Cockpit_Community_Edition.rst
@@ -0,0 +1,44 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Camunda Cockpit Community Edition
+=================================
+
+On a deployed instance of SO, you can use the Camunda_Cockpit to view BPMN 2.0 workflow definitions in the deployment.
+
+.. _Camunda_Cockpit: https://camunda.org/features/cockpit/
+
+Unfortunately, the Community Edition of Camunda included with SO is not fully featured. It cannot be used to inspect running and completed process instances. For that, the Enterprise Edition is required.
+
+Logging In
+-----------
+
+Because port 8080 on the docker host machine is forwarded to port 8080 in the SO docker container you can log into the cockpit by browsing to this URL:
+
+ http://*dockerhost*:8080/camunda/app/admin/default/#/login
+
+ Where dockerhost is the docker host system.
+
+If you can use a browser on the docker host system, then use a localhost address:
+
+ http://localhost:8080/camunda/app/admin/default/#/login
+
+The user is "admin" and the password is the same as the jboss admin password, which is not displayed here.
+
+.. image:: images/Camunda_Cockpit_1.png
+
+Viewing Process Definitions
+---------------------------
+
+Use the drop-down menu next to the home icon and select the "Cockpit" option:
+
+.. image:: images/Camunda_Cockpit_2.png
+
+The number of deployed process definitions should be displayed. Click on it.
+
+.. image:: images/Camunda_Cockpit_3.png
+
+Now you should see an actual list of deployed process definitions. You can click on any of them to view them.
+
+.. image:: images/Camunda_Cockpit_4.png
diff --git a/docs/Camunda_Cockpit_Enterprise_Edition.rst b/docs/Camunda_Cockpit_Enterprise_Edition.rst
new file mode 100644
index 0000000000..3e2d15bf15
--- /dev/null
+++ b/docs/Camunda_Cockpit_Enterprise_Edition.rst
@@ -0,0 +1,143 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Camunda Cockpit Enterprise Edition
+==================================
+
+The Community Edition of Camunda is the version normally built into SO. With the Community Edition, you can see process definitions, but you cannot inspect running or completed process instances, which is an essential debugging capability. This capability is available only in the Enterprise Edition and requires a commercial license. If you have such a license, you can build SO with the Enterprise Edition. Your use must be consistent with the terms of your license, of course.
+
+With the Enterprise Edition cockpit, you can:
+
+ * See a trace of tasks executed by a running or completed process instance.
+ * Look at execution variables in a running or completed process instance.
+ * Look at called subprocesses in a running or completed process instance.
+
+Maven Repository for Camunda EE Artifacts
+------------------------------------------
+
+To build with Camunda EE, you will need a maven repository containing the Camunda EE artifacts. This can be a nexus repository or a local repository in your filesystem.
+
+To construct a local repository, start with this structure for the 7.7.3-ee version of Camunda:
+
+ camunda-ee-repository.zip_
+
+.. _camunda-ee-repository.zip: https://wiki.onap.org/download/attachments/16001686/camunda-ee-repository.zip?version=1&modificationDate=1507838888000&api=v2
+
+*NOTE*: the zip archive does not contain the actual Enterprise Edition JAR and WAR files. It contains zero-length files as placeholders. You will need to replace the zero-length files with files you obtain from Camunda. The archive does contain all the poms, checksums, and metadata required to make it a functional maven repository.
+
+Here's the minimum set of artifacts you need to build the SO Amsterdam release software:
+
+ camunda-engine-7.7.3-ee.jar
+
+ camunda-webapp-7.7.3-ee-classes.jar
+
+ camunda-webapp-7.7.3-ee.war
+
+ camunda-webapp-ee-jboss-standalone-7.7.3-ee.war
+
+ camunda-engine-cdi-7.7.3-ee.jar
+
+ camunda-engine-rest-7.7.3-ee-classes.jar
+
+ camunda-engine-plugin-spin-7.7.3-ee.jar
+
+ camunda-engine-plugin-connect-7.7.3-ee.jar
+
+ camunda-engine-rest-core-7.7.3-ee.jar
+
+ camunda-engine-feel-api-7.7.3-ee.jar
+
+ camunda-engine-feel-juel-7.7.3-ee.jar
+
+ camunda-engine-dmn-7.7.3-ee.jar
+
+ camunda-engine-spring-7.7.3-ee.jar
+
+ camunda-bpmn-model-7.7.3-ee.jar
+
+ camunda-xml-model-7.7.3-ee.jar
+
+ camunda-dmn-model-7.7.3-ee.jar
+
+ camunda-cmmn-model-7.7.3-ee.jar
+
+Maven settings.xml
+------------------
+
+Add a profile to your maven settings.xml to include the repository containing your Camunda EE artifacts.
+
+For example:
+
+.. code-block:: bash
+
+ <profile>
+ <!-- profile for artifacts not in public repositories -->
+ <id>my-local-artifacts</id>
+ <repositories>
+ <repository>
+ <!-- Local repository for Camunda Enterprise Edition -->
+ <!-- YOU MUST HAVE A VALID LICENSE TO USE THIS -->
+ <id>camunda-ee</id>
+ <name>camunda-ee</name>
+ <url>file:///home/john/onap/camunda-ee-repository</url>
+ </repository>
+ </repositories>
+ </profile>
+
+And add your profile to the list of active profiles:
+
+.. code-block:: bash
+
+ <activeProfiles>
+
+ <activeProfile>my-local-artifacts</activeProfile>
+
+ <activeProfile>openecomp-staging</activeProfile>
+
+ <activeProfile>openecomp-public</activeProfile>
+
+ <activeProfile>openecomp-release</activeProfile>
+
+ <activeProfile>openecomp-snapshots</activeProfile>
+
+ <activeProfile>opendaylight-release</activeProfile>
+
+ <activeProfile>opendaylight-snapshots</activeProfile>
+
+ </activeProfiles>
+
+Building
+--------
+
+Add these options to the mvn command line when you build "so"
+
+.. code-block:: bash
+
+ -Dcamunda.version=7.7.3-ee -Dcamunda.bpm.webapp.artifact=camunda-webapp-ee-jboss-standalone
+
+Installation
+-------------
+
+The cockpit is part of the SO image. There are no special installation requirements. When you log in, you will need to enter your license information. Alternatively, you can insert your license directly into the camundabpmn database before you log in:
+
+.. code-block:: bash
+
+ INSERT INTO camundabpmn.ACT_GE_PROPERTY VALUES ('camunda-license-key','YOUR-LICENCE-KEY-HERE',1);
+
+Logging In
+-----------
+
+Because port 8080 on the docker host machine is forwarded to port 8080 in the SO docker container you can log into the Enterprise Edition cockpit by browsing to this URL:
+
+ http://*dockerhost*:8080/camunda
+
+ Where dockerhost is the docker host system.
+
+If you can use a browser on the docker host system, then use a localhost address:
+
+ http://localhost:8080/camunda
+
+The user is "admin" and the password is the same as the jboss admin password, which is not displayed here.
+
+.. image:: images/Camunda_Cockpit_Enterprise_1.png
diff --git a/docs/Camunda_Modeler.rst b/docs/Camunda_Modeler.rst
new file mode 100644
index 0000000000..e2ff06d595
--- /dev/null
+++ b/docs/Camunda_Modeler.rst
@@ -0,0 +1,19 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Camunda Modeler
+=================
+
+The Camunda_Modeler_ is the editor for BPMN 2.0 process flows. It is a standalone application. NOTE: the Camunda eclipse plugin is no longer supported and should not be used.
+
+.. _Camunda_Modeler: https://docs.camunda.org/manual/latest/modeler/camunda-modeler/
+
+.. image:: images/camunda_modeler_1.png
+
+Modeler Templates
+------------------
+
+Some work has already been done in MSO to develop templates_ for "building block" subprocess flows. When a template is provided for a BPMN element, the modeler displays a custom form for inputting parameters. This significantly simplifies flow construction and reduces the chance of making mistakes.
+
+.. _templates: https://docs.camunda.org/manual/7.7/modeler/camunda-modeler/element-templates/ \ No newline at end of file
diff --git a/docs/Configure_git_and_gerrit.rst b/docs/Configure_git_and_gerrit.rst
new file mode 100644
index 0000000000..c4598faf7b
--- /dev/null
+++ b/docs/Configure_git_and_gerrit.rst
@@ -0,0 +1,93 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Configure git and gerrit
+========================
+
+Basics
+------
+The recommended version of git is 2.7.4 or later. Check the installed version in the Ubuntu VM:
+
+.. code-block:: bash
+
+ git --version
+
+Create an SSH key to user with gerrit. Use no passphrase.
+
+.. code-block:: bash
+
+ ssh-keygen -t rsa
+
+Enter your SSH public key (id_rsa) into gerrit:
+
+- Browse to https://gerrit.onap.org
+- Log in
+- Open the menu next to your name (under the green search button)
+
+.. image:: images/Configure_git_1.png
+
+- Select "Settings"
+- In the "Settings" sidebar, click "SSH Public Keys"`
+- Click "Add Key..."
+- Paste the entire contents of $HOME/.ssh/id_rsa.pub into the text area and click "Add".
+
+.. image:: images/Configure_git_2.png
+
+Install the git-review package.
+
+.. code-block:: bash
+
+ sudo apt update
+ sudo apt install git-review
+
+Create $HOME/.gitconfig (replace highlighted values with your own information):
+ [user]
+
+ name = FirstName LastName
+
+ email = you@yourcompany.com
+
+ [core]
+
+ autocrlf = false
+
+ [merge]
+
+ tool = vimdiff
+
+ [gitreview]
+
+ username = YourLinuxFoundationId
+
+**If you're behind a corporate firewall and your proxy server has SOCKS support...**
+
+You may be able to use the SSH protocol with git, which is preferred versus HTTP. This method is known to work in the AT&T corporate network.
+Install the socat package, which allows you to tunnel SSH connections through a proxy that supports SOCKS:
+
+.. code-block:: bash
+
+ sudo apt update
+ sudo apt install socat
+
+Create (or append to) $HOME/.ssh/config (replace highlighted values with your information)
+
+ Host gerrit.onap.org
+
+ User userid
+
+ Hostname gerrit.onap.org
+
+ ProxyCommand socat - PROXY:host:%h:%p,proxyport=port
+
+ IdentityFile /home/userid/.ssh/id_rsa
+
+ ServerAliveInterval 10
+
+Verify that you have connectivity to gerrit through the proxy. Answer "yes" to continue connecting, if prompted.
+
+.. code-block:: bash
+
+ ssh -p 29418 gerrit.onap.org
+
+.. image:: images/Configure_git_3.png
diff --git a/docs/Developer_Info.rst b/docs/Developer_Info.rst
new file mode 100644
index 0000000000..d077323f71
--- /dev/null
+++ b/docs/Developer_Info.rst
@@ -0,0 +1,13 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Developer Information
+======================
+
+.. toctree::
+ :maxdepth: 1
+
+ Install_Configure_SO.rst
+ architecture.rst
+ offered_consumed_apis.rst \ No newline at end of file
diff --git a/docs/Install_Configure_SO.rst b/docs/Install_Configure_SO.rst
index 5771a10e84..3f7b903ac8 100644
--- a/docs/Install_Configure_SO.rst
+++ b/docs/Install_Configure_SO.rst
@@ -2,7 +2,7 @@
.. http://creativecommons.org/licenses/by/4.0
.. Copyright 2017 Huawei Technologies Co., Ltd.
-Install and Configure Service Orchestrator
+SO Install & Configure
==========================================
Get Ubuntu
@@ -18,79 +18,147 @@ Make sure you have the VirtualBox Guest Additions ISO for your version of Virtua
Create a new VM in VirtualBox for Ubuntu
----------------------------------------
Type: Linux
+
Version: Ubuntu (64-bit)
+
At least 2048 MB memory
+
At least 40 GB VDI
+
Network: Attached to: NAT
Create a port-forwarding rule for SSH
-------------------------------------
Create a port-forwarding rule so that you can use PuTTY (or other SSH client) to connect to the VM.
+
Go to "Network" settings in VirtualBox, add a port forwarding rule:
+
Name: SSH
+
Protocol: TCP
+
Host IP: 127.0.0.1
+
Host Port: 1022
+
Guest IP: <leave blank>
+
Guest Port: 22
+.. image:: images/Configure_ubuntu_SO_1.png
+
+.
+
+.. image:: images/Configure_ubuntu_SO_2.png
+
Create Shared Folder
--------------------
This is oriented to Windows users. If you're using a MAC or a Linux host computer, the details may be different. You can share any folder on the host computer with the Ubuntu VM. On Windows, a practical choice is to share the C:\Users folder, so that your Windows home directory will be accessible from the Ubuntu VM.
+
Go to "Shared Folders" settings in VirtualBox, add a share:
+
Folder Path: C:\Users
+
Folder Name: Users
+
Auto-mount: <checked>
+
Read-only: <unchecked>
+.. image:: images/Configure_ubuntu_SO_3.png
+
+.
+
+.. image:: images/Configure_ubuntu_SO_4.png
+
Install Ubuntu in the VM
------------------------
On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image". Select your Ubuntu ISO image.
+.. image:: images/Configure_ubuntu_SO_5.png
+
After selecting the ISO image, start the VM.
+
Follow the prompts to install Ubuntu.
Proxy Configuration (optional)
------------------------------
If you're behind a corporate firewall, configure some proxy settings. NOTE: your proxy configuration may require username and password credentials, not shown here.
**Ubuntu system proxy setting:**
+
System Settings → Network → Network proxy
+
(Replace "proxyhost" and port with your actual proxy information)
+.. image:: images/Configure_ubuntu_SO_6.png
+
**apt proxy setting:**
Edit /etc/apt/apt.conf and add one line at the top (replace "proxyhost:port" with your actual proxy information):
+
Acquire::http::Proxy "http://proxyhost:port";
+
Reboot the VM.
Install SSH Server
------------------
-sudo apt update
-sudo apt install openssh-server
+
+.. code-block:: bash
+
+ sudo apt update
+ sudo apt install openssh-server
Connect to the VM from your host computer
-----------------------------------------
The PuTTY SSH client is popular. A connection to localhost:1022 (or whatever port you have forwarded) will go to the VM.
+.. image:: images/Configure_ubuntu_SO_7.png
+
Install VirtualBox Guest Additions
----------------------------------
On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image". Select your VirtualBox Guest Additions ISO image.
+.. image:: images/Configure_ubuntu_SO_8.png
+
In a VM terminal window, mount the cdrom:
+
+.. code-block:: bash
+
sudo mkdir -p /media/cdrom
sudo mount /dev/cdrom /media/cdrom
+
Install necessary dependencies:
- sudo apt update
- sudo apt install gcc g++ dkms
+
+.. code-block:: bash
+
+ sudo apt update
+ sudo apt install gcc g++ dkms
+
Install the guest additions. NOTE: look for errors in the command output! If you see an error that says you are missing kernel headers, the most likely cause is that you are using a VirtualBox version that is too old. The error message is misleading.
+
+.. code-block:: bash
+
cd /media/cdrom
sudo ./VBoxLinuxAdditions.run
+.. image:: images/Configure_ubuntu_SO_9.png
+
Add yourself to the vboxsf user group (replace "userid" with your user ID):
+
+.. code-block:: bash
+
sudo usermod -a -G vboxsf userid
+
Reboot the VM.
+
In a VM terminal window, verify that you can access your home directory on the host computer, which should be mounted under here:
/media/sf_Users
Further Reading
----------------------------------------
-https://wiki.onap.org/display/DW/Development+Environment \ No newline at end of file
+
+.. toctree::
+ :maxdepth: 1
+
+ Install_Docker.rst
+ Configure_git_and_gerrit.rst
+ Workspace_and_Development_Tools.rst \ No newline at end of file
diff --git a/docs/Install_Docker.rst b/docs/Install_Docker.rst
new file mode 100644
index 0000000000..5712691dbf
--- /dev/null
+++ b/docs/Install_Docker.rst
@@ -0,0 +1,85 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Install Docker
+===============
+
+Make sure curl is installed on the Ubuntu VM:
+
+.. code-block:: bash
+
+ sudo apt update
+ sudo apt install curl
+
+If you are behind a corporate firewall (replace "proxyhost:port" with your actual proxy information)
+ https_proxy="https://*proxyhost:port*" curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
+
+Otherwise:
+ curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
+Expected Response:
+ OK
+Add the docker package repository:
+ sudo apt-add-repository "deb https://apt.dockerproject.org/repo ubuntu-xenial main"
+
+Install packages:
+
+.. code-block:: bash
+
+ sudo apt update
+ sudo apt-cache policy docker-engine
+ sudo apt install docker-engine
+ sudo apt install docker-compose
+
+If you are behind a corporate firewall, you will need to configure proxy settings for docker so that images may be obtained from internet repositories. In the commands shown here, replace *"proxyhost:port"*, *"yourdomain1.com"*, and *"yourdomain2.com"* with appropriate values.
+
+ Make the docker configuration directory:
+
+.. code-block:: bash
+
+ sudo mkdir -p /etc/systemd/system/docker.service.d
+
+ Edit (create) this file:
+
+.. code-block:: bash
+
+ sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf
+
+ Add these lines:
+
+ [Service]
+
+ Environment="HTTP_PROXY=https://*proxyhost:port*"
+
+ Environment="HTTPS_PROXY=https://*proxyhost:port*"
+
+ Environment="NO_PROXY=localhost,127.0.0.1,.yourdomain1.com,.yourdomain2.com"
+
+ Restart docker:
+
+.. code-block:: bash
+
+ sudo systemctl daemon-reload
+ sudo systemctl restart docker
+
+Add yourself to the docker user group (replace "userid" with your user ID):
+
+.. code-block:: bash
+
+ sudo usermod -a -G docker *userid*
+
+Log out and log back in so that the user group change will takeeffect.
+
+Verify that you can connect to docker as yourself (i.e. not as root):
+
+.. code-block:: bash
+
+ docker ps
+
+Verify that you can download and run the hello-world container
+
+.. code-block:: bash
+
+ docker run hello-world
+
+.. image:: images/Docker_install_1.png \ No newline at end of file
diff --git a/docs/SO_API_v0.1.pdf b/docs/SO_API_v0.1.pdf
new file mode 100644
index 0000000000..42fdc5fe3d
--- /dev/null
+++ b/docs/SO_API_v0.1.pdf
Binary files differ
diff --git a/docs/SO_R1_Interface.rst b/docs/SO_R1_Interface.rst
new file mode 100644
index 0000000000..41e127d225
--- /dev/null
+++ b/docs/SO_R1_Interface.rst
@@ -0,0 +1,17 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+SO R1 Interfaces
+================
+
+.. image:: images/SO_R1_1.png
+
+Service Orchestrator in R1 uses interfaces from both the MSO seed code and as well as new interfaces between the new components of ONAP.
+The below documentation of the SO APIs and are reviewed in the architecture committee meeting on 22/08/2017.
+
+See :download:`SO_API_v0.1.pdf`
+
+The interface between UUi and SO for the E2E VoLTE service:
+
+See :download:`UUI-SO_API_Specification_v0.1.docx` \ No newline at end of file
diff --git a/docs/UUI-SO API Specification v0.1(1).docx b/docs/UUI-SO_API_Specification_v0.1.docx
index a6dfbd0b1a..d68cccf4d3 100644
--- a/docs/UUI-SO API Specification v0.1(1).docx
+++ b/docs/UUI-SO_API_Specification_v0.1.docx
Binary files differ
diff --git a/docs/Working_with_SO_Docker.rst b/docs/Working_with_SO_Docker.rst
new file mode 100644
index 0000000000..ee958efa41
--- /dev/null
+++ b/docs/Working_with_SO_Docker.rst
@@ -0,0 +1,208 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Working with SO Docker
+======================
+
+Verify that docker images are built
+------------------------------------
+
+.. code-block:: bash
+
+ docker images openecomp/mso
+
+ *Example Output:*
+
+ REPOSITORY TAG IMAGE ID CREATED SIZE
+
+ openecomp/mso 1.1-SNAPSHOT-latest 419e9d8a17e8 3 minutes ago 1.62GB
+
+ openecomp/mso 1.1.0-SNAPSHOT-STAGING-20170926T2015 419e9d8a17e8 3 minutes ago 1.62GB
+
+ openecomp/mso latest 419e9d8a17e8 3 minutes ago 1.62GB
+
+Start the mariadb container
+----------------------------
+
+.. code-block:: bash
+
+ cd $HOME/onap/workspace/SO/docker-config
+
+ MTU=1500 docker-compose up mariadb
+
+*Example Output:*
+
+.. code-block:: bash
+
+ . . . many lines omitted . . .
+ mariadb_1 | Version: '10.1.11-MariaDB-1~jessie-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
+
+Log into the mariadb container and run the mysql client program
+---------------------------------------------------------------
+
+.. code-block:: bash
+
+ docker exec -it dockerconfig_mariadb_1 /bin/bash
+ mysql -uroot -ppassword
+
+Start the mso container
+-----------------------
+
+.. code-block:: bash
+
+ cd $HOME/onap/workspace/SO/docker-config
+
+ MTU=1500 docker-compose up mso
+
+*Example Output:*
+
+.. code-block:: bash
+
+ . . . many lines omitted . . .
+ mso_1 | 20:59:31,586 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.Final
+ (WildFly Core 2.2.0.Final) started in 59937ms - Started 2422 of 2747 services (604 services are lazy, passive or
+ on-demand)
+
+Log into the mso container
+--------------------------
+
+.. code-block:: bash
+
+ docker exec -it dockerconfig_mso_1 /bin/bash
+
+Inspect a docker image
+----------------------
+
+This command shows interesting information about the structure of the mso image. Note that an image is NOT a running container. It is the template that a container is created from.
+
+.. code-block:: bash
+
+ docker inspect openecomp/mso
+ Example Output:
+
+ [
+ {
+ "Id": "sha256:419e9d8a17e8d7e876dfc36c1f3ed946bccbb29aa6faa6cd8e32fbc77c0ef6e5",
+ "RepoTags": [
+ "openecomp/mso:1.1-SNAPSHOT-latest",
+ "openecomp/mso:1.1.0-SNAPSHOT-STAGING-20170926T2015",
+ "openecomp/mso:latest"
+ ],
+ "RepoDigests": [],
+ "Parent": "sha256:70f1ba3d6289411fce96ba78755a3fd6055a370d33464553d72c753889b12693",
+ "Comment": "",
+ "Created": "2017-09-26T20:40:10.179358574Z",
+ "Container": "284aa05909390a3c0ffc1ec6d0f6e2071799d56b08369707505897bc73d2ea30",
+ "ContainerConfig": {
+ "Hostname": "6397aa10f0c4",
+ "Domainname": "",
+ "User": "root",
+ "AttachStdin": false,
+ "AttachStdout": false,
+ "AttachStderr": false,
+ "ExposedPorts": {
+ "8080/tcp": {}
+ },
+ "Tty": false,
+ "OpenStdin": false,
+ "StdinOnce": false,
+ "Env": [
+ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
+ "HTTP_PROXY=",
+ "HTTPS_PROXY=",
+ "http_proxy=",
+ "https_proxy=",
+ "JBOSS_HOME=/opt/jboss",
+ "CHEF_REPO_NAME=chef-repo",
+ "CHEF_CONFIG_NAME=mso-config"
+ ],
+ "Cmd": [
+ "/bin/sh",
+ "-c",
+ "#(nop) ",
+ "CMD [\"/opt/mso/scripts/start-jboss-server.sh\"]"
+ ],
+ "ArgsEscaped": true,
+ "Image": "sha256:70f1ba3d6289411fce96ba78755a3fd6055a370d33464553d72c753889b12693",
+ "Volumes": {
+ "/shared": {}
+ },
+ "WorkingDir": "",
+ "Entrypoint": null,
+ "OnBuild": [],
+ "Labels": {
+ "Description": "This image contains the ONAP SO",
+ "Version": "1.0"
+ }
+ },
+ "DockerVersion": "17.05.0-ce",
+ "Author": "\"The ONAP Team\"",
+ "Config": {
+ "Hostname": "6397aa10f0c4",
+ "Domainname": "",
+ "User": "root",
+ "AttachStdin": false,
+ "AttachStdout": false,
+ "AttachStderr": false,
+ "ExposedPorts": {
+ "8080/tcp": {}
+ },
+ "Tty": false,
+ "OpenStdin": false,
+ "StdinOnce": false,
+ "Env": [
+ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
+ "HTTP_PROXY=",
+ "HTTPS_PROXY=",
+ "http_proxy=",
+ "https_proxy=",
+ "JBOSS_HOME=/opt/jboss",
+ "CHEF_REPO_NAME=chef-repo",
+ "CHEF_CONFIG_NAME=mso-config"
+ ],
+ "Cmd": [
+ "/opt/mso/scripts/start-jboss-server.sh"
+ ],
+ "ArgsEscaped": true,
+ "Image": "sha256:70f1ba3d6289411fce96ba78755a3fd6055a370d33464553d72c753889b12693",
+ "Volumes": {
+ "/shared": {}
+ },
+ "WorkingDir": "",
+ "Entrypoint": null,
+ "OnBuild": [],
+ "Labels": {
+ "Description": "This image contains the ONAP SO",
+ "Version": "1.0"
+ }
+ },
+ "Architecture": "amd64",
+ "Os": "linux",
+ "Size": 1616881263,
+ "VirtualSize": 1616881263,
+ "GraphDriver": {
+ "Data": null,
+ "Name": "aufs"
+ },
+ "RootFS": {
+ "Type": "layers",
+ "Layers": [
+ "sha256:a2022691bf950a72f9d2d84d557183cb9eee07c065a76485f1695784855c5193",
+ "sha256:ae620432889d2553535199dbdd8ba5a264ce85fcdcd5a430974d81fc27c02b45",
+ . . . many lines omitted . . .
+ "sha256:0f9e9dacce9191617e979f05e32ee782b1632e07130fd7fee19b0b2d635aa006",
+ "sha256:84572c6389f8ae41150e14a8f1a28a70720de91ab1032f8755b5449dc04449c9"
+ ]
+ }
+ }
+]
+
+Log into the mso image
+-----------------------
+
+This command allows you to inspect the files inside the mso image. Note that an image is NOT a running container. It is the template that a container is created from.
+
+.. code-block:: bash
+
+ docker run -it --entrypoint=/bin/bash openecomp/mso -i
diff --git a/docs/Workspace_and_Development_Tools.rst b/docs/Workspace_and_Development_Tools.rst
new file mode 100644
index 0000000000..2012a20b09
--- /dev/null
+++ b/docs/Workspace_and_Development_Tools.rst
@@ -0,0 +1,107 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Workspace and Development Tools
+===============================
+
+We recognize that there are different ways to set up a workspace and different tools that may be chosen. This is just one way to set things up.
+
+Suggested Directory Structure
+------------------------------
+*NOTE*: You may have different versions of eclipse and java.
+
+ onap
+
+ .m2
+
+ apache-maven-3.3.9
+
+ camunda-modeler
+
+ eclipse-jee-neon-3-linux-gtk-x86_64
+
+ jdk1.8.0_131
+
+ workspace
+
+ SO
+ chef-repo
+
+ docker-config
+
+ libs
+
+ so
+
+ so-config
+
+Java
+-----
+Download the latest Java_8_SE_Development_Kit_ from Oracle. Select a Linux x64 package.
+
+Unpack it.
+
+.. _Java_8_SE_Development_Kit: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
+
+Maven
+------
+
+Download the Apache_Maven_3.3.9_ binary. NOTE: 3.3.9 is the recommended version, even though much higher versions are available.
+
+Unpack it.
+
+.. _Apache_Maven_3.3.9: https://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/
+
+Create an .m2 directory for maven and put settings.xml_ in it. Edit the local repository path in settings.xml to make it correct for your environment. Everything else should be OK.
+
+.. _settings.xml: https://wiki.onap.org/download/attachments/15997820/settings.xml?version=1&modificationDate=1506156303000&api=v2
+
+Camunda Modeler
+---------------
+
+Download the Camunda_Modeler_. Select the Linux x64 package.
+Unpack it.
+
+.. _Camunda_Modeler: https://camunda.org/download/modeler/
+
+Eclipse
+-------
+
+Download Eclipse_for_Linux_. Select the 64-bit Eclipse IDE for Java EE Developers. Oxygen seems to be the latest version. These instructions were written for Neon.
+Unpack it.
+
+.. _Eclipse_for_Linux: https://www.eclipse.org/downloads/eclipse-packages/?osType=linux
+
+In the eclipse directory, edit eclipse.ini
+
+ Add (or change) the -vm setting so that it points to your JDK.
+
+ Adjust the maximum heap space (2GB is recommended).
+
+ Example:
+
+.. image:: images/Workspace_and_Development_Tools.png
+
+Eclipse Settings
+----------------
+
+**Configure eclipse to use your external maven 3.3.9 installation:**
+ Go to Window→Preferences→Maven→Installations
+
+ Click "Add" and browse to your apache-maven-3.3.9 directory. Click "OK" to select it.
+
+ Click "Finish"
+
+.. image:: images/Workspace_and_Development_Tools_2.png
+
+Make sure the external installation is selected:
+
+.. image:: images/Workspace_and_Development_Tools_3.png
+
+**Configure eclipse to use your settings.xml**
+ Go to Window→Preferences→Maven→User Settings
+
+ Type the full path to your settings.xml file into the "User Settings" box and click "OK".
+
+.. image:: images/Workspace_and_Development_Tools_4.png \ No newline at end of file
diff --git a/docs/architecture.rst b/docs/architecture.rst
index c9f6838216..7c01077dcc 100644
--- a/docs/architecture.rst
+++ b/docs/architecture.rst
@@ -2,15 +2,108 @@
.. http://creativecommons.org/licenses/by/4.0
.. Copyright 2017 Huawei Technologies Co., Ltd.
-Service Orchestrator
+SO - Service Orchestration
========================================================
SO Architecture
----------------
-SO architecture and internal details could be found in the below wiki link
-https://wiki.onap.org/pages/viewpage.action?pageId=9830754
+.. image:: images/SO_Architecture_1.png
+
+SO Sub-Components
+------------------
+
+**API Handler**
+
+ RESTful interface to northbound clients
+
+ * Handle service-level and infrastructure (VNF & network) requests
+
+ Service-agnostic APIs
+ * “Service Instantiation API”
+
+ Model-driven recipe selection
+ * Use SO Catalog to map input requests to BPMN flows
+ * Dynamic lookup based on service-model + action
+ * Input data forwarded to BPMN flow
+
+ Track open and completed requests via SO Request DB
+
+ Multiple API-H modules may support different APIs
+
+**BPMN Execution Engine**
+
+ Open-source Camunda platform
+ * Support BPMN 2.0 service recipes
+
+ Expose RESTful interface to API-H (unique path per recipe)
+
+ Make use of common “building block” sub-flows
+
+ Sequence orchestration steps for each Resource in the recipe
+ * Request and configure network resources via SDN-C
+ * Manage cloud resources via PO (OpenStack)
+ * Update inventory via A&AI
+
+ Perform error handling/rollback
+
+**Resource Adapters**
+
+ Interfaces to lower level controllers and other ONAP components
+ * Platform Orchestrator, SDN-Controller, APP-Controller, VFC-Controllers
+ * Hides the details of complex interfaces (e.g. OpenStack APIs)
+ * Expose interfaces to BPMN flows as SOAP or REST APIs
+ * Support synchronous and asynchronous operations
+
+ Provided as part of SO platform for use by all BPMN flows
+
+ Use SO Catalog to map resource requests to a recipe/template
+
+ Data-driven design
+ * Catalog templates may be updated via self-service (outside of release cycles)
+ * Merge input parameters with templates at run-time
+
+**Data Stores**
+
+ Request DB
+ * Tracks open and completed requests
+
+ SO Catalog
+ * SO view of the SDC Catalog
+ * service and resource models, recipes, and templates
+ * Populated via SDC distribution service from TOSCA models
+
+ Camunda DB
+ * Maintain state for BPMN flows
+ * Supports multiple active engines
+
+**SDC Distribution Client**
+
+ Receive updated service models from SDC
+ * Event-bus notifications when new models available
+ * HTTP retrieval of models (TOSCA) and artifacts (Heat)
+
+ Receive distributions as TOSCA models
+
+ Populate SO Catalog
+
+ Support self-service updates to models and artifacts
+
+Third Party and Open Source
+---------------------------
+
+**BPMN Engine**
+ Camunda (open source)
+
+**Other Open Source Components of Note:**
+ JBOSS EAP/Wildfly
+ MySQL/MariaDB
+ Openstack Java SDK (“woorea”)
+
+
+
+
+
+
+
-.. toctree::
- :maxdepth: 1
- \ No newline at end of file
diff --git a/docs/developer_information.rst b/docs/developer_information.rst
new file mode 100644
index 0000000000..739a1f2050
--- /dev/null
+++ b/docs/developer_information.rst
@@ -0,0 +1,20 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+SO Developer Information
+========================
+
+.. toctree::
+ :maxdepth: 1
+
+ BPMN_Project_Structure.rst
+ Camunda_Modeler.rst
+ BPMN_Main_Process_Flows.rst
+ BPMN_Subprocess_Process_Flows.rst
+ BPMN_Project_Deployment_Strategy.rst
+ Building_SO.rst
+ Working_with_SO_Docker.rst
+ Camunda_Cockpit_Community_Edition.rst
+ Camunda_Cockpit_Enterprise_Edition.rst
+ \ No newline at end of file
diff --git a/docs/images/BPMN_Main_Process_Flows_1.png b/docs/images/BPMN_Main_Process_Flows_1.png
new file mode 100644
index 0000000000..57337d621f
--- /dev/null
+++ b/docs/images/BPMN_Main_Process_Flows_1.png
Binary files differ
diff --git a/docs/images/BPMN_Subprocess_process_flows_1.png b/docs/images/BPMN_Subprocess_process_flows_1.png
new file mode 100644
index 0000000000..5ec7e7ce9c
--- /dev/null
+++ b/docs/images/BPMN_Subprocess_process_flows_1.png
Binary files differ
diff --git a/docs/images/Camunda_Cockpit_1.png b/docs/images/Camunda_Cockpit_1.png
new file mode 100644
index 0000000000..cdcc6f3b8e
--- /dev/null
+++ b/docs/images/Camunda_Cockpit_1.png
Binary files differ
diff --git a/docs/images/Camunda_Cockpit_2.png b/docs/images/Camunda_Cockpit_2.png
new file mode 100644
index 0000000000..a696a68cb0
--- /dev/null
+++ b/docs/images/Camunda_Cockpit_2.png
Binary files differ
diff --git a/docs/images/Camunda_Cockpit_3.png b/docs/images/Camunda_Cockpit_3.png
new file mode 100644
index 0000000000..a298fe0669
--- /dev/null
+++ b/docs/images/Camunda_Cockpit_3.png
Binary files differ
diff --git a/docs/images/Camunda_Cockpit_4.png b/docs/images/Camunda_Cockpit_4.png
new file mode 100644
index 0000000000..ff445f364d
--- /dev/null
+++ b/docs/images/Camunda_Cockpit_4.png
Binary files differ
diff --git a/docs/images/Camunda_Cockpit_Enterprise_1.png b/docs/images/Camunda_Cockpit_Enterprise_1.png
new file mode 100644
index 0000000000..cdcc6f3b8e
--- /dev/null
+++ b/docs/images/Camunda_Cockpit_Enterprise_1.png
Binary files differ
diff --git a/docs/images/Configure_git_1.png b/docs/images/Configure_git_1.png
new file mode 100644
index 0000000000..2d4ce85036
--- /dev/null
+++ b/docs/images/Configure_git_1.png
Binary files differ
diff --git a/docs/images/Configure_git_2.png b/docs/images/Configure_git_2.png
new file mode 100644
index 0000000000..44ceeff5fe
--- /dev/null
+++ b/docs/images/Configure_git_2.png
Binary files differ
diff --git a/docs/images/Configure_git_3.png b/docs/images/Configure_git_3.png
new file mode 100644
index 0000000000..f44a0b4bff
--- /dev/null
+++ b/docs/images/Configure_git_3.png
Binary files differ
diff --git a/docs/images/Configure_ubuntu_SO_1.png b/docs/images/Configure_ubuntu_SO_1.png
new file mode 100644
index 0000000000..a5a8301628
--- /dev/null
+++ b/docs/images/Configure_ubuntu_SO_1.png
Binary files differ
diff --git a/docs/images/Configure_ubuntu_SO_2.png b/docs/images/Configure_ubuntu_SO_2.png
new file mode 100644
index 0000000000..d3b215f76f
--- /dev/null
+++ b/docs/images/Configure_ubuntu_SO_2.png
Binary files differ
diff --git a/docs/images/Configure_ubuntu_SO_3.png b/docs/images/Configure_ubuntu_SO_3.png
new file mode 100644
index 0000000000..ef4f21bbf4
--- /dev/null
+++ b/docs/images/Configure_ubuntu_SO_3.png
Binary files differ
diff --git a/docs/images/Configure_ubuntu_SO_4.png b/docs/images/Configure_ubuntu_SO_4.png
new file mode 100644
index 0000000000..f857eff017
--- /dev/null
+++ b/docs/images/Configure_ubuntu_SO_4.png
Binary files differ
diff --git a/docs/images/Configure_ubuntu_SO_5.png b/docs/images/Configure_ubuntu_SO_5.png
new file mode 100644
index 0000000000..01d2016752
--- /dev/null
+++ b/docs/images/Configure_ubuntu_SO_5.png
Binary files differ
diff --git a/docs/images/Configure_ubuntu_SO_6.png b/docs/images/Configure_ubuntu_SO_6.png
new file mode 100644
index 0000000000..17b9986d90
--- /dev/null
+++ b/docs/images/Configure_ubuntu_SO_6.png
Binary files differ
diff --git a/docs/images/Configure_ubuntu_SO_7.png b/docs/images/Configure_ubuntu_SO_7.png
new file mode 100644
index 0000000000..d233847306
--- /dev/null
+++ b/docs/images/Configure_ubuntu_SO_7.png
Binary files differ
diff --git a/docs/images/Configure_ubuntu_SO_8.png b/docs/images/Configure_ubuntu_SO_8.png
new file mode 100644
index 0000000000..01d2016752
--- /dev/null
+++ b/docs/images/Configure_ubuntu_SO_8.png
Binary files differ
diff --git a/docs/images/Configure_ubuntu_SO_9.png b/docs/images/Configure_ubuntu_SO_9.png
new file mode 100644
index 0000000000..2cc96b379f
--- /dev/null
+++ b/docs/images/Configure_ubuntu_SO_9.png
Binary files differ
diff --git a/docs/images/Docker_install_1.png b/docs/images/Docker_install_1.png
new file mode 100644
index 0000000000..1e9c177ee5
--- /dev/null
+++ b/docs/images/Docker_install_1.png
Binary files differ
diff --git a/docs/images/SO_Architecture_1.png b/docs/images/SO_Architecture_1.png
new file mode 100644
index 0000000000..a50c01bdd9
--- /dev/null
+++ b/docs/images/SO_Architecture_1.png
Binary files differ
diff --git a/docs/images/SO_R1_1.png b/docs/images/SO_R1_1.png
new file mode 100644
index 0000000000..7bf98fcfb2
--- /dev/null
+++ b/docs/images/SO_R1_1.png
Binary files differ
diff --git a/docs/images/Workspace_and_Development_Tools.png b/docs/images/Workspace_and_Development_Tools.png
new file mode 100644
index 0000000000..46f8fe4baf
--- /dev/null
+++ b/docs/images/Workspace_and_Development_Tools.png
Binary files differ
diff --git a/docs/images/Workspace_and_Development_Tools_2.png b/docs/images/Workspace_and_Development_Tools_2.png
new file mode 100644
index 0000000000..1f3fff0776
--- /dev/null
+++ b/docs/images/Workspace_and_Development_Tools_2.png
Binary files differ
diff --git a/docs/images/Workspace_and_Development_Tools_3.png b/docs/images/Workspace_and_Development_Tools_3.png
new file mode 100644
index 0000000000..3d2f35df82
--- /dev/null
+++ b/docs/images/Workspace_and_Development_Tools_3.png
Binary files differ
diff --git a/docs/images/Workspace_and_Development_Tools_4.png b/docs/images/Workspace_and_Development_Tools_4.png
new file mode 100644
index 0000000000..31a424e4d2
--- /dev/null
+++ b/docs/images/Workspace_and_Development_Tools_4.png
Binary files differ
diff --git a/docs/images/bpmn_project_structure_1.png b/docs/images/bpmn_project_structure_1.png
new file mode 100644
index 0000000000..d94b6fb1e2
--- /dev/null
+++ b/docs/images/bpmn_project_structure_1.png
Binary files differ
diff --git a/docs/images/bpmn_project_structure_2.png b/docs/images/bpmn_project_structure_2.png
new file mode 100644
index 0000000000..15f63603c6
--- /dev/null
+++ b/docs/images/bpmn_project_structure_2.png
Binary files differ
diff --git a/docs/images/bpmn_project_structure_3.png b/docs/images/bpmn_project_structure_3.png
new file mode 100644
index 0000000000..e9f0d8d0db
--- /dev/null
+++ b/docs/images/bpmn_project_structure_3.png
Binary files differ
diff --git a/docs/images/bpmn_project_structure_4.png b/docs/images/bpmn_project_structure_4.png
new file mode 100644
index 0000000000..c5cbb8b148
--- /dev/null
+++ b/docs/images/bpmn_project_structure_4.png
Binary files differ
diff --git a/docs/images/bpmn_project_structure_5.png b/docs/images/bpmn_project_structure_5.png
new file mode 100644
index 0000000000..3c3e9064ea
--- /dev/null
+++ b/docs/images/bpmn_project_structure_5.png
Binary files differ
diff --git a/docs/images/camunda_modeler_1.png b/docs/images/camunda_modeler_1.png
new file mode 100644
index 0000000000..2316c9849c
--- /dev/null
+++ b/docs/images/camunda_modeler_1.png
Binary files differ
diff --git a/docs/index.rst b/docs/index.rst
index e2fbfcdc1e..9fd4cc3f97 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -2,7 +2,7 @@
.. http://creativecommons.org/licenses/by/4.0
.. Copyright 2017 Huawei Technologies Co., Ltd.
-ONAP Service Orchestration Documentation
+ONAP SO
========================================
.. toctree::
@@ -11,4 +11,5 @@ ONAP Service Orchestration Documentation
Install_Configure_SO.rst
architecture.rst
offered_consumed_apis.rst
- \ No newline at end of file
+ developer_information.rst
+ release-notes.rst \ No newline at end of file
diff --git a/docs/installation.rst b/docs/installation.rst
index fc5af916e1..07f534e1b3 100644
--- a/docs/installation.rst
+++ b/docs/installation.rst
@@ -1,97 +1,112 @@
-.. _open_cli_schema_version_1_0:
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-.. Copyright 2017 Huawei Technologies Co., Ltd.
-
-Install and Configure Service Orchestrator
-==========================================
-
-Get Ubuntu
-----------
-Get the Ubuntu ISO image from ubuntu.com. The recommended version is 16.04.3 LTS (Long Term Support), desktop edition.
-
-Get VirtualBox and VirtualBox Guest Additions
----------------------------------------------
-Make sure you have the VirtualBox Guest Additions ISO for your version of VirtualBox. I'm using VirtualBox 5.1.28. Save the Guest Additions ISO on your host computer along with the Ubuntu ISO. Get the Guest Additions ISO from here:
- http://download.virtualbox.org/virtualbox
-*NOTE*: Guest Additions versions prior to 5.1 will not work with Ubuntu 16.04.3. If you have an earlier version of VirtualBox, you should upgrade to the latest 5.1 version.
-
-Create a new VM in VirtualBox for Ubuntu
-----------------------------------------
-Type: Linux
-Version: Ubuntu (64-bit)
-At least 2048 MB memory
-At least 40 GB VDI
-Network: Attached to: NAT
-
-Create a port-forwarding rule for SSH
--------------------------------------
-Create a port-forwarding rule so that you can use PuTTY (or other SSH client) to connect to the VM.
-Go to "Network" settings in VirtualBox, add a port forwarding rule:
-Name: SSH
-Protocol: TCP
-Host IP: 127.0.0.1
-Host Port: 1022
-Guest IP: <leave blank>
-Guest Port: 22
-
-Create Shared Folder
---------------------
-This is oriented to Windows users. If you're using a MAC or a Linux host computer, the details may be different. You can share any folder on the host computer with the Ubuntu VM. On Windows, a practical choice is to share the C:\Users folder, so that your Windows home directory will be accessible from the Ubuntu VM.
-Go to "Shared Folders" settings in VirtualBox, add a share:
-Folder Path: C:\Users
-Folder Name: Users
-Auto-mount: <checked>
-Read-only: <unchecked>
-
-Install Ubuntu in the VM
-------------------------
-On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image". Select your Ubuntu ISO image.
-
-After selecting the ISO image, start the VM.
-Follow the prompts to install Ubuntu.
-
-Proxy Configuration (optional)
-------------------------------
-If you're behind a corporate firewall, configure some proxy settings. NOTE: your proxy configuration may require username and password credentials, not shown here.
-**Ubuntu system proxy setting:**
- System Settings → Network → Network proxy
- (Replace "proxyhost" and port with your actual proxy information)
-
-**apt proxy setting:**
- Edit /etc/apt/apt.conf and add one line at the top (replace "proxyhost:port" with your actual proxy information):
- Acquire::http::Proxy "http://proxyhost:port";
- Reboot the VM.
-
-Install SSH Server
-------------------
-sudo apt update
-sudo apt install openssh-server
-
-Connect to the VM from your host computer
------------------------------------------
- The PuTTY SSH client is popular. A connection to localhost:1022 (or whatever port you have forwarded) will go to the VM.
-
-Install VirtualBox Guest Additions
-----------------------------------
-On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image". Select your VirtualBox Guest Additions ISO image.
-
-In a VM terminal window, mount the cdrom:
- sudo mkdir -p /media/cdrom
- sudo mount /dev/cdrom /media/cdrom
-Install necessary dependencies:
- sudo apt update
- sudo apt install gcc g++ dkms
-Install the guest additions. NOTE: look for errors in the command output! If you see an error that says you are missing kernel headers, the most likely cause is that you are using a VirtualBox version that is too old. The error message is misleading.
- cd /media/cdrom
- sudo ./VBoxLinuxAdditions.run
-
-Add yourself to the vboxsf user group (replace "userid" with your user ID):
- sudo usermod -a -G vboxsf userid
-Reboot the VM.
-In a VM terminal window, verify that you can access your home directory on the host computer, which should be mounted under here:
- /media/sf_Users
-
-Further Reading
-----------------------------------------
-https://wiki.onap.org/display/DW/Development+Environment \ No newline at end of file
+.. _open_cli_schema_version_1_0:
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Install and Configure Service Orchestrator
+==========================================
+
+Get Ubuntu
+----------
+Get the Ubuntu ISO image from ubuntu.com. The recommended version is 16.04.3 LTS (Long Term Support), desktop edition.
+
+Get VirtualBox and VirtualBox Guest Additions
+---------------------------------------------
+Make sure you have the VirtualBox Guest Additions ISO for your version of
+VirtualBox. I'm using VirtualBox 5.1.28. Save the Guest Additions ISO on your
+host computer along with the Ubuntu ISO. Get the Guest Additions ISO from
+here: http://download.virtualbox.org/virtualbox
+
+*NOTE*: Guest Additions versions prior to 5.1 will not work with Ubuntu 16.04.3. If you have an earlier version of VirtualBox, you should upgrade to the latest 5.1 version.
+
+Create a new VM in VirtualBox for Ubuntu
+----------------------------------------
+Type: Linux
+Version: Ubuntu (64-bit)
+At least 2048 MB memory
+At least 40 GB VDI
+Network: Attached to: NAT
+
+Create a port-forwarding rule for SSH
+-------------------------------------
+Create a port-forwarding rule so that you can use PuTTY (or other SSH client) to connect to the VM.
+Go to "Network" settings in VirtualBox, add a port forwarding rule:
+Name: SSH
+Protocol: TCP
+Host IP: 127.0.0.1
+Host Port: 1022
+Guest IP: <leave blank>
+Guest Port: 22
+
+Create Shared Folder
+--------------------
+This is oriented to Windows users. If you're using a MAC or a Linux host computer, the details may be different. You can share any folder on the host computer with the Ubuntu VM. On Windows, a practical choice is to share the C:\Users folder, so that your Windows home directory will be accessible from the Ubuntu VM.
+Go to "Shared Folders" settings in VirtualBox, add a share:
+Folder Path: C:\Users
+Folder Name: Users
+Auto-mount: <checked>
+Read-only: <unchecked>
+
+Install Ubuntu in the VM
+------------------------
+On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image". Select your Ubuntu ISO image.
+
+After selecting the ISO image, start the VM.
+Follow the prompts to install Ubuntu.
+
+Proxy Configuration (optional)
+------------------------------
+If you're behind a corporate firewall, configure some proxy settings. NOTE: your proxy configuration may require username and password credentials, not shown here.
+**Ubuntu system proxy setting**:
+
+- System Settings → Network → Network proxy
+ (Replace "proxyhost" and port with your actual proxy information)
+
+**apt proxy setting**:
+
+- Edit /etc/apt/apt.conf and add one line at the top (replace "proxyhost:port" with your actual proxy information):
+ Acquire::http::Proxy "http://proxyhost:port";
+- Reboot the VM.
+
+Install SSH Server
+------------------
+sudo apt update
+sudo apt install openssh-server
+
+Connect to the VM from your host computer
+-----------------------------------------
+The PuTTY SSH client is popular. A connection to localhost:1022 (or whatever port you have forwarded) will go to the VM.
+
+Install VirtualBox Guest Additions
+----------------------------------
+On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image". Select your VirtualBox Guest Additions ISO image.
+
+In a VM terminal window, mount the cdrom::
+
+ sudo mkdir -p /media/cdrom
+ sudo mount /dev/cdrom /media/cdrom
+
+Install necessary dependencies::
+
+ sudo apt update
+ sudo apt install gcc g++ dkms
+
+Install the guest additions. NOTE: look for errors in the command output!
+If you see an error that says you are missing kernel headers, the most likely
+cause is that you are using a VirtualBox version that is too old.
+The error message is misleading.::
+
+ cd /media/cdrom
+ sudo ./VBoxLinuxAdditions.run
+
+Add yourself to the vboxsf user group (replace "userid" with your user ID)::
+
+ sudo usermod -a -G vboxsf userid
+
+Reboot the VM.
+In a VM terminal window, verify that you can access your home directory on the
+host computer, which should be mounted under /media/sf_Users
+
+Further Reading
+----------------------------------------
+https://wiki.onap.org/display/DW/Development+Environment
diff --git a/docs/offered_consumed_apis.rst b/docs/offered_consumed_apis.rst
index f7110c7eba..8888c6437e 100644
--- a/docs/offered_consumed_apis.rst
+++ b/docs/offered_consumed_apis.rst
@@ -2,15 +2,14 @@
.. http://creativecommons.org/licenses/by/4.0
.. Copyright 2017 Huawei Technologies Co., Ltd.
-ONAP Service Orchestration APIs
+SO Offered and Consumed APIs
=====================================
SO APIs
--------
All the Service Orchestrator APIs, both inward and outward are documented in the below link of onap wiki.
-
- https://wiki.onap.org/display/DW/SO+R1+Interfaces
-
-
+
.. toctree::
:maxdepth: 1
+
+ SO_R1_Interface.rst
diff --git a/docs/release-notes.rst b/docs/release-notes.rst
index 7c7c1371cc..c0a2984c65 100644
--- a/docs/release-notes.rst
+++ b/docs/release-notes.rst
@@ -3,46 +3,57 @@
.. Copyright 2017 Huawei Intellectual Property. All rights reserved.
-Service Orchestrator Release Notes
-==================================
-
-.. note::
- * This Release Notes must be updated each time the team decides to Release new artifacts.
- * The scope of this Release Notes is for this particular component. In other words, each ONAP component has its Release Notes.
- * This Release Notes is cumulative, the most recently Released artifact is made visible in the top of this Release Notes.
- * Except the date and the version number, all the other sections are optional but there must be at least one section describing the purpose of this new release.
- * This note must be removed after content has been added.
+SO Release Notes
+================
+
Version: 1.1.0
--------------
-:Release Date: yyyy-mm-dd
+:Release Date: 2017-11-16
**New Features**
- Initial release of Service Orchestrator (SO) for Open Network Automation Platform (ONAP)
-
+The SO provides the highest level of service orchestration in the ONAP architecture.
+SO is implemented via BPMN flows that operate on Models distributed from SDC that describe the Services and associated VNFs and other Resource components.
+Cloud orchestration currently based on HEAT and TOSCA templates.
+The orchestration engine is a reusable service. Any component of the architecture can execute process workflows.
+Orchestration services can consume a process workflow and execute it.
+The service model maintains consistency and reusability across all orchestration activities and ensures consistent methods, structure and version of the workflow execution environment.
+Orchestration processes interact with other platform components or external systems via standard and well-defined APIs.
**Bug Fixes**
- - ``_ and a sentence explaining what this defect is addressing.
+This is the initial release of ONAP SO.
+Issues of the Ecomp 1710 release are fixed in this release.
+
**Known Issues**
- - ``_ and two, three sentences.
- One sentences explaining what is the issue.
-
- Another sentence explaining the impact of the issue.
-
- And an optional sentence providing a workaround.
+1. The articatfs of SO are under the openecomp/mso folder in nexus.
+ This is not impacting the release but is good to be moved to the ONAP
+2. Current SO release does not support PNF orchestration.
+ The usecases demonstrated in ONAP Amsterdam release does not include PNF.
+3. ARIA Plugin is not in full fledged in the current release.
+ The VNFs provided in the vCPE and vFW usecase are heat based and dont require ARIA.
**Security Issues**
- You may want to include a reference to CVE (Common Vulnerabilities and Exposures) `CVE <https://cve.mitre.org>`_
-
+This is the initial release of ONAP SO.
+Security aspects are not included in the current release.
**Upgrade Notes**
+This is the initial release of ONAP SO.
**Deprecation Notes**
+There is a MSO 1.0.0 SO implementation existing in the pre-R1 ONAP Gerrit system.
+The MSO1.0.0 is deprecated by the R1 release and the current release is built over this release.
+The Gerrit repos of mso/* are voided and already locked as read-only.
+Following are the deprecated SO projects in gerrit repo:
+mso
+mso/chef-repo
+mso/docker-config
+mso/libs
+mso/mso-config
**Other**
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java
index 6413c4bf57..3c40003dd0 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java
@@ -751,6 +751,11 @@ public class ServiceInstances {
private RecipeLookupResult getServiceURI (CatalogDatabase db, MsoRequest msoRequest, Action action) throws Exception {
// SERVICE REQUEST
// Construct the default service name
+ // if no source is provided then make it as VID
+// if (null == msoRequest.getRequestInfo().getSource() || msoRequest.getRequestInfo().getSource().isEmpty()){
+// msoRequest.getRequestInfo().setSource("VID");
+// }
+
// TODO need to make this a configurable property
String defaultServiceModelName = msoRequest.getRequestInfo().getSource() + "_DEFAULT";
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/serviceinstancebeans/RequestInfo.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/serviceinstancebeans/RequestInfo.java
index ba017fe27d..6b8cb84b3c 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/serviceinstancebeans/RequestInfo.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/serviceinstancebeans/RequestInfo.java
@@ -143,6 +143,9 @@ public class RequestInfo {
*
*/
public String getSource() {
+ if(null == source || source.isEmpty()){
+ source = "VID";
+ }
return source;
}
diff --git a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/soapui/SoapUiITCase.java b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/soapui/SoapUiITCase.java
index b7a3b04d96..868de8d089 100644
--- a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/soapui/SoapUiITCase.java
+++ b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/soapui/SoapUiITCase.java
@@ -105,12 +105,6 @@ public class SoapUiITCase {
return warArchive;
}
- @Deployment(name="common-bpmn",testable=false)
- public static Archive<?> createCommonBPMNDeployment () {
- System.out.println("Deploying Common BPMN WAR on default server");
- return ArquillianPackagerForITCases.createPackageFromExistingOne("../../bpmn/MSOCommonBPMN/target/", "MSOCommonBPMN*.war", "MSOCommonBPMN.war");
- }
-
@Deployment(name = "infrastructure-bpmn", testable = false)
public static Archive<?> createInfraBPMNDeployment() {
System.out.println("Deploying Infrastructure BPMN WAR on default server");
diff --git a/packages/deliveries/src/main/assembly/war-pack/mso-wars.xml b/packages/deliveries/src/main/assembly/war-pack/mso-wars.xml
index efbd78740b..e909b116e3 100644
--- a/packages/deliveries/src/main/assembly/war-pack/mso-wars.xml
+++ b/packages/deliveries/src/main/assembly/war-pack/mso-wars.xml
@@ -102,13 +102,6 @@
</fileSet>
<fileSet>
- <includes>
- <include>MSOCommonBPMN*.war</include>
- </includes>
- <directory>../../bpmn/MSOCommonBPMN/target/</directory>
- <outputDirectory>artifacts</outputDirectory>
- </fileSet>
- <fileSet>
<includes>
<include>MSOInfrastructureBPMN*.war</include>
</includes>