summaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/MSOCommonBPMN/pom.xml3
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/DelegateExecutionImpl.java219
-rw-r--r--bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterRestV1.bpmn3
-rw-r--r--bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterRestV2.bpmn3
-rw-r--r--bpmn/MSOCommonBPMN/src/main/resources/subprocess/VnfAdapterRestV1.bpmn3
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/PrepareUpdateAAIVfModuleTest.groovy2
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1Test.groovy3
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnfTest.groovy2
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy3
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BaseTest.java9
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/DelegateExecutionImplTest.java208
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteGenericVnf.java9
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteVfModule.java17
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/MockAAIGenericVnfSearch.java33
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/baseclient/BaseClientTest.java6
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/recipe/BpmnRestClientTest.java15
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java22
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java550
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAPPC.java14
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseDatabase.java45
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseNetworkAdapter.java41
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseOof.java19
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponsePolicy.java32
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseSDNCAdapter.java43
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseSNIRO.java19
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseVNFAdapter.java88
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/BaseIntegrationTest.java6
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CompleteMsoProcessIT.java2
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ConfirmVolumeGroupNameIT.java6
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ConfirmVolumeGroupTenantIT.java4
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleIT.java66
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleVolumeGroupIT.java10
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/DecomposeServiceIT.java4
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/DeleteAAIVfModuleIT.java56
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/FalloutHandlerIT.java5
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/GenerateVfModuleNameIT.java2
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ManualHandlingIT.java2
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteGenericVnf.java9
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteVfModule.java17
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/MockAAIGenericVnfSearch.java33
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingIT.java18
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java18
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/PrepareUpdateAAIVfModuleIT.java16
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/RainyDayHandlerIT.java2
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SDNCAdapterRestV2IT.java3
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SniroHomingV1IT.java18
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIGenericVnfIT.java16
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIVfModuleIT.java14
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/VnfAdapterRestV1IT.java10
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/CreateVcpeResCustServiceIT.java205
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DeleteVcpeResCustServiceIT.java82
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceBRGIT.java84
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackIT.java76
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceTXCIT.java82
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackIT.java76
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoDeleteAllottedResourceBRGIT.java36
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoDeleteAllottedResourceTXCIT.java36
-rw-r--r--bpmn/so-bpmn-building-blocks/pom.xml3
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/EtsiVnfDeleteBB.bpmn38
-rw-r--r--bpmn/so-bpmn-infrastructure-common/pom.xml3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstanceTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfraTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy5
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollbackTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstanceTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnfTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2Test.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModulesTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModuleTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModulesTest.groovy3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy24
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy18
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy24
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy18
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy18
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy18
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/pom.xml3
-rw-r--r--bpmn/so-bpmn-tasks/pom.xml3
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/Constants.java25
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/EtsiVnfDeleteTask.java84
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProvider.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java105
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterUrlProvider.java46
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapper.java13
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapper.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapper.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapper.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/BaseIntegrationTest.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/EtsiVnfDeleteTaskTest.java111
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/StubbedBuildingBlockExecution.java100
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java237
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java77
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/SniroHomingV2IT.java16
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/NetworkAdapterClientIT.java26
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/VnfAdapterClientIT.java26
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientIT.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/namingservice/NamingClientTest.java9
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/oof/OofClientTestIT.java13
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/SDNCClientIT.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapperTest.java1
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapperTest.java21
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapperTest.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java37
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sniro/SniroClientTestIT.java21
118 files changed, 2081 insertions, 1623 deletions
diff --git a/bpmn/MSOCommonBPMN/pom.xml b/bpmn/MSOCommonBPMN/pom.xml
index b115d36a0a..4da7ba5339 100644
--- a/bpmn/MSOCommonBPMN/pom.xml
+++ b/bpmn/MSOCommonBPMN/pom.xml
@@ -155,6 +155,9 @@
</configuration>
</execution>
</executions>
+ <configuration>
+ <parallel>suites</parallel>
+ </configuration>
</plugin>
</plugins>
<pluginManagement>
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy
index 49acf37078..d17a3c42a6 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofHoming.groovy
@@ -167,7 +167,7 @@ class OofHoming extends AbstractServiceTaskProcessor {
Response httpResponse = httpClient.post(oofRequest)
int responseCode = httpResponse.getStatus()
- logDebug("OOF sync response code is: " + responseCode)
+ logger.debug("OOF sync response code is: " + responseCode)
logger.debug( "*** Completed Homing Call OOF ***")
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
index b68e979b3c..2f46630715 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
@@ -518,9 +518,9 @@ class OofUtils {
Response response = client.post(request.getBody().toString())
int responseCode = response.getStatus()
- logDebug("CatalogDB response code is: " + responseCode)
+ logger.debug("CatalogDB response code is: " + responseCode)
String syncResponse = response.readEntity(String.class)
- logDebug("CatalogDB response is: " + syncResponse)
+ logger.debug("CatalogDB response is: " + syncResponse)
if(responseCode != 202){
exceptionUtil.buildAndThrowWorkflowException(execution, responseCode, "Received a Bad Sync Response from CatalogDB.")
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy
index 69d5f02df5..fdd53b2f05 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy
@@ -399,4 +399,8 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor {
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
}
+
+ public Logger getLogger() {
+ return logger;
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy
index f91bf54edc..e56091ad65 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV2.groovy
@@ -294,4 +294,8 @@ class SDNCAdapterRestV2 extends SDNCAdapterRestV1 {
exceptionUtil.buildWorkflowException(execution, 5300, msg)
}
}
+
+ public Logger getLogger() {
+ return logger;
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy
index aacd385a3b..9215eabc57 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy
@@ -450,4 +450,8 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
Node child = getChild(node, name)
return child == null ? null : child.text()
}
+
+ public Logger getLogger() {
+ return logger;
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/DelegateExecutionImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/DelegateExecutionImpl.java
index 1c1d6b73fd..39a209efa8 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/DelegateExecutionImpl.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/DelegateExecutionImpl.java
@@ -1,22 +1,22 @@
/*-
- * ============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
- *
+* ============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=========================================================
- */
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
package org.onap.so.bpmn.common;
@@ -31,92 +31,107 @@ import org.onap.so.bpmn.common.exceptions.RequiredExecutionVariableExeception;
import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
public class DelegateExecutionImpl implements BuildingBlockExecution, Serializable {
- private final Map<String, Serializable> seedMap;
- private transient DelegateExecution execution;
- private static final String INVALID_INPUT_MISSING = "Expected variable of \"%s\" not found in execution";
- private static final String INVALID_INPUT_CLASS_CAST = "Expected variable of \"%s\" was the wrong object type in the execution";
-
- private static final String MISSING_MSG = "Execution variable \"gBBInput\" cannot be null when executing building blocks";
- private static final String MALFORMED_MSG = "Execution variable \"gBBInput\" must contain an element of type GeneralBuildingBlock";
-
- public DelegateExecutionImpl(Map<String, Serializable> seedMap) {
- this.seedMap = seedMap;
- }
-
- public DelegateExecutionImpl(DelegateExecution execution) {
- this.seedMap = new HashMap<>();
- execution.getVariables().forEach((key, value) -> {
- if (value instanceof Serializable) {
- seedMap.put(key, (Serializable)value);
- }
- });
- /* must occur for junit tests to work */
- this.execution = execution;
- }
- @Override
- public GeneralBuildingBlock getGeneralBuildingBlock() {
- try {
- GeneralBuildingBlock generalBuildingBlock = (GeneralBuildingBlock) execution.getVariable("gBBInput");
-
- if (generalBuildingBlock == null) {
- throw new MissingBuildingBlockInputException(MISSING_MSG);
- }
-
- return generalBuildingBlock;
- } catch (ClassCastException e) {
- throw new MalformedBuildingBlockInputException(MALFORMED_MSG, e);
- }
- }
-
- @Override
- public <T> T getVariable(String key) {
- return this.get(key);
- }
-
- @Override
- public <T> T getRequiredVariable(String key) throws RequiredExecutionVariableExeception {
- final T result;
-
- result = this.get(key);
- if (result == null) {
- throw new RequiredExecutionVariableExeception(String.format(INVALID_INPUT_MISSING, key));
-
- }
- return result;
- }
-
- @Override
- public void setVariable(String key, Serializable value) {
- this.execution.setVariable(key, value);
- }
-
- @Override
- public Map<ResourceKey, String> getLookupMap() {
- return this.get("lookupKeyMap");
- }
-
- @Override
- public String getFlowToBeCalled() {
- return this.get("flowToBeCalled");
- }
- public DelegateExecution getDelegateExecution() {
- return this.execution;
- }
-
- public void setDelegateExecution(DelegateExecution execution) {
- this.execution = execution;
- this.seedMap.forEach((key, value) -> {
- if (!execution.hasVariable(key)) {
- execution.setVariable(key, value);
- }
- });
- }
-
- protected <T> T get(String key) {
- final Object value = this.execution.getVariable(key);
-
- return (T)value;
- }
+ private static final long serialVersionUID = 5559067662634919395L;
+
+ @JsonProperty
+ private final Map<String, Serializable> seedMap;
+
+ private transient DelegateExecution execution;
+ private static final String INVALID_INPUT_MISSING = "Expected variable of \"%s\" not found in execution";
+
+ private static final String MISSING_MSG =
+ "Execution variable \"gBBInput\" cannot be null when executing building blocks";
+ private static final String MALFORMED_MSG =
+ "Execution variable \"gBBInput\" must contain an element of type GeneralBuildingBlock";
+
+ public DelegateExecutionImpl(final Map<String, Serializable> seedMap) {
+ this.seedMap = seedMap;
+ }
+
+ public DelegateExecutionImpl(final DelegateExecution execution) {
+ this.seedMap = new HashMap<>();
+ execution.getVariables().forEach((key, value) -> {
+ if (value instanceof Serializable) {
+ seedMap.put(key, (Serializable) value);
+ }
+ });
+ /* must occur for junit tests to work */
+ this.execution = execution;
+ }
+
+ @JsonIgnore
+ @Override
+ public GeneralBuildingBlock getGeneralBuildingBlock() {
+ try {
+ final GeneralBuildingBlock generalBuildingBlock = (GeneralBuildingBlock) execution.getVariable("gBBInput");
+
+ if (generalBuildingBlock == null) {
+ throw new MissingBuildingBlockInputException(MISSING_MSG);
+ }
+
+ return generalBuildingBlock;
+ } catch (final ClassCastException e) {
+ throw new MalformedBuildingBlockInputException(MALFORMED_MSG, e);
+ }
+ }
+
+ @Override
+ public <T> T getVariable(final String key) {
+ return this.get(key);
+ }
+
+ @Override
+ public <T> T getRequiredVariable(final String key) throws RequiredExecutionVariableExeception {
+ final T result;
+
+ result = this.get(key);
+ if (result == null) {
+ throw new RequiredExecutionVariableExeception(String.format(INVALID_INPUT_MISSING, key));
+
+ }
+ return result;
+ }
+
+ @Override
+ public void setVariable(final String key, final Serializable value) {
+ this.execution.setVariable(key, value);
+ }
+
+ @JsonIgnore
+ @Override
+ public Map<ResourceKey, String> getLookupMap() {
+ return this.get("lookupKeyMap");
+ }
+
+ @JsonIgnore
+ @Override
+ public String getFlowToBeCalled() {
+ return this.get("flowToBeCalled");
+ }
+
+ @JsonIgnore
+ public DelegateExecution getDelegateExecution() {
+ return this.execution;
+ }
+
+ public void setDelegateExecution(final DelegateExecution execution) {
+ this.execution = execution;
+ this.seedMap.forEach((key, value) -> {
+ if (!execution.hasVariable(key)) {
+ execution.setVariable(key, value);
+ }
+ });
+ }
+
+ @SuppressWarnings("unchecked")
+ protected <T> T get(final String key) {
+ final Object value = this.execution.getVariable(key);
+ return (T) value;
+ }
+
}
diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterRestV1.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterRestV1.bpmn
index 7a9a7f8308..e2da44d272 100644
--- a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterRestV1.bpmn
+++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterRestV1.bpmn
@@ -10,8 +10,7 @@ def statusCode = execution.getVariable('SDNCREST_sdncAdapterStatusCode')
String response = String.valueOf(execution.getVariable('SDNCREST_sdncAdapterResponse'))
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
def processKey = sdncAdapterRestV1.getProcessKey(execution)
-sdncAdapterRestV1.logDebug(processKey + " received response from SDNCAdapter: statusCode=" + statusCode +
- " response=" + (response.isEmpty() ? "" : "\n") + response, isDebugLogEnabled)</bpmn2:script>
+sdncAdapterRestV1.getLogger().debug("{} received response from SDNCAdapter: statusCode= {} response={}", processKey, statusCode, (response.isEmpty() ? "" : "\n" + response))</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:scriptTask id="ScriptTask_3" name="Workflow Exception (no connection)" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_17</bpmn2:incoming>
diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterRestV2.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterRestV2.bpmn
index cee6e43f93..a262801005 100644
--- a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterRestV2.bpmn
+++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterRestV2.bpmn
@@ -11,8 +11,7 @@ def statusCode = execution.getVariable('SDNCREST_sdncAdapterStatusCode')
String response = String.valueOf(execution.getVariable('SDNCREST_sdncAdapterResponse'))
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
def processKey = sdncAdapterRestV2.getProcessKey(execution)
-sdncAdapterRestV2.logDebug(processKey + " received response from SDNCAdapter: statusCode=" + statusCode +
- " response=" + (response.isEmpty() ? "" : "\n") + response, isDebugLogEnabled)</bpmn2:script>
+sdncAdapterRestV2.getLogger().debug("{} received response from SDNCAdapter: statusCode= {} response={}", processKey, statusCode, (response.isEmpty() ? "" : "\n" + response))</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:scriptTask id="ScriptTask_3" name="Workflow Exception (no connection)" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_17</bpmn2:incoming>
diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/VnfAdapterRestV1.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/VnfAdapterRestV1.bpmn
index cdd710d102..db93df9f09 100644
--- a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/VnfAdapterRestV1.bpmn
+++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/VnfAdapterRestV1.bpmn
@@ -10,8 +10,7 @@ def statusCode = execution.getVariable('VNFREST_vnfAdapterStatusCode')
String response = String.valueOf(execution.getVariable('VNFREST_vnfAdapterResponse'))
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
def processKey = vnfAdapterRestV1.getProcessKey(execution)
-vnfAdapterRestV1.logDebug(processKey + " received response from VnfAdapter: statusCode=" + statusCode +
- " response=" + (response.isEmpty() ? "" : "\n") + response, isDebugLogEnabled)]]></bpmn2:script>
+vnfAdapterRestV1.getLogger().debug("{} received response from VnfAdapter: statusCode= {} response={}", processKey, statusCode, (response.isEmpty() ? "" : "\n" + response))]]></bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:scriptTask id="ScriptTask_3" name="Workflow Exception (no connection)">
<bpmn2:incoming>SequenceFlow_17</bpmn2:incoming>
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/PrepareUpdateAAIVfModuleTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/PrepareUpdateAAIVfModuleTest.groovy
index 60385a7990..9a778a7380 100644
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/PrepareUpdateAAIVfModuleTest.groovy
+++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/PrepareUpdateAAIVfModuleTest.groovy
@@ -40,8 +40,6 @@ import static org.mockito.Mockito.*
@RunWith(MockitoJUnitRunner.class)
@Ignore
class PrepareUpdateAAIVfModuleTest {
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1Test.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1Test.groovy
index b093aaa491..e3942f0d2e 100644
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1Test.groovy
+++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/SniroHomingV1Test.groovy
@@ -70,9 +70,6 @@ class SniroHomingV1Test {
serviceDecomp.setVnfResources(vnfResourceList)
}
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnfTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnfTest.groovy
index 6a4d53654b..12c437fc0a 100644
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnfTest.groovy
+++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnfTest.groovy
@@ -48,8 +48,6 @@ import static org.mockito.Mockito.*
class UpdateAAIGenericVnfTest {
String getVfModuleResponse = FileUtil.readResourceFile("__files/VfModularity/GenericVnf.xml")
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy
index 72bcfcf359..99b178c044 100644
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy
+++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy
@@ -50,9 +50,6 @@ class UpdateAAIVfModuleTest extends MsoGroovyTest {
@Spy
UpdateAAIVfModule updateAAIVfModule;
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BaseTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BaseTest.java
index 5d6f98c907..0f702fca2d 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BaseTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/BaseTest.java
@@ -41,11 +41,11 @@ import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.test.categories.SpringAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.boot.test.web.client.TestRestTemplate;
+import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock;
import org.springframework.http.HttpHeaders;
import org.springframework.test.context.ActiveProfiles;
@@ -54,7 +54,7 @@ import org.springframework.test.context.junit4.SpringRunner;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.github.tomakehurst.wiremock.client.WireMock;
+import com.github.tomakehurst.wiremock.WireMockServer;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@@ -77,6 +77,9 @@ public abstract class BaseTest extends BuildingBlockTestDataSetup {
@Autowired
private RepositoryService repositoryService;
+
+ @Autowired
+ protected WireMockServer wireMockServer;
/*
* Mocked for injection via autowiring
*/
@@ -118,7 +121,7 @@ public abstract class BaseTest extends BuildingBlockTestDataSetup {
@Before
public void baseTestBefore() {
- WireMock.reset();
+ wireMockServer.resetAll();
variables.put("gBuildingBlockExecution", execution);
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/DelegateExecutionImplTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/DelegateExecutionImplTest.java
index 32a18d5a7a..a30aadc1f8 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/DelegateExecutionImplTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/DelegateExecutionImplTest.java
@@ -20,19 +20,15 @@
package org.onap.so.bpmn.common;
-import static org.hamcrest.CoreMatchers.hasItems;
-import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
-import static org.mockito.ArgumentMatchers.contains;
+import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import java.io.Serializable;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -46,101 +42,115 @@ import org.onap.so.bpmn.common.exceptions.MissingBuildingBlockInputException;
import org.onap.so.bpmn.common.exceptions.RequiredExecutionVariableExeception;
import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
public class DelegateExecutionImplTest {
- @Rule
- public ExpectedException thrown= ExpectedException.none();
-
-
- @Test
- public void getVariable() throws RequiredExecutionVariableExeception {
- Map<String, Serializable> map = new HashMap<>();
- map.put("var1", "value1");
- map.put("var2", "value2");
- map.put("list1", (Serializable)Arrays.asList("value1", "value2"));
- DelegateExecutionImpl impl = create(map);
-
- assertEquals("value1", impl.getVariable("var1"));
- assertEquals("value2", impl.getRequiredVariable("var2"));
- assertThat(impl.getVariable("list1"), IsIterableContainingInOrder.contains("value1", "value2"));
-
- }
-
-
- @Test
- public void getRequiredVariableNotFound() throws RequiredExecutionVariableExeception {
- DelegateExecutionImpl impl = create();
-
- thrown.expect(RequiredExecutionVariableExeception.class);
- impl.getRequiredVariable("var1");
- }
-
-
- @Test
- public void setVariable() {
- DelegateExecutionImpl impl = create();
- impl.setVariable("var1", "value1");
-
- assertEquals("value1", impl.get("var1"));
- }
-
- @Test
- public void getGeneralBuildingBlock() {
- GeneralBuildingBlock gBB = mock(GeneralBuildingBlock.class);
- Map<String, Serializable> map = new HashMap<>();
- map.put("gBBInput", gBB);
- DelegateExecutionImpl impl = create(map);
-
- assertEquals(gBB, impl.getGeneralBuildingBlock());
- }
-
- @Test
- public void getGeneralBuildingBlockNotFound() {
-
- DelegateExecutionImpl impl = create();
-
- thrown.expect(MissingBuildingBlockInputException.class);
- impl.getGeneralBuildingBlock();
- }
-
- @Test
- public void getGeneralBuildingBlockCastException() {
- Map<String, Serializable> map = new HashMap<>();
- map.put("gBBInput", new DelegateExecutionFake());
- DelegateExecutionImpl impl = create(map);
-
- thrown.expect(MalformedBuildingBlockInputException.class);
- impl.getGeneralBuildingBlock();
- }
-
- @Test
- public void getDelegateExecution() {
- DelegateExecutionImpl impl = create();
-
- assertNotNull(impl.getDelegateExecution());
- }
-
- @Test
- public void getLookupMap() {
- Map<String, Serializable> lookup = new HashMap<>();
- Map<String, Serializable> map = new HashMap<>();
- map.put("lookupKeyMap", (Serializable) lookup);
- DelegateExecutionImpl impl = create(map);
-
- assertEquals(lookup, impl.getLookupMap());
- }
-
- private DelegateExecutionImpl create() {
- return create(new HashMap<String, Serializable>());
- }
-
- private DelegateExecutionImpl create(Map<String, Serializable> map) {
- DelegateExecutionFake fake = new DelegateExecutionFake();
-
- for (Entry<String, Serializable> entry : map.entrySet()) {
- fake.setVariable(entry.getKey(), entry.getValue());
- }
- return new DelegateExecutionImpl(fake);
- }
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+
+ @Test
+ public void getVariable() throws RequiredExecutionVariableExeception {
+ final Map<String, Serializable> map = new HashMap<>();
+ map.put("var1", "value1");
+ map.put("var2", "value2");
+ map.put("list1", (Serializable) Arrays.asList("value1", "value2"));
+ final DelegateExecutionImpl impl = create(map);
+
+ assertEquals("value1", impl.getVariable("var1"));
+ assertEquals("value2", impl.getRequiredVariable("var2"));
+ assertThat(impl.getVariable("list1"), IsIterableContainingInOrder.contains("value1", "value2"));
+
+ }
+
+
+ @Test
+ public void getRequiredVariableNotFound() throws RequiredExecutionVariableExeception {
+ final DelegateExecutionImpl impl = create();
+
+ thrown.expect(RequiredExecutionVariableExeception.class);
+ impl.getRequiredVariable("var1");
+ }
+
+
+ @Test
+ public void setVariable() {
+ final DelegateExecutionImpl impl = create();
+ impl.setVariable("var1", "value1");
+
+ assertEquals("value1", impl.get("var1"));
+ }
+
+ @Test
+ public void getGeneralBuildingBlock() {
+ final GeneralBuildingBlock gBB = mock(GeneralBuildingBlock.class);
+ final Map<String, Serializable> map = new HashMap<>();
+ map.put("gBBInput", gBB);
+ final DelegateExecutionImpl impl = create(map);
+
+ assertEquals(gBB, impl.getGeneralBuildingBlock());
+ }
+
+ @Test
+ public void getGeneralBuildingBlockNotFound() {
+ final DelegateExecutionImpl impl = create();
+ thrown.expect(MissingBuildingBlockInputException.class);
+ impl.getGeneralBuildingBlock();
+ }
+
+ @Test
+ public void getGeneralBuildingBlockCastException() {
+ final Map<String, Serializable> map = new HashMap<>();
+ map.put("gBBInput", new DelegateExecutionFake());
+ final DelegateExecutionImpl impl = create(map);
+
+ thrown.expect(MalformedBuildingBlockInputException.class);
+ impl.getGeneralBuildingBlock();
+ }
+
+ @Test
+ public void getDelegateExecution() {
+ final DelegateExecutionImpl impl = create();
+
+ assertNotNull(impl.getDelegateExecution());
+ }
+
+ @Test
+ public void getLookupMap() {
+ final Map<String, Serializable> lookup = new HashMap<>();
+ final Map<String, Serializable> map = new HashMap<>();
+ map.put("lookupKeyMap", (Serializable) lookup);
+ final DelegateExecutionImpl impl = create(map);
+
+ assertEquals(lookup, impl.getLookupMap());
+ }
+
+ @Test
+ public void testDelegateExecutionImpl_serializeDelegateExecutionImplObject_shouldNotThrowAnyExceptionWhenSerializing() {
+ final DelegateExecutionImpl objectUnderTest = create();
+
+ try {
+ final ObjectMapper objectMapper = new ObjectMapper();
+ objectMapper.writeValueAsString(objectUnderTest);
+ } catch (final JsonProcessingException e) {
+ fail("Should be possible to serialize DelegateExecutionImpl object");
+ }
+
+ }
+
+ private DelegateExecutionImpl create() {
+ return create(new HashMap<String, Serializable>());
+ }
+
+ private DelegateExecutionImpl create(final Map<String, Serializable> map) {
+ final DelegateExecutionFake fake = new DelegateExecutionFake();
+
+ for (final Entry<String, Serializable> entry : map.entrySet()) {
+ fake.setVariable(entry.getKey(), entry.getValue());
+ }
+ return new DelegateExecutionImpl(fake);
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteGenericVnf.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteGenericVnf.java
index 819962f16c..052fd5dc94 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteGenericVnf.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteGenericVnf.java
@@ -22,15 +22,16 @@ package org.onap.so.bpmn.common;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.delete;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+import com.github.tomakehurst.wiremock.WireMockServer;
+
public class MockAAIDeleteGenericVnf {
- public MockAAIDeleteGenericVnf(){
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721/[?]resource-version=0000021"))
+ public MockAAIDeleteGenericVnf(WireMockServer wireMockServer){
+ wireMockServer.stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721/[?]resource-version=0000021"))
.willReturn(aResponse()
.withStatus(200)));
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c718/[?]resource-version=0000018"))
+ wireMockServer.stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c718/[?]resource-version=0000018"))
.willReturn(aResponse()
.withStatus(500)
.withHeader("Content-Type", "text/xml")
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteVfModule.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteVfModule.java
index 9cb10a0494..1cbe0b9244 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteVfModule.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteVfModule.java
@@ -23,31 +23,32 @@ package org.onap.so.bpmn.common;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
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.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+import com.github.tomakehurst.wiremock.WireMockServer;
+
public class MockAAIDeleteVfModule {
- public MockAAIDeleteVfModule()
+ public MockAAIDeleteVfModule(WireMockServer wireMockServer)
{
- stubFor(delete(urlMatching(
+ wireMockServer.stubFor(delete(urlMatching(
"/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721/vf-modules/vf-module/973ed047-d251-4fb9-bf1a-65b8949e0a73/[?]resource-version=0000073"))
.willReturn(aResponse().withStatus(200)));
- stubFor(delete(urlMatching(
+ wireMockServer.stubFor(delete(urlMatching(
"/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c720/vf-modules/vf-module/973ed047-d251-4fb9-bf1a-65b8949e0a75/[?]resource-version=0000075"))
.willReturn(aResponse().withStatus(200)));
- stubFor(delete(urlMatching(
+ wireMockServer.stubFor(delete(urlMatching(
"/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c718/vf-modules/vf-module/973ed047-d251-4fb9-bf1a-65b8949e0a78/[?]resource-version=0000078"))
.willReturn(aResponse().withStatus(200)));
- stubFor(delete(urlMatching(
+ wireMockServer.stubFor(delete(urlMatching(
"/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c719/vf-modules/vf-module/973ed047-d251-4fb9-bf1a-65b8949e0a77/[?]resource-version=0000077"))
.willReturn(aResponse().withStatus(500).withHeader("Content-Type", "text/xml")
.withBodyFile("aaiFault.xml")));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy\\?network-policy-fqdn=.*"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy\\?network-policy-fqdn=.*"))
.willReturn(aResponse().withStatus(200).withHeader("Content-Type", "text/xml")
.withBodyFile("VfModularity/QueryNetworkPolicy_AAIResponse_Success.xml")));
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/.*"))
+ wireMockServer.stubFor(delete(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/.*"))
.willReturn(aResponse().withStatus(200)));
}
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/MockAAIGenericVnfSearch.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/MockAAIGenericVnfSearch.java
index b46d528cc5..1d6337ffc4 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/MockAAIGenericVnfSearch.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/MockAAIGenericVnfSearch.java
@@ -22,30 +22,31 @@ package org.onap.so.bpmn.common;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+import com.github.tomakehurst.wiremock.WireMockServer;
+
public class MockAAIGenericVnfSearch {
private static final String EOL = "\n";
- public MockAAIGenericVnfSearch(){
+ public MockAAIGenericVnfSearch(WireMockServer wireMockServer){
String body;
// The following stubs are for CreateAAIVfModule and UpdateAAIVfModule
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC23&depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC23&depth=1"))
.willReturn(aResponse()
.withStatus(500)
.withHeader("Content-Type", "text/xml")
.withBodyFile("aaiFault.xml")));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC22&depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC22&depth=1"))
.willReturn(aResponse()
.withStatus(404)
.withHeader("Content-Type", "text/xml")
.withBody("Generic VNF Not Found")));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/768073c7-f41f-4822-9323-b75962763d74[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/768073c7-f41f-4822-9323-b75962763d74[?]depth=1"))
.willReturn(aResponse()
.withStatus(404)
.withHeader("Content-Type", "text/xml")
@@ -78,12 +79,12 @@ public class MockAAIGenericVnfSearch {
" <l-interfaces/>" + EOL +
" <lag-interfaces/>" + EOL +
"</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC21&depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC21&depth=1"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
.withBody(body)));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721[?]depth=1"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
@@ -126,12 +127,12 @@ public class MockAAIGenericVnfSearch {
" <l-interfaces/>" + EOL +
" <lag-interfaces/>" + EOL +
"</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC20&depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC20&depth=1"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
.withBody(body)));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/2f6aee38-1e2a-11e6-82d1-ffc7d9ee8aa4[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/2f6aee38-1e2a-11e6-82d1-ffc7d9ee8aa4[?]depth=1"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
@@ -139,13 +140,13 @@ public class MockAAIGenericVnfSearch {
// The following stubs are for DeleteAAIVfModule
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c723[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c723[?]depth=1"))
.willReturn(aResponse()
.withStatus(500)
.withHeader("Content-Type", "text/xml")
.withBodyFile("aaiFault.xml")));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c722[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c722[?]depth=1"))
.willReturn(aResponse()
.withStatus(404)
.withHeader("Content-Type", "text/xml")
@@ -178,7 +179,7 @@ public class MockAAIGenericVnfSearch {
" <l-interfaces/>" + EOL +
" <lag-interfaces/>" + EOL +
"</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721[?]depth=1"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
@@ -221,7 +222,7 @@ public class MockAAIGenericVnfSearch {
" <l-interfaces/>" + EOL +
" <lag-interfaces/>" + EOL +
"</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c720[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c720[?]depth=1"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
@@ -264,7 +265,7 @@ public class MockAAIGenericVnfSearch {
" <l-interfaces/>" + EOL +
" <lag-interfaces/>" + EOL +
"</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c719[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c719[?]depth=1"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
@@ -297,7 +298,7 @@ public class MockAAIGenericVnfSearch {
" <l-interfaces/>" + EOL +
" <lag-interfaces/>" + EOL +
"</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c718[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c718[?]depth=1"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
@@ -330,7 +331,7 @@ public class MockAAIGenericVnfSearch {
" <l-interfaces/>" + EOL +
" <lag-interfaces/>" + EOL +
"</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721/vf-modules/vf-module/973ed047-d251-4fb9-bf1a-65b8949e0a73"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721/vf-modules/vf-module/973ed047-d251-4fb9-bf1a-65b8949e0a73"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/baseclient/BaseClientTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/baseclient/BaseClientTest.java
index f84a76468f..1be7c652b9 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/baseclient/BaseClientTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/baseclient/BaseClientTest.java
@@ -34,8 +34,6 @@ import org.junit.Test;
import org.onap.so.BaseTest;
import org.springframework.core.ParameterizedTypeReference;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-
import wiremock.org.apache.http.entity.ContentType;
@@ -46,7 +44,7 @@ public class BaseClientTest extends BaseTest {
BaseClient<String, String> client = new BaseClient<>();
String response = "{\"hello\" : \"world\"}";
client.setTargetUrl(UriBuilder.fromUri("http://localhost/test").port(Integer.parseInt(wireMockPort)).build().toString());
- stubFor(get(urlEqualTo("/test"))
+ wireMockServer.stubFor(get(urlEqualTo("/test"))
.willReturn(aResponse().withStatus(200).withBody(response).withHeader("Content-Type", ContentType.APPLICATION_JSON.toString())));
String result = client.get("", new ParameterizedTypeReference<String>() {});
@@ -58,7 +56,7 @@ public class BaseClientTest extends BaseTest {
BaseClient<String, Map<String, Object>> client = new BaseClient<>();
String response = "{\"hello\" : \"world\"}";
client.setTargetUrl(UriBuilder.fromUri("http://localhost/test").port(Integer.parseInt(wireMockPort)).build().toString());
- stubFor(get(urlEqualTo("/test"))
+ wireMockServer.stubFor(get(urlEqualTo("/test"))
.willReturn(aResponse().withStatus(200).withBody(response).withHeader("Content-Type", ContentType.APPLICATION_JSON.toString())));
Map<String, Object> result = client.get("", new ParameterizedTypeReference<Map<String, Object>>() {});
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/recipe/BpmnRestClientTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/recipe/BpmnRestClientTest.java
index 85507afd3f..465ec416b5 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/recipe/BpmnRestClientTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/recipe/BpmnRestClientTest.java
@@ -20,16 +20,19 @@
package org.onap.so.bpmn.common.recipe;
+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.urlPathMatching;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.IOException;
+
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.junit.Test;
import org.onap.so.BaseTest;
import org.springframework.beans.factory.annotation.Autowired;
-import java.io.IOException;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.*;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
public class BpmnRestClientTest extends BaseTest{
@@ -38,7 +41,7 @@ public class BpmnRestClientTest extends BaseTest{
@Test
public void postTest() throws IOException, Exception{
- stubFor(post(urlPathMatching("/testRecipeUri"))
+ wireMockServer.stubFor(post(urlPathMatching("/testRecipeUri"))
.willReturn(aResponse().withHeader("Content-Type", "application/json").withStatus(org.springframework.http.HttpStatus.OK.value()).withBody("{}")));
HttpResponse httpResponse = bpmnRestClient.post(
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java
index ddca319708..a074174f6e 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java
@@ -19,23 +19,17 @@
*/
package org.onap.so.bpmn.common.resource;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.ok;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static org.junit.Assert.assertEquals;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.junit.Rule;
import org.junit.Test;
-import org.mockito.Mock;
import org.onap.so.BaseTest;
-import org.onap.so.bpmn.core.UrnPropertiesReader;
-import org.springframework.core.env.Environment;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.*;
public class ResourceRequestBuilderTest extends BaseTest {
@@ -45,7 +39,7 @@ public class ResourceRequestBuilderTest extends BaseTest {
- stubFor(get(urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5"))
+ wireMockServer.stubFor(get(urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5"))
.willReturn(ok("{ \"serviceResources\" : {\n" +
"\t\"modelInfo\" : {\n" +
"\t\t\"modelName\" : \"demoVFWCL\",\n" +
@@ -137,7 +131,7 @@ public class ResourceRequestBuilderTest extends BaseTest {
@Test
public void getResourceInputDefaultValueTest() throws Exception {
- stubFor(get(urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5"))
+ wireMockServer.stubFor(get(urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5"))
.willReturn(ok("{ \"serviceResources\" : {\n" +
"\t\"modelInfo\" : {\n" +
"\t\t\"modelName\" : \"demoVFWCL\",\n" +
@@ -228,7 +222,7 @@ public class ResourceRequestBuilderTest extends BaseTest {
@Test
public void getResourceInputValueNoDefaultTest() throws Exception {
- stubFor(get(urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5"))
+ wireMockServer.stubFor(get(urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5"))
.willReturn(ok("{ \"serviceResources\" : {\n" +
"\t\"modelInfo\" : {\n" +
"\t\t\"modelName\" : \"demoVFWCL\",\n" +
@@ -319,7 +313,7 @@ public class ResourceRequestBuilderTest extends BaseTest {
@Test
public void getResourceSequenceTest() throws Exception {
- stubFor(get(urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5"))
+ wireMockServer.stubFor(get(urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5"))
.willReturn(ok("{ \"serviceResources\" : {\n" +
"\t\"modelInfo\" : {\n" +
"\t\t\"modelName\" : \"demoVFWCL\",\n" +
@@ -409,7 +403,7 @@ public class ResourceRequestBuilderTest extends BaseTest {
@Test
public void getResourceInputWithEmptyServiceResourcesTest() throws Exception {
- stubFor(get(urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5"))
+ wireMockServer.stubFor(get(urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5"))
.willReturn(ok("{ \"serviceResources\" : {\n" +
"\t\"modelInfo\" : {\n" +
"\t\t\"modelName\" : \"demoVFWCL\",\n" +
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java
index 79b0d33062..80d8d928aa 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAAI.java
@@ -20,17 +20,19 @@
package org.onap.so.bpmn.mock;
-import static com.github.tomakehurst.wiremock.client.WireMock.*;
+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.equalTo;
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.post;
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;
+import com.github.tomakehurst.wiremock.WireMockServer;
+
/**
* Reusable Mock StubResponses for AAI Endpoints
@@ -46,40 +48,40 @@ public class StubResponseAAI {
/**
* 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))
+ public static void MockGetAllottedResource(WireMockServer wireMockServer, String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String responseFile) {
+ wireMockServer.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))
+ public static void MockPutAllottedResource(WireMockServer wireMockServer, String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
+ wireMockServer.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))
+ public static void MockPutAllottedResource_500(WireMockServer wireMockServer, String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
+ wireMockServer.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))
+ public static void MockDeleteAllottedResource(WireMockServer wireMockServer, String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String resourceVersion) {
+ wireMockServer.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))
+ public static void MockPatchAllottedResource(WireMockServer wireMockServer, String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
+ wireMockServer.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))
+ public static void MockQueryAllottedResourceById(WireMockServer wireMockServer, String allottedResourceId, String responseFile){
+ wireMockServer.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")
@@ -90,8 +92,8 @@ public class StubResponseAAI {
/**
* Service Instance Mock StubResponses below
*/
- public static void MockGetServiceInstance(String globalCustId, String subscriptionType, String serviceInstanceId) {
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
+ public static void MockGetServiceInstance(WireMockServer wireMockServer, String globalCustId, String subscriptionType, String serviceInstanceId) {
+ wireMockServer.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")));
@@ -100,127 +102,127 @@ public class StubResponseAAI {
/**
* 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))
+ public static void MockGetServiceInstance(WireMockServer wireMockServer, String globalCustId, String subscriptionType, String serviceInstanceId, String responseFile) {
+ wireMockServer.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))
+ public static void MockGetServiceInstance_404(WireMockServer wireMockServer, String customer, String serviceSubscription, String serviceInstanceId){
+ wireMockServer.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))
+ public static void MockGetServiceInstance_500(WireMockServer wireMockServer, String customer, String serviceSubscription, String serviceInstanceId){
+ wireMockServer.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))
+ public static void MockGetServiceInstance_500(WireMockServer wireMockServer, String customer, String serviceSubscription, String serviceInstanceId, String responseFile){
+ wireMockServer.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))
+ public static void MockNodeQueryServiceInstanceByName(WireMockServer wireMockServer, String serviceInstanceName, String responseFile){
+ wireMockServer.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))
+ public static void MockNodeQueryServiceInstanceByName_404(WireMockServer wireMockServer, String serviceInstanceName){
+ wireMockServer.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))
+ public static void MockNodeQueryServiceInstanceByName_500(WireMockServer wireMockServer, String serviceInstanceName){
+ wireMockServer.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))
+ public static void MockNodeQueryServiceInstanceById(WireMockServer wireMockServer, String serviceInstanceId, String responseFile){
+ wireMockServer.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))
+ public static void MockNodeQueryServiceInstanceById_404(WireMockServer wireMockServer, String serviceInstanceId){
+ wireMockServer.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))
+ public static void MockNodeQueryServiceInstanceById_500(WireMockServer wireMockServer, String serviceInstanceId){
+ wireMockServer.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))
+ public static void MockDeleteServiceInstance(WireMockServer wireMockServer, String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
+ wireMockServer.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))
+ public static void MockGetServiceInstance(WireMockServer wireMockServer, String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){
+ wireMockServer.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, int statusCode){
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription))
+ public static void MockGetServiceInstance(WireMockServer wireMockServer, String customer, String serviceSubscription, int statusCode){
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription))
.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))
+ public static void MockDeleteServiceInstance(WireMockServer wireMockServer, String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){
+ wireMockServer.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))
+ public static void MockDeleteServiceInstance(WireMockServer wireMockServer, String customer, String serviceSubscription, String resourceVersion, int statusCode){
+ wireMockServer.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))
+ public static void MockDeleteServiceInstance_404(WireMockServer wireMockServer, String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
+ wireMockServer.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))
+ public static void MockDeleteServiceInstance_500(WireMockServer wireMockServer, String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
+ wireMockServer.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))
+ public static void MockPutServiceInstance(WireMockServer wireMockServer, String globalCustId, String subscriptionType, String serviceInstanceId, String responseFile) {
+ wireMockServer.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))
+ public static void MockPutServiceInstance_500(WireMockServer wireMockServer, String globalCustId, String subscriptionType, String serviceInstanceId) {
+ wireMockServer.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)));
}
@@ -228,34 +230,34 @@ public class StubResponseAAI {
/**
* 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))
+ public static void MockGetServiceSubscription(WireMockServer wireMockServer, String globalCustId, String subscriptionType, String responseFile) {
+ wireMockServer.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))
+ public static void MockDeleteServiceSubscription(WireMockServer wireMockServer, String globalCustId, String subscriptionType, int statusCode) {
+ wireMockServer.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))
+ public static void MockDeleteServiceInstanceId(WireMockServer wireMockServer, String globalCustId, String subscriptionType, String serviceInstanceId) {
+ wireMockServer.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))
+ public static void MockPutServiceSubscription(WireMockServer wireMockServer, String globalCustId, String subscriptionType) {
+ wireMockServer.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))
+ public static void MockGetServiceSubscription(WireMockServer wireMockServer, String globalCustId, String subscriptionType, int statusCode) {
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
.willReturn(aResponse()
.withStatus(statusCode)));
}
@@ -263,28 +265,28 @@ public class StubResponseAAI {
/**
* Customer Mock StubResponses below
*/
- public static void MockGetCustomer(String globalCustId, String responseFile) {
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
+ public static void MockGetCustomer(WireMockServer wireMockServer, String globalCustId, String responseFile) {
+ wireMockServer.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))
+ public static void MockDeleteCustomer(WireMockServer wireMockServer, String globalCustId) {
+ wireMockServer.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))
+ public static void MockPutCustomer(WireMockServer wireMockServer, String globalCustId) {
+ wireMockServer.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))
+ public static void MockPutCustomer_500(WireMockServer wireMockServer, String globalCustId) {
+ wireMockServer.stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
.willReturn(aResponse()
.withStatus(500)));
}
@@ -294,24 +296,24 @@ public class StubResponseAAI {
* 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"))
+ public static void MockGetGenericVnfById(WireMockServer wireMockServer, String vnfId, String responseFile){
+ wireMockServer.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))
+ public static void MockGetGenericVnfById(WireMockServer wireMockServer, String vnfId, String responseFile, int statusCode){
+ wireMockServer.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))
+ public static void MockGetGenericVnfByIdWithPriority(WireMockServer wireMockServer, String vnfId, int statusCode, String responseFile) {
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
.atPriority(1)
.willReturn(aResponse()
.withStatus(statusCode)
@@ -319,8 +321,8 @@ public class StubResponseAAI {
.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))
+ public static void MockGetGenericVnfByIdWithPriority(WireMockServer wireMockServer, String vnfId, String vfModuleId, int statusCode, String responseFile, int priority) {
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
.atPriority(priority)
.willReturn(aResponse()
.withStatus(statusCode)
@@ -328,138 +330,138 @@ public class StubResponseAAI {
.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))
+ public static void MockGetGenericVnfByIdWithDepth(WireMockServer wireMockServer, String vnfId, int depth, String responseFile){
+ wireMockServer.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))
+ public static void MockGetGenericVnfById_404(WireMockServer wireMockServer, String vnfId){
+ wireMockServer.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/v9/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=1"))
+ public static void MockGetGenericVnfById_500(WireMockServer wireMockServer, String vnfId){
+ wireMockServer.stubFor(get(urlMatching("/aai/v9/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=1"))
.withQueryParam("depth", equalTo("1"))
.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))
+ public static void MockGetGenericVnfByName(WireMockServer wireMockServer, String vnfName, String responseFile){
+ wireMockServer.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))
+ public static void MockGetGenericVnfByNameWithDepth(WireMockServer wireMockServer, String vnfName, int depth, String responseFile){
+ wireMockServer.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))
+ public static void MockGetGenericVnfByName_404(WireMockServer wireMockServer, String vnfName){
+ wireMockServer.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))
+ public static void MockDeleteGenericVnf(WireMockServer wireMockServer, String vnfId, String resourceVersion){
+ wireMockServer.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))
+ public static void MockDeleteGenericVnf(WireMockServer wireMockServer, String vnfId, String resourceVersion, int statusCode){
+ wireMockServer.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))
+ public static void MockDeleteGenericVnf_500(WireMockServer wireMockServer, String vnfId, String resourceVersion){
+ wireMockServer.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))
+ public static void MockPutGenericVnf(WireMockServer wireMockServer, String vnfId){
+ wireMockServer.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))
+ public static void MockPutGenericVnf(WireMockServer wireMockServer, String vnfId, String requestBodyContaining, int statusCode) {
+ wireMockServer.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))
+ public static void MockPutGenericVnf(WireMockServer wireMockServer, String vnfId, int statusCode) {
+ wireMockServer.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))
+ public static void MockPutGenericVnf_Bad(WireMockServer wireMockServer, String vnfId, int statusCode){
+ wireMockServer.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))
+ public static void MockPatchGenericVnf(WireMockServer wireMockServer, String vnfId){
+ wireMockServer.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))
+ public static void MockGetVceById(WireMockServer wireMockServer, String vnfId, String responseFile){
+ wireMockServer.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))
+ public static void MockGetVceByName(WireMockServer wireMockServer, String vnfName, String responseFile){
+ wireMockServer.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))
+ public static void MockDeleteVce(WireMockServer wireMockServer, String vnfId, String resourceVersion, int statusCode){
+ wireMockServer.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))
+ public static void MockPutVce(WireMockServer wireMockServer, String vnfId){
+ wireMockServer.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))
+ public static void MockGetGenericVceByNameWithDepth(WireMockServer wireMockServer, String vnfName, int depth, String responseFile){
+ wireMockServer.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))
+ public static void MockGetVceGenericQuery(WireMockServer wireMockServer, String serviceInstanceName, int depth, int statusCode, String responseFile){
+ wireMockServer.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")
@@ -469,16 +471,16 @@ public class StubResponseAAI {
/**
* 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"))
+ public static void MockGetTenantGenericQuery(WireMockServer wireMockServer, String customer, String serviceType, String responseFile) {
+ wireMockServer.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))
+ public static void MockGetTenant(WireMockServer wireMockServer, String tenantId, String responseFile) {
+ wireMockServer.stubFor(get(urlEqualTo("/aai/v2/cloud-infrastructure/tenants/tenant/" + tenantId))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
@@ -488,169 +490,169 @@ public class StubResponseAAI {
/**
* 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))
+ public static void MockGetNetwork(WireMockServer wireMockServer, String networkId, String responseFile, int statusCode) {
+ wireMockServer.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))
+ public static void MockGetNetworkByIdWithDepth(WireMockServer wireMockServer, String networkId, String responseFile, String depth) {
+ wireMockServer.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/CloudOwner/"+cloudRegion))
+ public static void MockGetNetworkCloudRegion(WireMockServer wireMockServer, String responseFile, String cloudRegion) {
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/"+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))
+ public static void MockGetNetworkByName(WireMockServer wireMockServer, String networkName, String responseFile) {
+ wireMockServer.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))
+ public static void MockGetNetworkByName_404(WireMockServer wireMockServer, String responseFile, String networkName) {
+ wireMockServer.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/CloudOwner/"+cloudRegion))
+ public static void MockGetNetworkCloudRegion_404(WireMockServer wireMockServer, String cloudRegion) {
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/"+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))
+ public static void MockPutNetwork(WireMockServer wireMockServer, String networkId, int statusCode, String responseFile) {
+ wireMockServer.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))
+ public static void MockPutNetwork(WireMockServer wireMockServer, String networkPolicyId, String responseFile, int statusCode) {
+ wireMockServer.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))
+ public static void MockGetNetworkName(WireMockServer wireMockServer, String networkPolicyName, String responseFile, int statusCode) {
+ wireMockServer.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"))
+ public static void MockGetNetworkVpnBinding(WireMockServer wireMockServer, String responseFile, String vpnBinding) {
+ wireMockServer.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"))
+ public static void MockGetNetworkPolicy(WireMockServer wireMockServer, String responseFile, String policy) {
+ wireMockServer.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))
+ public static void MockGetNetworkVpnBinding(WireMockServer wireMockServer, String networkBindingId, String responseFile, int statusCode) {
+ wireMockServer.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))
+ public static void MockGetNetworkPolicy(WireMockServer wireMockServer, String networkPolicy, String responseFile, int statusCode) {
+ wireMockServer.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"))
+ public static void MockGetNetworkTableReference(WireMockServer wireMockServer, String responseFile, String tableReference) {
+ wireMockServer.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 ))
+ public static void MockPutNetworkIdWithDepth(WireMockServer wireMockServer, String responseFile, String networkId, String depth) {
+ wireMockServer.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))
+ public static void MockGetNetworkPolicyfqdn(WireMockServer wireMockServer, String networkPolicy, String responseFile, int statusCode) {
+ wireMockServer.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))
+ public static void MockGetNetworkRouteTable(WireMockServer wireMockServer, String networkRouteId, String responseFile, int statusCode) {
+ wireMockServer.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))
+ public static void MockPatchVfModuleId(WireMockServer wireMockServer, String vnfId, String vfModuleId) {
+ wireMockServer.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"))
+ public static void MockVNFAdapterRestVfModule(WireMockServer wireMockServer) {
+ wireMockServer.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"))
+ wireMockServer.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"))
+ wireMockServer.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"))
+ wireMockServer.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"))
+ public static void MockDBUpdateVfModule(WireMockServer wireMockServer){
+ wireMockServer.stubFor(post(urlEqualTo("/dbadapters/RequestsDbAdapter"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
@@ -658,9 +660,9 @@ public class StubResponseAAI {
}
// start of mocks used locally and by other VF Module unit tests
- public static void MockSDNCAdapterVfModule() {
+ public static void MockSDNCAdapterVfModule(WireMockServer wireMockServer) {
// simplified the implementation to return "success" for all requests
- stubFor(post(urlEqualTo("/SDNCAdapter"))
+ wireMockServer.stubFor(post(urlEqualTo("/SDNCAdapter"))
// .withRequestBody(containing("SvcInstanceId><"))
.willReturn(aResponse()
.withStatus(200)
@@ -670,79 +672,79 @@ public class StubResponseAAI {
}
// 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"))
+ public static void MockAAIVfModule(WireMockServer wireMockServer) {
+ wireMockServer.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"))
+ wireMockServer.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/.*"))
+ wireMockServer.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"))
+ wireMockServer.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"))
+ wireMockServer.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/.*"))
+ wireMockServer.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/.*"))
+ wireMockServer.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/.*"))
+ wireMockServer.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"))
+ wireMockServer.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"))
+ wireMockServer.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/CloudOwner/MDTWNJ21/volume-groups/volume-group/78987"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/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/CloudOwner/AAIAIC25/volume-groups/volume-group/78987"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/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"))
+ wireMockServer.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/.*"))
+ wireMockServer.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"))
+ wireMockServer.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)));
@@ -756,8 +758,8 @@ public class StubResponseAAI {
* 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/CloudOwner/" + cloudRegionId))
+ public static void MockGetCloudRegion(WireMockServer wireMockServer, String cloudRegionId, int statusCode, String responseFile) {
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "text/xml")
@@ -767,48 +769,48 @@ public class StubResponseAAI {
/**
* Volume Group StubResponse below
*/
- public static void MockGetVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile) {
- MockGetVolumeGroupById(cloudRegionId, volumeGroupId, responseFile, 200);
+ public static void MockGetVolumeGroupById(WireMockServer wireMockServer, String cloudRegionId, String volumeGroupId, String responseFile) {
+ MockGetVolumeGroupById(wireMockServer, cloudRegionId, volumeGroupId, responseFile, 200);
}
- public static void MockGetVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile, int responseCode) {
- stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))
+ public static void MockGetVolumeGroupById(WireMockServer wireMockServer, String cloudRegionId, String volumeGroupId, String responseFile, int responseCode) {
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))
.willReturn(aResponse()
.withStatus(responseCode)
.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/CloudOwner/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))
+ public static void MockPutVolumeGroupById(WireMockServer wireMockServer, String cloudRegionId, String volumeGroupId, String responseFile, int statusCode) {
+ wireMockServer.stubFor(put(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + 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/CloudOwner/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName))
+ public static void MockGetVolumeGroupByName(WireMockServer wireMockServer, String cloudRegionId, String volumeGroupName, String responseFile, int statusCode) {
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + 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/CloudOwner/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))
+ public static void MockDeleteVolumeGroupById(WireMockServer wireMockServer, String cloudRegionId, String volumeGroupId, String resourceVersion, int statusCode) {
+ wireMockServer.stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + 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/CloudOwner/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName))
+ public static void MockGetVolumeGroupByName_404(WireMockServer wireMockServer, String cloudRegionId, String volumeGroupName) {
+ wireMockServer.stubFor(get(urlMatching("/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + 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/CloudOwner/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))
+ public static void MockDeleteVolumeGroup(WireMockServer wireMockServer, String cloudRegionId, String volumeGroupId, String resourceVersion) {
+ wireMockServer.stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))
.willReturn(aResponse()
.withStatus(200)));
}
@@ -817,103 +819,103 @@ public class StubResponseAAI {
* 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))
+ public static void MockGetVfModuleId(WireMockServer wireMockServer, String vnfId, String vfModuleId, String responseFile, int statusCode) {
+ wireMockServer.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))
+ public static void MockGetVfModuleByNameWithDepth(WireMockServer wireMockServer, String vnfId, String vfModuleName, int depth, String responseFile, int statusCode) {
+ wireMockServer.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 MockGetVfModuleByName(String vnfId, String vfModuleName, 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))
+ public static void MockGetVfModuleByName(WireMockServer wireMockServer, String vnfId, String vfModuleName, String responseFile, int statusCode) {
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module[?]vf-module-name=" + vfModuleName))
.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))
+ public static void MockGetVfModuleIdNoResponse(WireMockServer wireMockServer, String vnfId, String requestContaining, String vfModuleId) {
+ wireMockServer.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))
+ public static void MockPutVfModuleIdNoResponse(WireMockServer wireMockServer, String vnfId, String requestContaining, String vfModuleId) {
+ wireMockServer.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))
+ public static void MockPutVfModuleId(WireMockServer wireMockServer, String vnfId, String vfModuleId) {
+ wireMockServer.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))
+ public static void MockPutVfModuleId(WireMockServer wireMockServer, String vnfId, String vfModuleId, int returnCode) {
+ wireMockServer.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))
+ public static void MockDeleteVfModuleId(WireMockServer wireMockServer, String vnfId, String vfModuleId, String resourceVersion, int returnCode) {
+ wireMockServer.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))
+ public static void MockAAIVfModuleBadPatch(WireMockServer wireMockServer, String endpoint, int statusCode) {
+ wireMockServer.stubFor(patch(urlMatching(endpoint))
.willReturn(aResponse()
.withStatus(statusCode)));
}
/* AAI Pserver Queries */
- public static void MockGetPserverByVnfId(String vnfId, String responseFile, int statusCode) {
- stubFor(put(urlMatching("/aai/v1[0-9]/query.*"))
+ public static void MockGetPserverByVnfId(WireMockServer wireMockServer, String vnfId, String responseFile, int statusCode) {
+ wireMockServer.stubFor(put(urlMatching("/aai/v1[0-9]/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("/aai/v1[0-9]/network/generic-vnfs/.*"))
+ public static void MockGetGenericVnfsByVnfId(WireMockServer wireMockServer, String vnfId, String responseFile, int statusCode) {
+ wireMockServer.stubFor(get(urlMatching("/aai/v1[0-9]/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("/aai/v1[0-9]/network/generic-vnfs/.*"))
+ public static void MockSetInMaintFlagByVnfId(WireMockServer wireMockServer, String vnfId, int statusCode) {
+ wireMockServer.stubFor(patch(urlMatching("/aai/v1[0-9]/network/generic-vnfs/.*"))
.willReturn(aResponse()
.withStatus(statusCode)
));
}
- public static void MockSetInMaintFlagByVnfId(String vnfId, String responseFile, int statusCode) {
- stubFor(post(urlMatching("/aai/v1[0-9]/network/generic-vnfs/.*"))
+ public static void MockSetInMaintFlagByVnfId(WireMockServer wireMockServer, String vnfId, String responseFile, int statusCode) {
+ wireMockServer.stubFor(post(urlMatching("/aai/v1[0-9]/network/generic-vnfs/.*"))
.willReturn(aResponse()
.withStatus(statusCode)
.withBodyFile(responseFile)
));
}
- public static void MockGetDefaultCloudRegionByCloudRegionId(String cloudRegionId, String responseFile, int statusCode) {
- stubFor(get(urlMatching("/aai/v1[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/"+cloudRegionId + ".*"))
+ public static void MockGetDefaultCloudRegionByCloudRegionId(WireMockServer wireMockServer, String cloudRegionId, String responseFile, int statusCode) {
+ wireMockServer.stubFor(get(urlMatching("/aai/v1[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/"+cloudRegionId + ".*"))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/json; charset=utf-8")
@@ -922,152 +924,152 @@ public class StubResponseAAI {
//// 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"))
+ public static void MockGetVceById(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockGetVceByName(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockPutVce(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockDeleteVce(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockDeleteVce_404(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockDeleteServiceSubscription(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockGetServiceSubscription(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockGetServiceSubscription_200Empty(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockGetServiceSubscription_404(WireMockServer wireMockServer) {
+ wireMockServer.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 MockGetGenericVnfById(){
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
+ public static void MockGetGenericVnfById(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockGetGenericVnfById_404(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockGetGenericVnfByName(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockGetGenericVnfByName_hasRelationships(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockGetGenericVnfById_hasRelationships(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockGetGenericVnfById_500(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockGetGenericVnfByName_404(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockPutGenericVnf(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockPutGenericVnf_400(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockDeleteGenericVnf(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockDeleteGenericVnf_404(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockDeleteGenericVnf_500(WireMockServer wireMockServer){
+ wireMockServer.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"))
+ public static void MockDeleteGenericVnf_412(WireMockServer wireMockServer){
+ wireMockServer.stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[[?]]resource-version=testReVer123"))
.willReturn(aResponse()
.withStatus(412)));
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAPPC.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAPPC.java
index 58e7dcdaad..2f2cf45814 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAPPC.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseAPPC.java
@@ -21,16 +21,12 @@
package org.onap.so.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;
+import com.github.tomakehurst.wiremock.WireMockServer;
+
/**
* Reusable Mock StubResponses for Policy
*
@@ -42,14 +38,14 @@ public class StubResponseAPPC {
}
// start of Policy mocks
- public static void MockAppcError() {
- stubFor(get(urlMatching("/events/.*"))
+ public static void MockAppcError(WireMockServer wireMockServer) {
+ wireMockServer.stubFor(get(urlMatching("/events/.*"))
// .withRequestBody(containing("APPC"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBodyFile("APPC/appc_error.json")));
- stubFor(put(urlMatching("/events/.*"))
+ wireMockServer.stubFor(put(urlMatching("/events/.*"))
// .withRequestBody(containing("APPC"))
.willReturn(aResponse()
.withStatus(200)
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseDatabase.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseDatabase.java
index 6227b05d07..8fd745d765 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseDatabase.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseDatabase.java
@@ -21,11 +21,12 @@
package org.onap.so.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.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import com.github.tomakehurst.wiremock.WireMockServer;
+
/**
* Stub response class for Database stubs
* including database adapter, catalog db,
@@ -37,54 +38,54 @@ public class StubResponseDatabase {
}
- public static void MockUpdateRequestDB(String fileName){
- stubFor(post(urlEqualTo("/services/RequestsDbAdapter"))
+ public static void MockUpdateRequestDB(WireMockServer wireMockServer, String fileName){
+ wireMockServer.stubFor(post(urlEqualTo("/services/RequestsDbAdapter"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
.withBodyFile(fileName)));
}
- public static void mockUpdateRequestDB(int statusCode, String reponseFile) {
- stubFor(post(urlEqualTo("/services/RequestsDbAdapter"))
+ public static void mockUpdateRequestDB(WireMockServer wireMockServer, int statusCode, String reponseFile) {
+ wireMockServer.stubFor(post(urlEqualTo("/services/RequestsDbAdapter"))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "text/xml")
.withBodyFile(reponseFile)));
}
- public static void MockGetAllottedResourcesByModelInvariantId(String modelInvariantId, String responseFile){
- stubFor(get(urlEqualTo("/v1/serviceAllottedResources?serviceModelInvariantUuid=" + modelInvariantId))
+ public static void MockGetAllottedResourcesByModelInvariantId(WireMockServer wireMockServer, String modelInvariantId, String responseFile){
+ wireMockServer.stubFor(get(urlEqualTo("/v1/serviceAllottedResources?serviceModelInvariantUuid=" + modelInvariantId))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBodyFile(responseFile)));
}
- public static void MockGetAllottedResourcesByModelInvariantId_500(String modelInvariantId, String responseFile){
- stubFor(get(urlEqualTo("/v1/serviceAllottedResources?serviceModelInvariantUuid=" + modelInvariantId))
+ public static void MockGetAllottedResourcesByModelInvariantId_500(WireMockServer wireMockServer, String modelInvariantId, String responseFile){
+ wireMockServer.stubFor(get(urlEqualTo("/v1/serviceAllottedResources?serviceModelInvariantUuid=" + modelInvariantId))
.willReturn(aResponse()
.withStatus(500)));
}
- public static void MockGetVnfCatalogDataCustomizationUuid(String vnfModelCustomizationUuid, String responseFile){
- stubFor(get(urlEqualTo("/v2/serviceVnfs?vnfModelCustomizationUuid=" + vnfModelCustomizationUuid))
+ public static void MockGetVnfCatalogDataCustomizationUuid(WireMockServer wireMockServer, String vnfModelCustomizationUuid, String responseFile){
+ wireMockServer.stubFor(get(urlEqualTo("/v2/serviceVnfs?vnfModelCustomizationUuid=" + vnfModelCustomizationUuid))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBodyFile(responseFile)));
}
- public static void MockGetVfModuleByModelNameCatalogData(String vfModuleModelName, String responseFile){
- stubFor(get(urlEqualTo("/v2/vfModules?vfModuleModelName=" + vfModuleModelName))
+ public static void MockGetVfModuleByModelNameCatalogData(WireMockServer wireMockServer, String vfModuleModelName, String responseFile){
+ wireMockServer.stubFor(get(urlEqualTo("/v2/vfModules?vfModuleModelName=" + vfModuleModelName))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBodyFile(responseFile)));
}
- public static void MockGetServiceResourcesCatalogData(String serviceModelInvariantUuid, String serviceModelVersion, String responseFile){
- stubFor(get(urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelInvariantUuid=" +
+ public static void MockGetServiceResourcesCatalogData(WireMockServer wireMockServer, String serviceModelInvariantUuid, String serviceModelVersion, String responseFile){
+ wireMockServer.stubFor(get(urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelInvariantUuid=" +
serviceModelInvariantUuid +
"&serviceModelVersion=" + serviceModelVersion))
.willReturn(aResponse()
@@ -93,24 +94,24 @@ public class StubResponseDatabase {
.withBodyFile(responseFile)));
}
- public static void MockGetServiceResourcesCatalogData(String serviceModelInvariantUuid, String responseFile){
- stubFor(get(urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelInvariantUuid=" + serviceModelInvariantUuid))
+ public static void MockGetServiceResourcesCatalogData(WireMockServer wireMockServer, String serviceModelInvariantUuid, String responseFile){
+ wireMockServer.stubFor(get(urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelInvariantUuid=" + serviceModelInvariantUuid))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBodyFile(responseFile)));
}
- public static void MockGetServiceResourcesCatalogDataByModelUuid(String serviceModelUuid, String responseFile){
- stubFor(get(urlEqualTo("/v2/serviceResources?serviceModelUuid=" + serviceModelUuid))
+ public static void MockGetServiceResourcesCatalogDataByModelUuid(WireMockServer wireMockServer, String serviceModelUuid, String responseFile){
+ wireMockServer.stubFor(get(urlEqualTo("/v2/serviceResources?serviceModelUuid=" + serviceModelUuid))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBodyFile(responseFile)));
}
- public static void MockPostRequestDB(){
- stubFor(post(urlEqualTo("/dbadapters/RequestsDbAdapter"))
+ public static void MockPostRequestDB(WireMockServer wireMockServer){
+ wireMockServer.stubFor(post(urlEqualTo("/dbadapters/RequestsDbAdapter"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")));
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseNetworkAdapter.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseNetworkAdapter.java
index d88509cb57..3e1567412a 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseNetworkAdapter.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseNetworkAdapter.java
@@ -22,12 +22,13 @@ package org.onap.so.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.post;
import static com.github.tomakehurst.wiremock.client.WireMock.put;
-import static com.github.tomakehurst.wiremock.client.WireMock.delete;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import com.github.tomakehurst.wiremock.WireMockServer;
+
/**
* Please describe the StubResponseNetwork.java class
*
@@ -41,28 +42,28 @@ public class StubResponseNetworkAdapter {
}
- public static void MockNetworkAdapter() {
- stubFor(post(urlEqualTo("/networks/NetworkAdapter"))
+ public static void MockNetworkAdapter(WireMockServer wireMockServer) {
+ wireMockServer.stubFor(post(urlEqualTo("/networks/NetworkAdapter"))
.willReturn(aResponse()
.withStatus(200)));
}
- public static void MockNetworkAdapter(String response) {
- stubFor(post(urlEqualTo("/networks/NetworkAdapter"))
+ public static void MockNetworkAdapter(WireMockServer wireMockServer, String response) {
+ wireMockServer.stubFor(post(urlEqualTo("/networks/NetworkAdapter"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
.withBodyFile(response)));
}
- public static void MockNetworkAdapter_500() {
- stubFor(post(urlEqualTo("/networks/NetworkAdapter"))
+ public static void MockNetworkAdapter_500(WireMockServer wireMockServer) {
+ wireMockServer.stubFor(post(urlEqualTo("/networks/NetworkAdapter"))
.willReturn(aResponse()
.withStatus(500)));
}
- public static void MockNetworkAdapterPost(String responseFile, String requestContaining) {
- stubFor(post(urlEqualTo("/networks/NetworkAdapter"))
+ public static void MockNetworkAdapterPost(WireMockServer wireMockServer, String responseFile, String requestContaining) {
+ wireMockServer.stubFor(post(urlEqualTo("/networks/NetworkAdapter"))
.withRequestBody(containing(requestContaining))
.willReturn(aResponse()
.withStatus(200)
@@ -70,16 +71,16 @@ public class StubResponseNetworkAdapter {
.withBodyFile(responseFile)));
}
- public static void MockNetworkAdapter(String networkId, int statusCode, String responseFile) {
- stubFor(delete(urlEqualTo("/networks/NetworkAdapter/" + networkId))
+ public static void MockNetworkAdapter(WireMockServer wireMockServer, String networkId, int statusCode, String responseFile) {
+ wireMockServer.stubFor(delete(urlEqualTo("/networks/NetworkAdapter/" + networkId))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")
.withBodyFile(responseFile)));
}
- public static void MockNetworkAdapterContainingRequest(String requestContaining, int statusCode, String responseFile) {
- stubFor(post(urlEqualTo("/networks/NetworkAdapter"))
+ public static void MockNetworkAdapterContainingRequest(WireMockServer wireMockServer, String requestContaining, int statusCode, String responseFile) {
+ wireMockServer.stubFor(post(urlEqualTo("/networks/NetworkAdapter"))
.withRequestBody(containing(requestContaining))
.willReturn(aResponse()
.withStatus(statusCode)
@@ -87,8 +88,8 @@ public class StubResponseNetworkAdapter {
.withBodyFile(responseFile)));
}
- public static void MockPutNetworkAdapter(String networkId, String requestContaining, int statusCode, String responseFile) {
- stubFor(put(urlEqualTo("/networks/NetworkAdapter/" + networkId))
+ public static void MockPutNetworkAdapter(WireMockServer wireMockServer, String networkId, String requestContaining, int statusCode, String responseFile) {
+ wireMockServer.stubFor(put(urlEqualTo("/networks/NetworkAdapter/" + networkId))
.withRequestBody(containing(requestContaining))
.willReturn(aResponse()
.withStatus(statusCode)
@@ -96,16 +97,16 @@ public class StubResponseNetworkAdapter {
.withBodyFile(responseFile)));
}
- public static void MockNetworkAdapterRestRollbackDelete(String responseFile, String networkId) {
- stubFor(delete(urlEqualTo("/networks/NetworkAdapter/"+networkId+"/rollback"))
+ public static void MockNetworkAdapterRestRollbackDelete(WireMockServer wireMockServer, String responseFile, String networkId) {
+ wireMockServer.stubFor(delete(urlEqualTo("/networks/NetworkAdapter/"+networkId+"/rollback"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
- public static void MockNetworkAdapterRestPut(String responseFile, String networkId) {
- stubFor(put(urlEqualTo("/networks/NetworkAdapter/"+networkId))
+ public static void MockNetworkAdapterRestPut(WireMockServer wireMockServer, String responseFile, String networkId) {
+ wireMockServer.stubFor(put(urlEqualTo("/networks/NetworkAdapter/"+networkId))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseOof.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseOof.java
index 335fd94f5b..fe6c6a1396 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseOof.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseOof.java
@@ -22,9 +22,10 @@ package org.onap.so.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;
+import com.github.tomakehurst.wiremock.WireMockServer;
+
/**
* StubResponseOof.java class
*/
@@ -34,30 +35,30 @@ public class StubResponseOof {
}
- public static void mockOof() {
- stubFor(post(urlEqualTo("/api/oof/v1/placement"))
+ public static void mockOof(WireMockServer wireMockServer) {
+ wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement"))
.willReturn(aResponse()
.withStatus(202)
.withHeader("Content-Type", "application/json")));
}
- public static void mockOof(String responseFile) {
- stubFor(post(urlEqualTo("/api/oof/v1/placement"))
+ public static void mockOof(WireMockServer wireMockServer, String responseFile) {
+ wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement"))
.willReturn(aResponse()
.withStatus(202)
.withHeader("Content-Type", "application/json")
.withBodyFile(responseFile)));
}
- public static void mockOof_400() {
- stubFor(post(urlEqualTo("/api/oof/v1/placement"))
+ public static void mockOof_400(WireMockServer wireMockServer) {
+ wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement"))
.willReturn(aResponse()
.withStatus(400)
.withHeader("Content-Type", "application/json")));
}
- public static void mockOof_500() {
- stubFor(post(urlEqualTo("/api/oof/v1/placement"))
+ public static void mockOof_500(WireMockServer wireMockServer) {
+ wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement"))
.willReturn(aResponse()
.withStatus(500)
.withHeader("Content-Type", "application/json")));
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponsePolicy.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponsePolicy.java
index 809616dff0..a6c7fa57f0 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponsePolicy.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponsePolicy.java
@@ -22,14 +22,10 @@ package org.onap.so.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;
+
+import com.github.tomakehurst.wiremock.WireMockServer;
/**
* Reusable Mock StubResponses for Policy
@@ -42,36 +38,36 @@ public class StubResponsePolicy {
}
// start of Policy mocks
- public static void MockPolicyAbort() {
- stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+ public static void MockPolicyAbort(WireMockServer wireMockServer) {
+ wireMockServer.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"))
+ wireMockServer.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"))
+ wireMockServer.stubFor(post(urlEqualTo("/pdp/api/getDecision"))
.withRequestBody(containing("RPLVnfI"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBodyFile("policyAbortResponse.json")));
- stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+ wireMockServer.stubFor(post(urlEqualTo("/pdp/api/getDecision"))
.withRequestBody(containing("VnfIPU"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBodyFile("policyAbortResponse.json")));
- stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+ wireMockServer.stubFor(post(urlEqualTo("/pdp/api/getDecision"))
.withRequestBody(containing("VnfCU"))
.willReturn(aResponse()
.withStatus(200)
@@ -82,36 +78,36 @@ public class StubResponsePolicy {
}
- public static void MockPolicySkip() {
- stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+ public static void MockPolicySkip(WireMockServer wireMockServer) {
+ wireMockServer.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"))
+ wireMockServer.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"))
+ wireMockServer.stubFor(post(urlEqualTo("/pdp/api/getDecision"))
.withRequestBody(containing("RPLVnfI"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBodyFile("Policy/policySkipResponse.json")));
- stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+ wireMockServer.stubFor(post(urlEqualTo("/pdp/api/getDecision"))
.withRequestBody(containing("VnfIPU"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBodyFile("Policy/policySkipResponse.json")));
- stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+ wireMockServer.stubFor(post(urlEqualTo("/pdp/api/getDecision"))
.withRequestBody(containing("VnfCU"))
.willReturn(aResponse()
.withStatus(200)
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseSDNCAdapter.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseSDNCAdapter.java
index 66dc1f9910..10557ce091 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseSDNCAdapter.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseSDNCAdapter.java
@@ -23,10 +23,11 @@ package org.onap.so.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.post;
-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;
+import com.github.tomakehurst.wiremock.WireMockServer;
+
/**
* Please describe the StubResponseSDNC.java class
*/
@@ -36,43 +37,43 @@ public class StubResponseSDNCAdapter {
}
- public static void mockSDNCAdapter_500() {
- stubFor(post(urlEqualTo("/SDNCAdapter"))
+ public static void mockSDNCAdapter_500(WireMockServer wireMockServer) {
+ wireMockServer.stubFor(post(urlEqualTo("/SDNCAdapter"))
.willReturn(aResponse()
.withStatus(500)));
}
- public static void mockSDNCAdapter_500(String requestContaining) {
- stubFor(post(urlEqualTo("/SDNCAdapter"))
+ public static void mockSDNCAdapter_500(WireMockServer wireMockServer, String requestContaining) {
+ wireMockServer.stubFor(post(urlEqualTo("/SDNCAdapter"))
.withRequestBody(containing(requestContaining))
.willReturn(aResponse()
.withStatus(500)));
}
- public static void mockSDNCAdapter(int statusCode) {
- stubFor(post(urlMatching(".*/SDNCAdapter"))
+ public static void mockSDNCAdapter(WireMockServer wireMockServer, int statusCode) {
+ wireMockServer.stubFor(post(urlMatching(".*/SDNCAdapter"))
.willReturn(aResponse()
.withStatus(statusCode)));
}
- public static void mockSDNCAdapter(String endpoint, int statusCode, String responseFile) {
- stubFor(post(urlEqualTo(endpoint))
+ public static void mockSDNCAdapter(WireMockServer wireMockServer, String endpoint, int statusCode, String responseFile) {
+ wireMockServer.stubFor(post(urlEqualTo(endpoint))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
- public static void mockSDNCAdapter(String responseFile) {
- stubFor(post(urlEqualTo("/SDNCAdapter"))
+ public static void mockSDNCAdapter(WireMockServer wireMockServer, String responseFile) {
+ wireMockServer.stubFor(post(urlEqualTo("/SDNCAdapter"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
- public static void mockSDNCAdapter(String endpoint, String requestContaining, int statusCode, String responseFile) {
- stubFor(post(urlEqualTo(endpoint))
+ public static void mockSDNCAdapter(WireMockServer wireMockServer, String endpoint, String requestContaining, int statusCode, String responseFile) {
+ wireMockServer.stubFor(post(urlEqualTo(endpoint))
.withRequestBody(containing(requestContaining))
.willReturn(aResponse()
.withStatus(statusCode)
@@ -80,30 +81,30 @@ public class StubResponseSDNCAdapter {
.withBodyFile(responseFile)));
}
- public static void mockSDNCAdapterRest() {
- stubFor(post(urlEqualTo("/SDNCAdapter/v1/sdnc/services"))
+ public static void mockSDNCAdapterRest(WireMockServer wireMockServer) {
+ wireMockServer.stubFor(post(urlEqualTo("/SDNCAdapter/v1/sdnc/services"))
.willReturn(aResponse()
.withStatus(202)
.withHeader("Content-Type", "application/json")));
}
- public static void mockSDNCAdapterRest_500() {
- stubFor(post(urlEqualTo("/SDNCAdapter/v1/sdnc/services"))
+ public static void mockSDNCAdapterRest_500(WireMockServer wireMockServer) {
+ wireMockServer.stubFor(post(urlEqualTo("/SDNCAdapter/v1/sdnc/services"))
.willReturn(aResponse()
.withStatus(500)
.withHeader("Content-Type", "application/json")));
}
- public static void mockSDNCAdapterRest(String requestContaining) {
- stubFor(post(urlEqualTo("/SDNCAdapter/v1/sdnc/services"))
+ public static void mockSDNCAdapterRest(WireMockServer wireMockServer, String requestContaining) {
+ wireMockServer.stubFor(post(urlEqualTo("/SDNCAdapter/v1/sdnc/services"))
.withRequestBody(containing(requestContaining))
.willReturn(aResponse()
.withStatus(202)
.withHeader("Content-Type", "application/json")));
}
- public static void mockSDNCAdapterRest_500(String requestContaining) {
- stubFor(post(urlEqualTo("/SDNCAdapter/v1/sdnc/services"))
+ public static void mockSDNCAdapterRest_500(WireMockServer wireMockServer, String requestContaining) {
+ wireMockServer.stubFor(post(urlEqualTo("/SDNCAdapter/v1/sdnc/services"))
.withRequestBody(containing(requestContaining))
.willReturn(aResponse()
.withStatus(500)
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseSNIRO.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseSNIRO.java
index 22d3191821..f040a0973c 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseSNIRO.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseSNIRO.java
@@ -22,9 +22,10 @@ package org.onap.so.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;
+import com.github.tomakehurst.wiremock.WireMockServer;
+
/**
* Please describe the StubResponseSNIRO.java class
*
@@ -35,30 +36,30 @@ public class StubResponseSNIRO {
}
- public static void mockSNIRO() {
- stubFor(post(urlEqualTo("/sniro/api/v2/placement"))
+ public static void mockSNIRO(WireMockServer wireMockServer) {
+ wireMockServer.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"))
+ public static void mockSNIRO(WireMockServer wireMockServer, String responseFile) {
+ wireMockServer.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"))
+ public static void mockSNIRO_400(WireMockServer wireMockServer) {
+ wireMockServer.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"))
+ public static void mockSNIRO_500(WireMockServer wireMockServer) {
+ wireMockServer.stubFor(post(urlEqualTo("/sniro/api/v2/placement"))
.willReturn(aResponse()
.withStatus(500)
.withHeader("Content-Type", "application/json")));
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseVNFAdapter.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseVNFAdapter.java
index 75283515af..e90d358ba8 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseVNFAdapter.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/mock/StubResponseVNFAdapter.java
@@ -21,161 +21,161 @@
package org.onap.so.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.post;
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;
+import com.github.tomakehurst.wiremock.WireMockServer;
+
/**
* Please describe the StubResponseVNF.java class
*/
public class StubResponseVNFAdapter {
- public static void mockVNFAdapter() {
- stubFor(post(urlEqualTo("/vnfs/VnfAdapterAsync"))
+ public static void mockVNFAdapter(WireMockServer wireMockServer) {
+ wireMockServer.stubFor(post(urlEqualTo("/vnfs/VnfAdapterAsync"))
.willReturn(aResponse()
.withStatus(200)));
}
- public static void mockVNFAdapter(String responseFile) {
- stubFor(post(urlEqualTo("/vnfs/VnfAdapterAsync"))
+ public static void mockVNFAdapter(WireMockServer wireMockServer, String responseFile) {
+ wireMockServer.stubFor(post(urlEqualTo("/vnfs/VnfAdapterAsync"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
.withBodyFile(responseFile)));
}
- public static void mockVNFAdapter_500() {
- stubFor(post(urlEqualTo("/vnfs/VnfAdapterAsync"))
+ public static void mockVNFAdapter_500(WireMockServer wireMockServer) {
+ wireMockServer.stubFor(post(urlEqualTo("/vnfs/VnfAdapterAsync"))
.willReturn(aResponse()
.withStatus(500)));
}
- public static void mockVNFPost(String vfModuleId, int statusCode, String vnfId) {
- stubFor(post(urlEqualTo("/services/rest/v1/vnfs" + vnfId + "/vf-modules" + vfModuleId))
+ public static void mockVNFPost(WireMockServer wireMockServer, String vfModuleId, int statusCode, String vnfId) {
+ wireMockServer.stubFor(post(urlEqualTo("/services/rest/v1/vnfs" + vnfId + "/vf-modules" + vfModuleId))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
- stubFor(post(urlEqualTo("/services/rest/v1/vnfs/" + vnfId + "/vf-modules" + vfModuleId))
+ wireMockServer.stubFor(post(urlEqualTo("/services/rest/v1/vnfs/" + vnfId + "/vf-modules" + vfModuleId))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
}
- public static void mockVNFPut(String vfModuleId, int statusCode) {
- stubFor(put(urlEqualTo("/services/rest/v1/vnfsvnfId/vf-modules" + vfModuleId))
+ public static void mockVNFPut(WireMockServer wireMockServer, String vfModuleId, int statusCode) {
+ wireMockServer.stubFor(put(urlEqualTo("/services/rest/v1/vnfsvnfId/vf-modules" + vfModuleId))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
- stubFor(put(urlEqualTo("/services/rest/v1/vnfs/vnfId/vf-modules" + vfModuleId))
+ wireMockServer.stubFor(put(urlEqualTo("/services/rest/v1/vnfs/vnfId/vf-modules" + vfModuleId))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
}
- public static void mockVNFPut(String vnfId, String vfModuleId, int statusCode) {
- stubFor(put(urlEqualTo("/services/rest/v1/vnfs" + vnfId + "/vf-modules" + vfModuleId))
+ public static void mockVNFPut(WireMockServer wireMockServer, String vnfId, String vfModuleId, int statusCode) {
+ wireMockServer.stubFor(put(urlEqualTo("/services/rest/v1/vnfs" + vnfId + "/vf-modules" + vfModuleId))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
- stubFor(put(urlEqualTo("/services/rest/v1/vnfs/" + vnfId + "/vf-modules" + vfModuleId))
+ wireMockServer.stubFor(put(urlEqualTo("/services/rest/v1/vnfs/" + vnfId + "/vf-modules" + vfModuleId))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
}
- public static void mockVNFDelete(String vnfId, String vfModuleId, int statusCode) {
- stubFor(delete(urlEqualTo("/services/rest/v1/vnfs" + vnfId + "/vf-modules" + vfModuleId))
+ public static void mockVNFDelete(WireMockServer wireMockServer, String vnfId, String vfModuleId, int statusCode) {
+ wireMockServer.stubFor(delete(urlEqualTo("/services/rest/v1/vnfs" + vnfId + "/vf-modules" + vfModuleId))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
- stubFor(delete(urlEqualTo("/services/rest/v1/vnfs/" + vnfId + "/vf-modules" + vfModuleId))
+ wireMockServer.stubFor(delete(urlEqualTo("/services/rest/v1/vnfs/" + vnfId + "/vf-modules" + vfModuleId))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
}
- public static void mockVNFRollbackDelete(String vfModuleId, int statusCode) {
- stubFor(delete(urlEqualTo("/services/rest/v1/vnfsvnfId/vf-modules" + vfModuleId + "/rollback"))
+ public static void mockVNFRollbackDelete(WireMockServer wireMockServer, String vfModuleId, int statusCode) {
+ wireMockServer.stubFor(delete(urlEqualTo("/services/rest/v1/vnfsvnfId/vf-modules" + vfModuleId + "/rollback"))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
- stubFor(delete(urlEqualTo("/services/rest/v1/vnfs/vnfId/vf-modules" + vfModuleId + "/rollback"))
+ wireMockServer.stubFor(delete(urlEqualTo("/services/rest/v1/vnfs/vnfId/vf-modules" + vfModuleId + "/rollback"))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
}
- public static void mockPutVNFVolumeGroup(String volumeGroupId, int statusCode) {
- stubFor(put(urlEqualTo("/vnfs/v1/volume-groups/" + volumeGroupId))
+ public static void mockPutVNFVolumeGroup(WireMockServer wireMockServer, String volumeGroupId, int statusCode) {
+ wireMockServer.stubFor(put(urlEqualTo("/vnfs/v1/volume-groups/" + volumeGroupId))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
- stubFor(put(urlEqualTo("/vnfs/rest/v1/volume-groups/" + volumeGroupId))
+ wireMockServer.stubFor(put(urlEqualTo("/vnfs/rest/v1/volume-groups/" + volumeGroupId))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
}
- public static void mockPutVNFVolumeGroupRollback(String volumeGroupId, int statusCode) {
- stubFor(delete(urlMatching("/vnfs/v1/volume-groups/" + volumeGroupId + "/rollback"))
+ public static void mockPutVNFVolumeGroupRollback(WireMockServer wireMockServer, String volumeGroupId, int statusCode) {
+ wireMockServer.stubFor(delete(urlMatching("/vnfs/v1/volume-groups/" + volumeGroupId + "/rollback"))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
- stubFor(delete(urlMatching("/vnfs/rest/v1/volume-groups/" + volumeGroupId + "/rollback"))
+ wireMockServer.stubFor(delete(urlMatching("/vnfs/rest/v1/volume-groups/" + volumeGroupId + "/rollback"))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
}
- public static void mockPostVNFVolumeGroup(int statusCode) {
- stubFor(post(urlEqualTo("/vnfs/v1/volume-groups"))
+ public static void mockPostVNFVolumeGroup(WireMockServer wireMockServer, int statusCode) {
+ wireMockServer.stubFor(post(urlEqualTo("/vnfs/v1/volume-groups"))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
- stubFor(post(urlEqualTo("/vnfs/rest/v1/volume-groups"))
+ wireMockServer.stubFor(post(urlEqualTo("/vnfs/rest/v1/volume-groups"))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
}
- public static void mockVNFAdapterRest(String vnfId) {
- stubFor(post(urlEqualTo("/services/rest/v1/vnfs" + vnfId + "/vf-modules"))
+ public static void mockVNFAdapterRest(WireMockServer wireMockServer, String vnfId) {
+ wireMockServer.stubFor(post(urlEqualTo("/services/rest/v1/vnfs" + vnfId + "/vf-modules"))
.willReturn(aResponse()
.withStatus(200)));
- stubFor(post(urlEqualTo("/services/rest/v1/vnfs/" + vnfId + "/vf-modules"))
+ wireMockServer.stubFor(post(urlEqualTo("/services/rest/v1/vnfs/" + vnfId + "/vf-modules"))
.willReturn(aResponse()
.withStatus(200)));
}
- public static void mockVNFAdapterRest_500(String vnfId) {
- stubFor(post(urlEqualTo("/services/rest/v1/vnfs" + vnfId + "/vf-modules"))
+ public static void mockVNFAdapterRest_500(WireMockServer wireMockServer, String vnfId) {
+ wireMockServer.stubFor(post(urlEqualTo("/services/rest/v1/vnfs" + vnfId + "/vf-modules"))
.willReturn(aResponse()
.withStatus(500)));
- stubFor(post(urlEqualTo("/services/rest/v1/vnfs/" + vnfId + "/vf-modules"))
+ wireMockServer.stubFor(post(urlEqualTo("/services/rest/v1/vnfs/" + vnfId + "/vf-modules"))
.willReturn(aResponse()
.withStatus(500)));
}
- public static void mockVfModuleDelete(String volumeGroupId) {
- stubFor(delete(urlMatching("/vnfs/v1/volume-groups/"+ volumeGroupId))
+ public static void mockVfModuleDelete(WireMockServer wireMockServer, String volumeGroupId) {
+ wireMockServer.stubFor(delete(urlMatching("/vnfs/v1/volume-groups/"+ volumeGroupId))
.willReturn(aResponse()
.withStatus(202)
.withHeader("Content-Type", "application/xml")));
- stubFor(delete(urlMatching("/vnfs/rest/v1/volume-groups/"+ volumeGroupId))
+ wireMockServer.stubFor(delete(urlMatching("/vnfs/rest/v1/volume-groups/"+ volumeGroupId))
.willReturn(aResponse()
.withStatus(202)
.withHeader("Content-Type", "application/xml")));
}
- public static void mockVfModuleDelete(String volumeGroupId, int statusCode) {
- stubFor(delete(urlMatching("/vnfs/v1/volume-groups/78987"))
+ public static void mockVfModuleDelete(WireMockServer wireMockServer, String volumeGroupId, int statusCode) {
+ wireMockServer.stubFor(delete(urlMatching("/vnfs/v1/volume-groups/78987"))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
- stubFor(delete(urlMatching("/vnfs/rest/v1/volume-groups/78987"))
+ wireMockServer.stubFor(delete(urlMatching("/vnfs/rest/v1/volume-groups/78987"))
.willReturn(aResponse()
.withStatus(statusCode)
.withHeader("Content-Type", "application/xml")));
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/BaseIntegrationTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/BaseIntegrationTest.java
index b5511f67e3..fc21ff905d 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/BaseIntegrationTest.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/BaseIntegrationTest.java
@@ -32,6 +32,7 @@ import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
+import com.github.tomakehurst.wiremock.WireMockServer;
import com.github.tomakehurst.wiremock.client.WireMock;
@RunWith(SpringRunner.class)
@@ -46,9 +47,12 @@ public abstract class BaseIntegrationTest extends WorkflowTest {
@Value("${wiremock.server.port}")
protected String wiremockPort;
+ @Autowired
+ protected WireMockServer wireMockServer;
+
@After
public void baseAfterTest() {
- WireMock.reset();
+ wireMockServer.resetAll();
}
}
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CompleteMsoProcessIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CompleteMsoProcessIT.java
index 470cc2220d..f528205d17 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CompleteMsoProcessIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CompleteMsoProcessIT.java
@@ -38,7 +38,7 @@ import org.onap.so.BaseIntegrationTest;
public class CompleteMsoProcessIT extends BaseIntegrationTest {
private void executeFlow(String inputRequestFile) throws InterruptedException {
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
Map<String, Object> variables = new HashMap<>();
variables.put("CompleteMsoProcessRequest",inputRequestFile);
variables.put("mso-request-id", UUID.randomUUID().toString());
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ConfirmVolumeGroupNameIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ConfirmVolumeGroupNameIT.java
index 0ef856bb9d..cc3ca941e4 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ConfirmVolumeGroupNameIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ConfirmVolumeGroupNameIT.java
@@ -46,7 +46,7 @@ public class ConfirmVolumeGroupNameIT extends BaseIntegrationTest {
@Test
public void sunnyDay() throws Exception {
logStart();
- MockGetVolumeGroupById("MDTWNJ21", "VOLUME_GROUP_ID_1", "aai-volume-group-id-info.xml");
+ MockGetVolumeGroupById(wireMockServer, "MDTWNJ21", "VOLUME_GROUP_ID_1", "aai-volume-group-id-info.xml");
Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
@@ -72,7 +72,7 @@ public class ConfirmVolumeGroupNameIT extends BaseIntegrationTest {
logStart();
// does not exist would return a 404 from AAI
- MockGetVolumeGroupById("MDTWNJ21", "VOLUME_GROUP_ID_THAT_DOES_NOT_EXIST", "aai-volume-group-id-info.xml", 404);
+ MockGetVolumeGroupById(wireMockServer, "MDTWNJ21", "VOLUME_GROUP_ID_THAT_DOES_NOT_EXIST", "aai-volume-group-id-info.xml", 404);
Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
@@ -98,7 +98,7 @@ public class ConfirmVolumeGroupNameIT extends BaseIntegrationTest {
public void rainyDayNameDoesNotMatch() throws Exception {
logStart();
- MockGetVolumeGroupById("MDTWNJ21", "VOLUME_GROUP_ID_1", "aai-volume-group-id-info.xml", 200);
+ MockGetVolumeGroupById(wireMockServer, "MDTWNJ21", "VOLUME_GROUP_ID_1", "aai-volume-group-id-info.xml", 200);
Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ConfirmVolumeGroupTenantIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ConfirmVolumeGroupTenantIT.java
index af9ab7d3e4..fd1f7c1a2b 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ConfirmVolumeGroupTenantIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ConfirmVolumeGroupTenantIT.java
@@ -42,7 +42,7 @@ public class ConfirmVolumeGroupTenantIT extends BaseIntegrationTest {
@Test
public void testRemoveLayer3Service_success() throws Exception{
- MockGetVolumeGroupById("MDTWNJ21", "a8399879-31b3-4973-be26-0a0cbe776b58", "CRTGVNF_queryAAIResponseVolume.xml");
+ MockGetVolumeGroupById(wireMockServer, "MDTWNJ21", "a8399879-31b3-4973-be26-0a0cbe776b58", "CRTGVNF_queryAAIResponseVolume.xml");
Map<String, Object> variables = new HashMap<>();
setVariables(variables);
@@ -60,7 +60,7 @@ public class ConfirmVolumeGroupTenantIT extends BaseIntegrationTest {
@Test
public void testRemoveLayer3Service_idsNotMatch() throws Exception{
- MockGetVolumeGroupById("MDTWNJ21", "a8399879-31b3-4973-be26-0a0cbe776b58", "CRTGVNF_queryAAIResponseVolume_idsNotMatch.xml");
+ MockGetVolumeGroupById(wireMockServer, "MDTWNJ21", "a8399879-31b3-4973-be26-0a0cbe776b58", "CRTGVNF_queryAAIResponseVolume_idsNotMatch.xml");
Map<String, Object> variables = new HashMap<>();
setVariables(variables);
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleIT.java
index f6284f3535..f6cd74a55b 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleIT.java
@@ -25,10 +25,8 @@ package org.onap.so.bpmn.common;
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.put;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
-
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@@ -40,6 +38,8 @@ import org.onap.so.bpmn.core.WorkflowException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.github.tomakehurst.wiremock.WireMockServer;
+
/**
* Unit test for CreateAAIVfModule.bpmn.
*/
@@ -51,9 +51,9 @@ public class CreateAAIVfModuleIT extends BaseIntegrationTest {
@Test
public void TestCreateGenericVnfSuccess_200() {
- new MockAAIGenericVnfSearch();
- MockAAICreateGenericVnf();
- MockAAIVfModulePUT(true);
+ new MockAAIGenericVnfSearch(wireMockServer);
+ MockAAICreateGenericVnf(wireMockServer);
+ MockAAIVfModulePUT(wireMockServer, true);
Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", UUID.randomUUID().toString());
@@ -76,9 +76,9 @@ public class CreateAAIVfModuleIT extends BaseIntegrationTest {
@Test
public void TestCreateVfModuleSuccess_200() {
// create Add-on VF Module for existing Generic VNF
- new MockAAIGenericVnfSearch();
- MockAAICreateGenericVnf();
- MockAAIVfModulePUT(true);
+ new MockAAIGenericVnfSearch(wireMockServer);
+ MockAAICreateGenericVnf(wireMockServer);
+ MockAAIVfModulePUT(wireMockServer, true);
Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", UUID.randomUUID().toString());
variables.put("isDebugLogEnabled","true");
@@ -98,9 +98,9 @@ public class CreateAAIVfModuleIT extends BaseIntegrationTest {
@Test
public void TestQueryGenericVnfFailure_5000() {
- new MockAAIGenericVnfSearch();
- MockAAICreateGenericVnf();
- MockAAIVfModulePUT(true);
+ new MockAAIGenericVnfSearch(wireMockServer);
+ MockAAICreateGenericVnf(wireMockServer);
+ MockAAIVfModulePUT(wireMockServer, true);
Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", UUID.randomUUID().toString());
@@ -121,9 +121,9 @@ public class CreateAAIVfModuleIT extends BaseIntegrationTest {
@Test
public void TestCreateDupGenericVnfFailure_1002() {
- new MockAAIGenericVnfSearch();
- MockAAICreateGenericVnf();
- MockAAIVfModulePUT(true);
+ new MockAAIGenericVnfSearch(wireMockServer);
+ MockAAICreateGenericVnf(wireMockServer);
+ MockAAIVfModulePUT(wireMockServer, true);
Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", UUID.randomUUID().toString());
@@ -144,9 +144,9 @@ public class CreateAAIVfModuleIT extends BaseIntegrationTest {
@Test
public void TestCreateDupVfModuleFailure_1002() {
- new MockAAIGenericVnfSearch();
- MockAAICreateGenericVnf();
- MockAAIVfModulePUT(true);
+ new MockAAIGenericVnfSearch(wireMockServer);
+ MockAAICreateGenericVnf(wireMockServer);
+ MockAAIVfModulePUT(wireMockServer, true);
Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", UUID.randomUUID().toString());
@@ -167,9 +167,9 @@ public class CreateAAIVfModuleIT extends BaseIntegrationTest {
@Test
public void TestCreateGenericVnfFailure_5000() {
- new MockAAIGenericVnfSearch();
- MockAAICreateGenericVnf();
- MockAAIVfModulePUT(true);
+ new MockAAIGenericVnfSearch(wireMockServer);
+ MockAAICreateGenericVnf(wireMockServer);
+ MockAAIVfModulePUT(wireMockServer, true);
Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", UUID.randomUUID().toString());
@@ -190,9 +190,9 @@ public class CreateAAIVfModuleIT extends BaseIntegrationTest {
@Test
public void TestCreateGenericVnfFailure_1002() {
- new MockAAIGenericVnfSearch();
- MockAAICreateGenericVnf();
- MockAAIVfModulePUT(true);
+ new MockAAIGenericVnfSearch(wireMockServer);
+ MockAAICreateGenericVnf(wireMockServer);
+ MockAAIVfModulePUT(wireMockServer, true);
Map<String, Object> variables = new HashMap<>();
variables.put("mso-request-id", UUID.randomUUID().toString());
@@ -213,9 +213,9 @@ public class CreateAAIVfModuleIT extends BaseIntegrationTest {
@Test
public void TestCreateVfModuleFailure_5000() {
- new MockAAIGenericVnfSearch();
- MockAAICreateGenericVnf();
- MockAAIVfModulePUT(true);
+ new MockAAIGenericVnfSearch(wireMockServer);
+ MockAAICreateGenericVnf(wireMockServer);
+ MockAAIVfModulePUT(wireMockServer, true);
Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
@@ -234,12 +234,12 @@ public class CreateAAIVfModuleIT extends BaseIntegrationTest {
logger.debug(exception.getErrorMessage());
}
- public static void MockAAICreateGenericVnf(){
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*"))
+ public static void MockAAICreateGenericVnf(WireMockServer wireMockServer){
+ wireMockServer.stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*"))
.withRequestBody(containing("<service-id>00000000-0000-0000-0000-000000000000</service-id>"))
.willReturn(aResponse()
.withStatus(201)));
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*"))
+ wireMockServer.stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*"))
.withRequestBody(containing("<service-id>99999999-9999-9999-9999-999999999999</service-id>"))
.willReturn(aResponse()
.withStatus(500)
@@ -248,18 +248,18 @@ public class CreateAAIVfModuleIT extends BaseIntegrationTest {
}
// start of mocks used locally and by other VF Module unit tests
- public static void MockAAIVfModulePUT(boolean isCreate){
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*/vf-modules/vf-module/.*"))
+ public static void MockAAIVfModulePUT(WireMockServer wireMockServer, boolean isCreate){
+ wireMockServer.stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*/vf-modules/vf-module/.*"))
.withRequestBody(containing("MMSC"))
.willReturn(aResponse()
.withStatus(isCreate ? 201 : 200)));
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*/vf-modules/vf-module/.*"))
+ wireMockServer.stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*/vf-modules/vf-module/.*"))
.withRequestBody(containing("PCRF"))
.willReturn(aResponse()
.withStatus(500)
.withHeader("Content-Type", "text/xml")
.withBodyFile("aaiFault.xml")));
- stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721"))
+ wireMockServer.stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721"))
.willReturn(aResponse()
.withStatus(200)));
}
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleVolumeGroupIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleVolumeGroupIT.java
index f72ca79dc6..39a7e0c74b 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleVolumeGroupIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/CreateAAIVfModuleVolumeGroupIT.java
@@ -56,8 +56,8 @@ public class CreateAAIVfModuleVolumeGroupIT extends BaseIntegrationTest {
logStart();
String updateAAIVfModuleRequest = FileUtil.readResourceFile("__files/VfModularity/CreateAAIVfModuleVolumeGroupRequest.xml");
- MockGetGenericVnfByIdWithPriority("skask", "lukewarm", 200, "VfModularity/VfModule-lukewarm.xml", 2);
- MockPutVfModuleIdNoResponse("skask", "PCRF", "lukewarm");
+ MockGetGenericVnfByIdWithPriority(wireMockServer, "skask", "lukewarm", 200, "VfModularity/VfModule-lukewarm.xml", 2);
+ MockPutVfModuleIdNoResponse(wireMockServer, "skask", "PCRF", "lukewarm");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -85,7 +85,7 @@ public class CreateAAIVfModuleVolumeGroupIT extends BaseIntegrationTest {
logStart();
String updateAAIVfModuleRequest = FileUtil.readResourceFile("__files/VfModularity/CreateAAIVfModuleVolumeGroupRequest.xml");
- MockGetVfModuleId("skask", ".*", "VfModularity/VfModule-supercool.xml", 404);
+ MockGetVfModuleId(wireMockServer, "skask", ".*", "VfModularity/VfModule-supercool.xml", 404);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -112,8 +112,8 @@ public class CreateAAIVfModuleVolumeGroupIT extends BaseIntegrationTest {
logStart();
String updateAAIVfModuleRequest = FileUtil.readResourceFile("__files/VfModularity/CreateAAIVfModuleVolumeGroupRequest.xml");
- MockGetVfModuleId("skask", "lukewarm", "VfModularity/VfModule-lukewarm.xml", 200);
- MockPutVfModuleId("skask", "lukewarm", 404);
+ MockGetVfModuleId(wireMockServer, "skask", "lukewarm", "VfModularity/VfModule-lukewarm.xml", 200);
+ MockPutVfModuleId(wireMockServer, "skask", "lukewarm", 404);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/DecomposeServiceIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/DecomposeServiceIT.java
index 7acaf449e3..3d15a4b29b 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/DecomposeServiceIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/DecomposeServiceIT.java
@@ -46,7 +46,7 @@ public class DecomposeServiceIT extends BaseIntegrationTest {
@Test
public void testDecomposeService_success() throws Exception{
- MockGetServiceResourcesCatalogData("cmw-123-456-789", "1.0", "/getCatalogServiceResourcesDataWithConfig.json");
+ MockGetServiceResourcesCatalogData(wireMockServer, "cmw-123-456-789", "1.0", "/getCatalogServiceResourcesDataWithConfig.json");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -62,7 +62,7 @@ public class DecomposeServiceIT extends BaseIntegrationTest {
//@Test
@Test
public void testDecomposeService_success_partial() throws Exception{
- MockGetServiceResourcesCatalogData("cmw-123-456-789", "1.0", "/getCatalogServiceResourcesDataNoNetwork.json");
+ MockGetServiceResourcesCatalogData(wireMockServer, "cmw-123-456-789", "1.0", "/getCatalogServiceResourcesDataNoNetwork.json");
String businessKey = UUID.randomUUID().toString();
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/DeleteAAIVfModuleIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/DeleteAAIVfModuleIT.java
index f98e4477aa..99e4b8cbde 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/DeleteAAIVfModuleIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/DeleteAAIVfModuleIT.java
@@ -20,18 +20,10 @@
package org.onap.so.bpmn.common;
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-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.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
-
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
-import org.camunda.bpm.engine.RuntimeService;
-import org.camunda.bpm.engine.test.Deployment;
import org.junit.Assert;
import org.junit.Test;
import org.onap.so.BaseIntegrationTest;
@@ -52,9 +44,9 @@ public class DeleteAAIVfModuleIT extends BaseIntegrationTest {
public void TestDeleteGenericVnfSuccess_200() {
// delete the Base Module and Generic Vnf
// vnf-id=a27ce5a9-29c4-4c22-a017-6615ac73c721, vf-module-id=973ed047-d251-4fb9-bf1a-65b8949e0a73
- new MockAAIGenericVnfSearch();
- new MockAAIDeleteGenericVnf();
- new MockAAIDeleteVfModule();
+ new MockAAIGenericVnfSearch(wireMockServer);
+ new MockAAIDeleteGenericVnf(wireMockServer);
+ new MockAAIDeleteVfModule(wireMockServer);
Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
@@ -86,9 +78,9 @@ public class DeleteAAIVfModuleIT extends BaseIntegrationTest {
" <vnf-params xmlns:tns=\"http://openecomp.org/mso/infra/vnf-request/v1\"/>" + EOL +
"</vnf-request>" + EOL;
- new MockAAIGenericVnfSearch();
- new MockAAIDeleteGenericVnf();
- new MockAAIDeleteVfModule();
+ new MockAAIGenericVnfSearch(wireMockServer);
+ new MockAAIDeleteGenericVnf(wireMockServer);
+ new MockAAIDeleteVfModule(wireMockServer);
Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
@@ -119,9 +111,9 @@ public class DeleteAAIVfModuleIT extends BaseIntegrationTest {
" </vnf-inputs>" + EOL +
" <vnf-params xmlns:tns=\"http://openecomp.org/mso/infra/vnf-request/v1\"/>" + EOL +
"</vnf-request>" + EOL;
- new MockAAIGenericVnfSearch();
- new MockAAIDeleteGenericVnf();
- new MockAAIDeleteVfModule();
+ new MockAAIGenericVnfSearch(wireMockServer);
+ new MockAAIDeleteGenericVnf(wireMockServer);
+ new MockAAIDeleteVfModule(wireMockServer);
Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
@@ -152,9 +144,9 @@ public class DeleteAAIVfModuleIT extends BaseIntegrationTest {
" </vnf-inputs>" + EOL +
" <vnf-params xmlns:tns=\"http://openecomp.org/mso/infra/vnf-request/v1\"/>" + EOL +
"</vnf-request>" + EOL;
- new MockAAIGenericVnfSearch();
- new MockAAIDeleteGenericVnf();
- new MockAAIDeleteVfModule();
+ new MockAAIGenericVnfSearch(wireMockServer);
+ new MockAAIDeleteGenericVnf(wireMockServer);
+ new MockAAIDeleteVfModule(wireMockServer);
Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
@@ -185,9 +177,9 @@ public class DeleteAAIVfModuleIT extends BaseIntegrationTest {
" </vnf-inputs>" + EOL +
" <vnf-params xmlns:tns=\"http://openecomp.org/mso/infra/vnf-request/v1\"/>" + EOL +
"</vnf-request>" + EOL;
- new MockAAIGenericVnfSearch();
- new MockAAIDeleteGenericVnf();
- new MockAAIDeleteVfModule();
+ new MockAAIGenericVnfSearch(wireMockServer);
+ new MockAAIDeleteGenericVnf(wireMockServer);
+ new MockAAIDeleteVfModule(wireMockServer);
Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
@@ -218,9 +210,9 @@ public class DeleteAAIVfModuleIT extends BaseIntegrationTest {
" </vnf-inputs>" + EOL +
" <vnf-params xmlns:tns=\"http://openecomp.org/mso/infra/vnf-request/v1\"/>" + EOL +
"</vnf-request>" + EOL;
- new MockAAIGenericVnfSearch();
- new MockAAIDeleteGenericVnf();
- new MockAAIDeleteVfModule();
+ new MockAAIGenericVnfSearch(wireMockServer);
+ new MockAAIDeleteGenericVnf(wireMockServer);
+ new MockAAIDeleteVfModule(wireMockServer);
Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
@@ -251,9 +243,9 @@ public class DeleteAAIVfModuleIT extends BaseIntegrationTest {
" </vnf-inputs>" + EOL +
" <vnf-params xmlns:tns=\"http://openecomp.org/mso/infra/vnf-request/v1\"/>" + EOL +
"</vnf-request>" + EOL;
- new MockAAIGenericVnfSearch();
- new MockAAIDeleteGenericVnf();
- new MockAAIDeleteVfModule();
+ new MockAAIGenericVnfSearch(wireMockServer);
+ new MockAAIDeleteGenericVnf(wireMockServer);
+ new MockAAIDeleteVfModule(wireMockServer);
Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
@@ -270,9 +262,9 @@ public class DeleteAAIVfModuleIT extends BaseIntegrationTest {
public void TestDeleteVfModuleFailure_1002_2() {
// failure attempting to delete a Vf Module that does not exist (A&AI returns 404)
// vnf-id=a27ce5a9-29c4-4c22-a017-6615ac73c720, vf-module-id=973ed047-d251-4fb9-bf1a-65b8949e0a76
- new MockAAIGenericVnfSearch();
- new MockAAIDeleteGenericVnf();
- new MockAAIDeleteVfModule();
+ new MockAAIGenericVnfSearch(wireMockServer);
+ new MockAAIDeleteGenericVnf(wireMockServer);
+ new MockAAIDeleteVfModule(wireMockServer);
Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/FalloutHandlerIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/FalloutHandlerIT.java
index f477926f99..88f8e5deb7 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/FalloutHandlerIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/FalloutHandlerIT.java
@@ -24,7 +24,6 @@ package org.onap.so.bpmn.common;
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;
import static org.onap.so.bpmn.common.BPMNUtil.waitForWorkflowToFinish;
@@ -48,12 +47,12 @@ public class FalloutHandlerIT extends BaseIntegrationTest {
private void setupMocks() {
- stubFor(post(urlEqualTo("/dbadapters/AttRequestsDbAdapter"))
+ wireMockServer.stubFor(post(urlEqualTo("/dbadapters/AttRequestsDbAdapter"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
.withBody("<DbTag>Notified</DbTag>")));
- stubFor(post(urlEqualTo("/dbadapters/RequestsDbAdapter"))
+ wireMockServer.stubFor(post(urlEqualTo("/dbadapters/RequestsDbAdapter"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/GenerateVfModuleNameIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/GenerateVfModuleNameIT.java
index fa8823a5b4..7299e0602e 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/GenerateVfModuleNameIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/GenerateVfModuleNameIT.java
@@ -61,7 +61,7 @@ public class GenerateVfModuleNameIT extends BaseIntegrationTest {
" <vnf-params xmlns:tns=\"http://ecomp.att.com/mso/infra/vnf-request/v1\"/>" + EOL +
"</vnf-request>" + EOL;
- MockGetGenericVnfById(".*", "GenericFlows/getGenericVnfByNameResponse.xml");
+ MockGetGenericVnfById(wireMockServer, ".*", "GenericFlows/getGenericVnfByNameResponse.xml");
RuntimeService runtimeService = processEngine.getRuntimeService();
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("isDebugLogEnabled","true");
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ManualHandlingIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ManualHandlingIT.java
index 67ae7de928..53d29c51bf 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ManualHandlingIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/ManualHandlingIT.java
@@ -46,7 +46,7 @@ public class ManualHandlingIT extends BaseIntegrationTest {
@Test
public void TestManualHandlingSuccess() {
- MockPostRequestDB();
+ MockPostRequestDB(wireMockServer);
Map<String, Object> variables = new HashMap<>();
variables.put("isDebugLogEnabled","true");
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteGenericVnf.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteGenericVnf.java
index 819962f16c..052fd5dc94 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteGenericVnf.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteGenericVnf.java
@@ -22,15 +22,16 @@ package org.onap.so.bpmn.common;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.delete;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+import com.github.tomakehurst.wiremock.WireMockServer;
+
public class MockAAIDeleteGenericVnf {
- public MockAAIDeleteGenericVnf(){
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721/[?]resource-version=0000021"))
+ public MockAAIDeleteGenericVnf(WireMockServer wireMockServer){
+ wireMockServer.stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721/[?]resource-version=0000021"))
.willReturn(aResponse()
.withStatus(200)));
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c718/[?]resource-version=0000018"))
+ wireMockServer.stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c718/[?]resource-version=0000018"))
.willReturn(aResponse()
.withStatus(500)
.withHeader("Content-Type", "text/xml")
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteVfModule.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteVfModule.java
index 9cb10a0494..1cbe0b9244 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteVfModule.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/MockAAIDeleteVfModule.java
@@ -23,31 +23,32 @@ package org.onap.so.bpmn.common;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
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.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+import com.github.tomakehurst.wiremock.WireMockServer;
+
public class MockAAIDeleteVfModule {
- public MockAAIDeleteVfModule()
+ public MockAAIDeleteVfModule(WireMockServer wireMockServer)
{
- stubFor(delete(urlMatching(
+ wireMockServer.stubFor(delete(urlMatching(
"/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721/vf-modules/vf-module/973ed047-d251-4fb9-bf1a-65b8949e0a73/[?]resource-version=0000073"))
.willReturn(aResponse().withStatus(200)));
- stubFor(delete(urlMatching(
+ wireMockServer.stubFor(delete(urlMatching(
"/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c720/vf-modules/vf-module/973ed047-d251-4fb9-bf1a-65b8949e0a75/[?]resource-version=0000075"))
.willReturn(aResponse().withStatus(200)));
- stubFor(delete(urlMatching(
+ wireMockServer.stubFor(delete(urlMatching(
"/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c718/vf-modules/vf-module/973ed047-d251-4fb9-bf1a-65b8949e0a78/[?]resource-version=0000078"))
.willReturn(aResponse().withStatus(200)));
- stubFor(delete(urlMatching(
+ wireMockServer.stubFor(delete(urlMatching(
"/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c719/vf-modules/vf-module/973ed047-d251-4fb9-bf1a-65b8949e0a77/[?]resource-version=0000077"))
.willReturn(aResponse().withStatus(500).withHeader("Content-Type", "text/xml")
.withBodyFile("aaiFault.xml")));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy\\?network-policy-fqdn=.*"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy\\?network-policy-fqdn=.*"))
.willReturn(aResponse().withStatus(200).withHeader("Content-Type", "text/xml")
.withBodyFile("VfModularity/QueryNetworkPolicy_AAIResponse_Success.xml")));
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/.*"))
+ wireMockServer.stubFor(delete(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/.*"))
.willReturn(aResponse().withStatus(200)));
}
}
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/MockAAIGenericVnfSearch.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/MockAAIGenericVnfSearch.java
index b46d528cc5..1d6337ffc4 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/MockAAIGenericVnfSearch.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/MockAAIGenericVnfSearch.java
@@ -22,30 +22,31 @@ package org.onap.so.bpmn.common;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+import com.github.tomakehurst.wiremock.WireMockServer;
+
public class MockAAIGenericVnfSearch {
private static final String EOL = "\n";
- public MockAAIGenericVnfSearch(){
+ public MockAAIGenericVnfSearch(WireMockServer wireMockServer){
String body;
// The following stubs are for CreateAAIVfModule and UpdateAAIVfModule
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC23&depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC23&depth=1"))
.willReturn(aResponse()
.withStatus(500)
.withHeader("Content-Type", "text/xml")
.withBodyFile("aaiFault.xml")));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC22&depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC22&depth=1"))
.willReturn(aResponse()
.withStatus(404)
.withHeader("Content-Type", "text/xml")
.withBody("Generic VNF Not Found")));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/768073c7-f41f-4822-9323-b75962763d74[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/768073c7-f41f-4822-9323-b75962763d74[?]depth=1"))
.willReturn(aResponse()
.withStatus(404)
.withHeader("Content-Type", "text/xml")
@@ -78,12 +79,12 @@ public class MockAAIGenericVnfSearch {
" <l-interfaces/>" + EOL +
" <lag-interfaces/>" + EOL +
"</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC21&depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC21&depth=1"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
.withBody(body)));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721[?]depth=1"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
@@ -126,12 +127,12 @@ public class MockAAIGenericVnfSearch {
" <l-interfaces/>" + EOL +
" <lag-interfaces/>" + EOL +
"</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC20&depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/[?]vnf-name=STMTN5MMSC20&depth=1"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
.withBody(body)));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/2f6aee38-1e2a-11e6-82d1-ffc7d9ee8aa4[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/2f6aee38-1e2a-11e6-82d1-ffc7d9ee8aa4[?]depth=1"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
@@ -139,13 +140,13 @@ public class MockAAIGenericVnfSearch {
// The following stubs are for DeleteAAIVfModule
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c723[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c723[?]depth=1"))
.willReturn(aResponse()
.withStatus(500)
.withHeader("Content-Type", "text/xml")
.withBodyFile("aaiFault.xml")));
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c722[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c722[?]depth=1"))
.willReturn(aResponse()
.withStatus(404)
.withHeader("Content-Type", "text/xml")
@@ -178,7 +179,7 @@ public class MockAAIGenericVnfSearch {
" <l-interfaces/>" + EOL +
" <lag-interfaces/>" + EOL +
"</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721[?]depth=1"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
@@ -221,7 +222,7 @@ public class MockAAIGenericVnfSearch {
" <l-interfaces/>" + EOL +
" <lag-interfaces/>" + EOL +
"</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c720[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c720[?]depth=1"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
@@ -264,7 +265,7 @@ public class MockAAIGenericVnfSearch {
" <l-interfaces/>" + EOL +
" <lag-interfaces/>" + EOL +
"</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c719[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c719[?]depth=1"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
@@ -297,7 +298,7 @@ public class MockAAIGenericVnfSearch {
" <l-interfaces/>" + EOL +
" <lag-interfaces/>" + EOL +
"</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c718[?]depth=1"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c718[?]depth=1"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
@@ -330,7 +331,7 @@ public class MockAAIGenericVnfSearch {
" <l-interfaces/>" + EOL +
" <lag-interfaces/>" + EOL +
"</generic-vnf>" + EOL;
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721/vf-modules/vf-module/973ed047-d251-4fb9-bf1a-65b8949e0a73"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/a27ce5a9-29c4-4c22-a017-6615ac73c721/vf-modules/vf-module/973ed047-d251-4fb9-bf1a-65b8949e0a73"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingIT.java
index 0c88b58b72..4d7a127a85 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingIT.java
@@ -271,7 +271,7 @@ public class OofHomingIT extends BaseIntegrationTest {
@Test
public void testHoming_success_2AR1Vnf() throws Exception {
- mockOof();
+ mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -323,7 +323,7 @@ public class OofHomingIT extends BaseIntegrationTest {
@Test
public void testHoming_success_2AR1Vnf2Net() throws Exception {
- mockOof();
+ mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -398,7 +398,7 @@ public class OofHomingIT extends BaseIntegrationTest {
public void testHoming_success_vnfResourceList() throws Exception {
// Create a Service Decomposition
- MockGetServiceResourcesCatalogDataByModelUuid("2f7f309d-c842-4644-a2e4-34167be5eeb4",
+ MockGetServiceResourcesCatalogDataByModelUuid(wireMockServer, "2f7f309d-c842-4644-a2e4-34167be5eeb4",
"/BuildingBlocks/oofCatalogResp.json");
String busKey = UUID.randomUUID().toString();
Map<String, Object> vars = new HashMap<>();
@@ -413,7 +413,7 @@ public class OofHomingIT extends BaseIntegrationTest {
// Invoke Homing
- mockOof();
+ mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -479,7 +479,7 @@ public class OofHomingIT extends BaseIntegrationTest {
@Test
public void testHoming_success_existingLicense() throws Exception {
- mockOof();
+ mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<String, Object>();
@@ -549,7 +549,7 @@ public class OofHomingIT extends BaseIntegrationTest {
@Test
public void testHoming_error_badResponse() throws Exception {
- mockOof_500();
+ mockOof_500(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -568,7 +568,7 @@ public class OofHomingIT extends BaseIntegrationTest {
@Test
public void testHoming_error_oofNoSolution() throws Exception {
- mockOof();
+ mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -590,7 +590,7 @@ public class OofHomingIT extends BaseIntegrationTest {
@Test
public void testHoming_error_oofPolicyException() throws Exception {
- mockOof();
+ mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -613,7 +613,7 @@ public class OofHomingIT extends BaseIntegrationTest {
@Test
public void testHoming_error_oofServiceException() throws Exception {
- mockOof();
+ mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java
index b370e6c48f..390f5294aa 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java
@@ -279,7 +279,7 @@ public class OofHomingTestIT extends BaseIntegrationTest {
public void testHoming_success_2AR1Vnf() throws Exception {
- mockOof();
+ mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -332,7 +332,7 @@ public class OofHomingTestIT extends BaseIntegrationTest {
public void testHoming_success_2AR1Vnf2Net() throws Exception {
- mockOof();
+ mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -409,7 +409,7 @@ public class OofHomingTestIT extends BaseIntegrationTest {
public void testHoming_success_vnfResourceList() throws Exception {
// Create a Service Decomposition
- MockGetServiceResourcesCatalogDataByModelUuid("2f7f309d-c842-4644-a2e4-34167be5eeb4",
+ MockGetServiceResourcesCatalogDataByModelUuid(wireMockServer, "2f7f309d-c842-4644-a2e4-34167be5eeb4",
"/BuildingBlocks/oofCatalogResp.json");
String busKey = UUID.randomUUID().toString();
Map<String, Object> vars = new HashMap<>();
@@ -425,7 +425,7 @@ public class OofHomingTestIT extends BaseIntegrationTest {
// Invoke Homing
- mockOof();
+ mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -489,7 +489,7 @@ public class OofHomingTestIT extends BaseIntegrationTest {
@Test
public void testHoming_success_existingLicense() throws Exception {
- mockOof();
+ mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<String, Object>();
@@ -560,7 +560,7 @@ public class OofHomingTestIT extends BaseIntegrationTest {
@Test
public void testHoming_error_badResponse() throws Exception {
- mockOof_500();
+ mockOof_500(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -581,7 +581,7 @@ public class OofHomingTestIT extends BaseIntegrationTest {
@Test
public void testHoming_error_oofNoSolution() throws Exception {
- mockOof();
+ mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -604,7 +604,7 @@ public class OofHomingTestIT extends BaseIntegrationTest {
@Test
public void testHoming_error_oofPolicyException() throws Exception {
- mockOof();
+ mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -628,7 +628,7 @@ public class OofHomingTestIT extends BaseIntegrationTest {
@Test
public void testHoming_error_oofServiceException() throws Exception {
- mockOof();
+ mockOof(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/PrepareUpdateAAIVfModuleIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/PrepareUpdateAAIVfModuleIT.java
index 8b8abab6b2..c994173cd7 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/PrepareUpdateAAIVfModuleIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/PrepareUpdateAAIVfModuleIT.java
@@ -61,9 +61,9 @@ public class PrepareUpdateAAIVfModuleIT extends BaseIntegrationTest {
String prepareUpdateAAIVfModuleRequest = FileUtil.readResourceFile("__files/VfModularity/PrepareUpdateAAIVfModuleRequest.xml");
- MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
- MockPutGenericVnf("/skask/vf-modules/vf-module/supercool", "PCRF", 200);
- MockPatchVfModuleId("skask", "supercool");
+ MockGetGenericVnfByIdWithDepth(wireMockServer, "skask", 1, "VfModularity/GenericVnf.xml");
+ MockPutGenericVnf(wireMockServer, "/skask/vf-modules/vf-module/supercool", "PCRF", 200);
+ MockPatchVfModuleId(wireMockServer, "skask", "supercool");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -95,7 +95,7 @@ public class PrepareUpdateAAIVfModuleIT extends BaseIntegrationTest {
logStart();
String prepareUpdateAAIVfModuleRequest = FileUtil.readResourceFile("__files/VfModularity/PrepareUpdateAAIVfModuleRequest.xml");
- MockGetGenericVnfById_404("skask[?]depth=1");
+ MockGetGenericVnfById_404(wireMockServer, "skask[?]depth=1");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -128,7 +128,7 @@ public class PrepareUpdateAAIVfModuleIT extends BaseIntegrationTest {
String prepareUpdateAAIVfModuleRequest = FileUtil.readResourceFile("__files/VfModularity/PrepareUpdateAAIVfModuleRequest.xml").replaceFirst("supercool", "lukewarm");
- MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
+ MockGetGenericVnfByIdWithDepth(wireMockServer, "skask", 1, "VfModularity/GenericVnf.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -156,7 +156,7 @@ public class PrepareUpdateAAIVfModuleIT extends BaseIntegrationTest {
String prepareUpdateAAIVfModuleRequest = FileUtil.readResourceFile("__files/VfModularity/PrepareUpdateAAIVfModuleRequest.xml").replaceFirst("supercool", "notsocool");
- MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
+ MockGetGenericVnfByIdWithDepth(wireMockServer, "skask", 1, "VfModularity/GenericVnf.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -184,8 +184,8 @@ public class PrepareUpdateAAIVfModuleIT extends BaseIntegrationTest {
String prepareUpdateAAIVfModuleRequest = FileUtil.readResourceFile("__files/VfModularity/PrepareUpdateAAIVfModuleRequest.xml");
- MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
- MockAAIVfModuleBadPatch("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool", 404);
+ MockGetGenericVnfByIdWithDepth(wireMockServer, "skask", 1, "VfModularity/GenericVnf.xml");
+ MockAAIVfModuleBadPatch(wireMockServer, "/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool", 404);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/RainyDayHandlerIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/RainyDayHandlerIT.java
index 7b85edf49a..2f6d2ae85b 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/RainyDayHandlerIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/RainyDayHandlerIT.java
@@ -52,7 +52,7 @@ public class RainyDayHandlerIT extends BaseIntegrationTest {
variables.put("errorText", "update failed");
variables.put("vnfName", "vSAMP1");
- MockPolicyAbort();
+ MockPolicyAbort(wireMockServer);
String businessKey = UUID.randomUUID().toString();
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SDNCAdapterRestV2IT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SDNCAdapterRestV2IT.java
index 12e12dc7d6..bf3fefdf9c 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SDNCAdapterRestV2IT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SDNCAdapterRestV2IT.java
@@ -24,7 +24,6 @@ package org.onap.so.bpmn.common;
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;
import java.io.IOException;
@@ -115,7 +114,7 @@ public class SDNCAdapterRestV2IT extends BaseIntegrationTest {
* Defines WireMock stubs needed by these tests.
*/
private void mocks() {
- stubFor(post(urlEqualTo("/SDNCAdapter/v1/sdnc"))
+ wireMockServer.stubFor(post(urlEqualTo("/SDNCAdapter/v1/sdnc"))
.willReturn(aResponse()
.withStatus(202)
.withHeader("Content-Type", "application/json")));
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SniroHomingV1IT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SniroHomingV1IT.java
index 2205d01cca..c7ba702212 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SniroHomingV1IT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/SniroHomingV1IT.java
@@ -140,7 +140,7 @@ public class SniroHomingV1IT extends BaseIntegrationTest {
public void testHoming_success_2AR1Vnf() throws Exception {
- mockSNIRO();
+ mockSNIRO(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -184,7 +184,7 @@ public class SniroHomingV1IT extends BaseIntegrationTest {
public void testHoming_success_2AR1Vnf2Net() throws Exception {
- mockSNIRO();
+ mockSNIRO(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -239,7 +239,7 @@ public class SniroHomingV1IT extends BaseIntegrationTest {
public void testHoming_success_vnfResourceList() throws Exception {
// Create a Service Decomposition
- MockGetServiceResourcesCatalogDataByModelUuid("2f7f309d-c842-4644-a2e4-34167be5eeb4", "/BuildingBlocks/catalogResp.json");
+ MockGetServiceResourcesCatalogDataByModelUuid(wireMockServer, "2f7f309d-c842-4644-a2e4-34167be5eeb4", "/BuildingBlocks/catalogResp.json");
String busKey = UUID.randomUUID().toString();
Map<String, Object> vars = new HashMap<>();
setVariablesForServiceDecomposition(vars, "testRequestId123", "ff5256d2-5a33-55df-13ab-12abad84e7ff");
@@ -251,7 +251,7 @@ public class SniroHomingV1IT extends BaseIntegrationTest {
// Invoke Homing
- mockSNIRO();
+ mockSNIRO(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -290,7 +290,7 @@ public class SniroHomingV1IT extends BaseIntegrationTest {
public void testHoming_success_existingLicense() throws Exception {
- mockSNIRO();
+ mockSNIRO(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<String, Object>();
@@ -351,7 +351,7 @@ public class SniroHomingV1IT extends BaseIntegrationTest {
@Test
public void testHoming_error_badResponse() throws Exception {
- mockSNIRO_500();
+ mockSNIRO_500(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -371,7 +371,7 @@ public class SniroHomingV1IT extends BaseIntegrationTest {
// 1802 merge
public void testHoming_error_sniroNoSolution() throws Exception {
- mockSNIRO();
+ mockSNIRO(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -392,7 +392,7 @@ public class SniroHomingV1IT extends BaseIntegrationTest {
@Test
public void testHoming_error_sniroPolicyException() throws Exception {
- mockSNIRO();
+ mockSNIRO(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -413,7 +413,7 @@ public class SniroHomingV1IT extends BaseIntegrationTest {
@Test
public void testHoming_error_sniroServiceException() throws Exception {
- mockSNIRO();
+ mockSNIRO(wireMockServer);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIGenericVnfIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIGenericVnfIT.java
index 48790708f0..5015a1351a 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIGenericVnfIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIGenericVnfIT.java
@@ -62,9 +62,9 @@ public class UpdateAAIGenericVnfIT extends BaseIntegrationTest {
logStart();
String updateAAIGenericVnfRequest = FileUtil.readResourceFile("__files/VfModularity/UpdateAAIGenericVnfRequest.xml");
- MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
- MockPutGenericVnf("/skask", 200);
- MockPatchGenericVnf("skask");
+ MockGetGenericVnfByIdWithDepth(wireMockServer, "skask", 1, "VfModularity/GenericVnf.xml");
+ MockPutGenericVnf(wireMockServer, "/skask", 200);
+ MockPatchGenericVnf(wireMockServer, "skask");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -95,7 +95,7 @@ public class UpdateAAIGenericVnfIT extends BaseIntegrationTest {
String updateAAIGenericVnfRequest = FileUtil.readResourceFile("__files/VfModularity/UpdateAAIGenericVnfRequest.xml");
updateAAIGenericVnfRequest = updateAAIGenericVnfRequest.replaceFirst("introvert", "extrovert");
- MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
+ MockGetGenericVnfByIdWithDepth(wireMockServer, "skask", 1, "VfModularity/GenericVnf.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -123,7 +123,7 @@ public class UpdateAAIGenericVnfIT extends BaseIntegrationTest {
String updateAAIGenericVnfRequest = FileUtil.readResourceFile("__files/VfModularity/UpdateAAIGenericVnfRequest.xml");
- MockGetGenericVnfById_404("skask[?]depth=1");
+ MockGetGenericVnfById_404(wireMockServer, "skask[?]depth=1");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -153,9 +153,9 @@ public class UpdateAAIGenericVnfIT extends BaseIntegrationTest {
String updateAAIGenericVnfRequest = FileUtil.readResourceFile("__files/VfModularity/UpdateAAIGenericVnfRequest.xml");
- MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
- MockPutGenericVnf_Bad("skask", 404);
- MockAAIVfModuleBadPatch("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask", 404);
+ MockGetGenericVnfByIdWithDepth(wireMockServer, "skask", 1, "VfModularity/GenericVnf.xml");
+ MockPutGenericVnf_Bad(wireMockServer, "skask", 404);
+ MockAAIVfModuleBadPatch(wireMockServer, "/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask", 404);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIVfModuleIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIVfModuleIT.java
index 2ba5c7286e..0a3931a12f 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIVfModuleIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/UpdateAAIVfModuleIT.java
@@ -61,9 +61,9 @@ public class UpdateAAIVfModuleIT extends BaseIntegrationTest {
logStart();
String updateAAIVfModuleRequest = FileUtil.readResourceFile("__files/VfModularity/UpdateAAIVfModuleRequest.xml");
- MockGetGenericVnfByIdWithPriority("/skask/vf-modules/vf-module/supercool", 200, "VfModularity/VfModule-supercool.xml");
- MockPutGenericVnf("/skask/vf-modules/vf-module/supercool", "PCRF", 200);
- MockPatchVfModuleId("skask", "supercool");
+ MockGetGenericVnfByIdWithPriority(wireMockServer, "/skask/vf-modules/vf-module/supercool", 200, "VfModularity/VfModule-supercool.xml");
+ MockPutGenericVnf(wireMockServer, "/skask/vf-modules/vf-module/supercool", "PCRF", 200);
+ MockPatchVfModuleId(wireMockServer, "skask", "supercool");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -92,7 +92,7 @@ public class UpdateAAIVfModuleIT extends BaseIntegrationTest {
logStart();
String updateAAIVfModuleRequest = FileUtil.readResourceFile("__files/VfModularity/UpdateAAIVfModuleRequest.xml");
- MockGetGenericVnfById("/skask/vf-modules/vf-module/.*", "VfModularity/VfModule-supercool.xml", 404);
+ MockGetGenericVnfById(wireMockServer, "/skask/vf-modules/vf-module/.*", "VfModularity/VfModule-supercool.xml", 404);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -121,9 +121,9 @@ public class UpdateAAIVfModuleIT extends BaseIntegrationTest {
logStart();
String updateAAIVfModuleRequest = FileUtil.readResourceFile("__files/VfModularity/UpdateAAIVfModuleRequest.xml");
- MockGetGenericVnfById_404("/skask/vf-modules/vf-module/supercool");
- MockGetGenericVnfById("/skask/vf-modules/vf-module/supercool", "VfModularity/VfModule-supercool.xml", 200);
- MockAAIVfModuleBadPatch("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool", 404);
+ MockGetGenericVnfById_404(wireMockServer, "/skask/vf-modules/vf-module/supercool");
+ MockGetGenericVnfById(wireMockServer, "/skask/vf-modules/vf-module/supercool", "VfModularity/VfModule-supercool.xml", 200);
+ MockAAIVfModuleBadPatch(wireMockServer, "/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool", 404);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/VnfAdapterRestV1IT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/VnfAdapterRestV1IT.java
index 1ef864b543..c0482a52ca 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/VnfAdapterRestV1IT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/VnfAdapterRestV1IT.java
@@ -247,7 +247,7 @@ public class VnfAdapterRestV1IT extends BaseIntegrationTest {
public void testCreateVfModuleSuccess() throws Exception {
logStart();
- mockVNFPost("", 202, "vnfId");
+ mockVNFPost(wireMockServer, "", 202, "vnfId");
String requestId = "dffbae0e-5588-4bd6-9749-b0f0adb52312";
String messageId = requestId + "-" + System.currentTimeMillis();
@@ -276,7 +276,7 @@ public class VnfAdapterRestV1IT extends BaseIntegrationTest {
public void testUpdateVfModuleSuccess() throws Exception {
logStart();
- mockVNFPut("/vfModuleId", 202);
+ mockVNFPut(wireMockServer, "/vfModuleId", 202);
String requestId = "dffbae0e-5588-4bd6-9749-b0f0adb52312";
String messageId = requestId + "-" + System.currentTimeMillis();
@@ -305,7 +305,7 @@ public class VnfAdapterRestV1IT extends BaseIntegrationTest {
public void testDeleteVfModuleSuccess() throws Exception {
logStart();
- mockVNFDelete("vnfId", "/vfModuleId", 202);
+ mockVNFDelete(wireMockServer, "vnfId", "/vfModuleId", 202);
String requestId = "dffbae0e-5588-4bd6-9749-b0f0adb52312";
String messageId = requestId + "-" + System.currentTimeMillis();
@@ -334,7 +334,7 @@ public class VnfAdapterRestV1IT extends BaseIntegrationTest {
public void testRollbackVfModuleSuccess() throws Exception {
logStart();
- mockVNFRollbackDelete("/vfModuleId", 202);
+ mockVNFRollbackDelete(wireMockServer, "/vfModuleId", 202);
String requestId = "dffbae0e-5588-4bd6-9749-b0f0adb52312";
String messageId = requestId + "-" + System.currentTimeMillis();
@@ -363,7 +363,7 @@ public class VnfAdapterRestV1IT extends BaseIntegrationTest {
public void testCreateVfModuleException() throws Exception {
logStart();
- mockVNFPost("", 202, "vnfId");
+ mockVNFPost(wireMockServer, "", 202, "vnfId");
String requestId = "dffbae0e-5588-4bd6-9749-b0f0adb52312";
String messageId = requestId + "-" + System.currentTimeMillis();
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/CreateVcpeResCustServiceIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/CreateVcpeResCustServiceIT.java
index 610930665c..aa65474acc 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/CreateVcpeResCustServiceIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/CreateVcpeResCustServiceIT.java
@@ -24,7 +24,6 @@ import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
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.put;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -101,43 +100,43 @@ public class CreateVcpeResCustServiceIT extends AbstractTestBase {
@Test
public void testCreateVcpeResCustService_Success() throws Exception {
System.out.println("starting: testCreateVcpeResCustService_Success\n");
- MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2","VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
- MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
- MockGetCustomer(CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml");
- StubResponseOof.mockOof();
+ MockGetServiceResourcesCatalogData(wireMockServer, "uuid-miu-svc-011-abcdef", "2","VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
+ MockGetServiceResourcesCatalogData(wireMockServer, "uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
+ MockGetCustomer(wireMockServer, CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml");
+ StubResponseOof.mockOof(wireMockServer);
// TODO: the SI should NOT have to be URL-encoded yet again!
- MockPutServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
- MockGetServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
+ MockPutServiceInstance(wireMockServer, CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
- MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");
- MockNodeQueryServiceInstanceById(PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
- MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
- MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
- MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
- MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
- MockGetGenericVnfByIdWithDepth(".*", 1, "VCPE/CreateVcpeResCustService/GenericVnf.xml");
-
- MockPutGenericVnf(".*");
- MockPatchGenericVnf(".*");
-
- MockGetGenericVnfByIdWithPriority(".*", ".*", 200, "VfModularity/VfModule-new.xml", 5);
- // MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
- MockPutVfModuleIdNoResponse(".*", "PCRF", ".*");
- MockPutNetwork(".*", "VfModularity/AddNetworkPolicy_AAIResponse_Success.xml", 200);
-
- MockGetNetworkPolicyfqdn(".*","CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml",200);
- MockNodeQueryServiceInstanceByName_404(".*");
-
- mockVNFPost("", 202, ".*");
-
- stubFor(post(urlMatching("/services/rest/v1/vnfs" + ".*" + "/vf-modules" )).willReturn(aResponse().withStatus(202)));
- stubFor(get(urlMatching(".*/business/owning-entities?.*")).willReturn(aResponse().withStatus(404)));
- stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/.*")).willReturn(aResponse().withStatus(200)));
- stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/038d99af-0427-42c2-9d15-971b99b9b489/relationship-list/relationship")).willReturn(aResponse().withStatus(200)));
- stubFor(put(urlMatching(".*/query?.*")).willReturn(aResponse().withStatus(200)));
- MockPostRequestDB();
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
- mockSDNCAdapter(200);
+ MockNodeQueryServiceInstanceById(wireMockServer, INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ MockGetGenericVnfByIdWithDepth(wireMockServer, ".*", 1, "VCPE/CreateVcpeResCustService/GenericVnf.xml");
+
+ MockPutGenericVnf(wireMockServer, ".*");
+ MockPatchGenericVnf(wireMockServer, ".*");
+
+ MockGetGenericVnfByIdWithPriority(wireMockServer, ".*", ".*", 200, "VfModularity/VfModule-new.xml", 5);
+ // MockGetGenericVnfByIdWithDepth(wireMockServer, "skask", 1, "VfModularity/GenericVnf.xml");
+ MockPutVfModuleIdNoResponse(wireMockServer, ".*", "PCRF", ".*");
+ MockPutNetwork(wireMockServer, ".*", "VfModularity/AddNetworkPolicy_AAIResponse_Success.xml", 200);
+
+ MockGetNetworkPolicyfqdn(wireMockServer, ".*","CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml",200);
+ MockNodeQueryServiceInstanceByName_404(wireMockServer, ".*");
+
+ mockVNFPost(wireMockServer, "", 202, ".*");
+
+ wireMockServer.stubFor(post(urlMatching("/services/rest/v1/vnfs" + ".*" + "/vf-modules" )).willReturn(aResponse().withStatus(202)));
+ wireMockServer.stubFor(get(urlMatching(".*/business/owning-entities?.*")).willReturn(aResponse().withStatus(404)));
+ wireMockServer.stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/.*")).willReturn(aResponse().withStatus(200)));
+ wireMockServer.stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/038d99af-0427-42c2-9d15-971b99b9b489/relationship-list/relationship")).willReturn(aResponse().withStatus(200)));
+ wireMockServer.stubFor(put(urlMatching(".*/query?.*")).willReturn(aResponse().withStatus(200)));
+ MockPostRequestDB(wireMockServer);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
+ mockSDNCAdapter(wireMockServer, 200);
Map<String, Object> variables = setupVariables();
@@ -195,33 +194,33 @@ public class CreateVcpeResCustServiceIT extends AbstractTestBase {
@Test
public void testCreateVcpeResCustService_NoParts() throws Exception {
System.out.println("starting: testCreateVcpeResCustService_NoParts\n" );
- MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesNoData.json");
- MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesNoData.json");
- MockGetCustomer(CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml");
+ MockGetServiceResourcesCatalogData(wireMockServer, "uuid-miu-svc-011-abcdef", "2", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesNoData.json");
+ MockGetServiceResourcesCatalogData(wireMockServer, "uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesNoData.json");
+ MockGetCustomer(wireMockServer, CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml");
// TODO: the SI should NOT have to be URL-encoded yet again!
- MockPutServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
- MockGetServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
+ MockPutServiceInstance(wireMockServer, CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
- MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");
- MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
- MockNodeQueryServiceInstanceById(PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
- MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, INST, "GenericFlows/getSIUrlById.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
// TODO: should these really be PARENT_INST, or should they be INST?
- MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
- MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
-
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
-
- StubResponseOof.mockOof();
- stubFor(get(urlMatching(".*/business/owning-entities?.*")).willReturn(aResponse().withStatus(404)));
- stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/.*")).willReturn(aResponse().withStatus(200)));
- stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/038d99af-0427-42c2-9d15-971b99b9b489/relationship-list/relationship")).willReturn(aResponse().withStatus(200)));
- stubFor(put(urlMatching(".*/query?.*")).willReturn(aResponse().withStatus(200)));
- MockPostRequestDB();
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockPutAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
+
+ StubResponseOof.mockOof(wireMockServer);
+ wireMockServer.stubFor(get(urlMatching(".*/business/owning-entities?.*")).willReturn(aResponse().withStatus(404)));
+ wireMockServer.stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/.*")).willReturn(aResponse().withStatus(200)));
+ wireMockServer.stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/038d99af-0427-42c2-9d15-971b99b9b489/relationship-list/relationship")).willReturn(aResponse().withStatus(200)));
+ wireMockServer.stubFor(put(urlMatching(".*/query?.*")).willReturn(aResponse().withStatus(200)));
+ MockPostRequestDB(wireMockServer);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
Map<String, Object> variables = setupVariables();
@@ -253,30 +252,30 @@ public class CreateVcpeResCustServiceIT extends AbstractTestBase {
@Test
public void testCreateVcpeResCustService_Fault_NoRollback() throws Exception {
System.out.println("starting: testCreateVcpeResCustService_Fault_NoRollback\n");
- MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
- MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
- MockGetCustomer(CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml");
+ MockGetServiceResourcesCatalogData(wireMockServer, "uuid-miu-svc-011-abcdef", "2", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
+ MockGetServiceResourcesCatalogData(wireMockServer, "uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
+ MockGetCustomer(wireMockServer, CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml");
// TODO: the SI should NOT have to be URL-encoded yet again!
- MockPutServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
- MockGetServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
+ MockPutServiceInstance(wireMockServer, CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
- MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");
- MockNodeQueryServiceInstanceById(PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
- MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
- MockGetServiceInstance_500(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
- MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
- MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
-
- mockSDNCAdapter(404);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
-
- StubResponseOof.mockOof();
- stubFor(get(urlMatching(".*/business/owning-entities?.*")).willReturn(aResponse().withStatus(404)));
- stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/.*")).willReturn(aResponse().withStatus(200)));
- stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/038d99af-0427-42c2-9d15-971b99b9b489/relationship-list/relationship")).willReturn(aResponse().withStatus(200)));
- stubFor(put(urlMatching(".*/query?.*")).willReturn(aResponse().withStatus(200)));
- MockPostRequestDB();
+ MockNodeQueryServiceInstanceById(wireMockServer, INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance_500(wireMockServer, CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+
+ mockSDNCAdapter(wireMockServer, 404);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
+
+ StubResponseOof.mockOof(wireMockServer);
+ wireMockServer.stubFor(get(urlMatching(".*/business/owning-entities?.*")).willReturn(aResponse().withStatus(404)));
+ wireMockServer.stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/.*")).willReturn(aResponse().withStatus(200)));
+ wireMockServer.stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/038d99af-0427-42c2-9d15-971b99b9b489/relationship-list/relationship")).willReturn(aResponse().withStatus(200)));
+ wireMockServer.stubFor(put(urlMatching(".*/query?.*")).willReturn(aResponse().withStatus(200)));
+ MockPostRequestDB(wireMockServer);
Map<String, Object> variables = setupVariables();
@@ -305,33 +304,33 @@ public class CreateVcpeResCustServiceIT extends AbstractTestBase {
@Test
public void testCreateVcpeResCustService_Fault_Rollback() throws Exception {
System.out.println("starting: testCreateVcpeResCustService_Fault_Rollback\n");
- MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
- MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
- MockGetCustomer(CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml");
+ MockGetServiceResourcesCatalogData(wireMockServer, "uuid-miu-svc-011-abcdef", "2", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
+ MockGetServiceResourcesCatalogData(wireMockServer, "uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
+ MockGetCustomer(wireMockServer, CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml");
// TODO: the SI should NOT have to be URL-encoded yet again!
- MockPutServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
- MockGetServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
+ MockPutServiceInstance(wireMockServer, CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
- MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");
- MockNodeQueryServiceInstanceById(PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
- MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
- MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/CreateVcpeResCustService/arGetById.xml");
- MockGetAllottedResource(CUST, SVC, PARENT_INST, ARID, "VCPE/CreateVcpeResCustService/arGetById.xml");
- MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
- MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, PARENT_INST, ARID, ARVERS);
-
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
-
- StubResponseOof.mockOof();
- stubFor(get(urlMatching(".*/business/owning-entities?.*")).willReturn(aResponse().withStatus(404)));
- stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/.*")).willReturn(aResponse().withStatus(200)));
- stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/038d99af-0427-42c2-9d15-971b99b9b489/relationship-list/relationship")).willReturn(aResponse().withStatus(200)));
- stubFor(put(urlMatching(".*/query?.*")).willReturn(aResponse().withStatus(200)));
- MockPostRequestDB();
+ MockNodeQueryServiceInstanceById(wireMockServer, INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/CreateVcpeResCustService/arGetById.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID, "VCPE/CreateVcpeResCustService/arGetById.xml");
+ MockPutAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID, ARVERS);
+
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
+
+ StubResponseOof.mockOof(wireMockServer);
+ wireMockServer.stubFor(get(urlMatching(".*/business/owning-entities?.*")).willReturn(aResponse().withStatus(404)));
+ wireMockServer.stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/.*")).willReturn(aResponse().withStatus(200)));
+ wireMockServer.stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/038d99af-0427-42c2-9d15-971b99b9b489/relationship-list/relationship")).willReturn(aResponse().withStatus(200)));
+ wireMockServer.stubFor(put(urlMatching(".*/query?.*")).willReturn(aResponse().withStatus(200)));
+ MockPostRequestDB(wireMockServer);
String req = FileUtil.readResourceFile("__files/VCPE/CreateVcpeResCustService/requestRollback.json");
Map<String, Object> variables = setupVariables();
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DeleteVcpeResCustServiceIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DeleteVcpeResCustServiceIT.java
index ca81d99832..aaabf59e6b 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DeleteVcpeResCustServiceIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DeleteVcpeResCustServiceIT.java
@@ -20,22 +20,9 @@
package org.onap.so.bpmn.vcpe;
-import com.github.tomakehurst.wiremock.stubbing.Scenario;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.so.bpmn.common.BPMNUtil;
-import org.onap.so.bpmn.mock.FileUtil;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
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.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -51,6 +38,19 @@ import static org.onap.so.bpmn.mock.StubResponseAAI.MockQueryAllottedResourceByI
import static org.onap.so.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
import static org.onap.so.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BPMNUtil;
+import org.onap.so.bpmn.mock.FileUtil;
+
+import com.github.tomakehurst.wiremock.stubbing.Scenario;
+
public class DeleteVcpeResCustServiceIT extends AbstractTestBase {
private static final String PROCNAME = "DeleteVcpeResCustService";
@@ -77,7 +77,7 @@ public class DeleteVcpeResCustServiceIT extends AbstractTestBase {
@Test
public void testDeleteVcpeResCustService_Success() throws Exception {
logStart();
- MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, INST, "GenericFlows/getSIUrlById.xml");
// TODO: use INST instead of DEC_INST
/*
@@ -85,15 +85,15 @@ public class DeleteVcpeResCustServiceIT extends AbstractTestBase {
* fail to URL-encode the SI id before performing the query so we'll
* add a stub for that case, too.
*/
- MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_INST, "GenericFlows/getSIUrlById.xml");
/*
- * cannot use MockGetServiceInstance(), because we need to return
+ * cannot use MockGetServiceInstance(wireMockServer, ), because we need to return
* different responses as we traverse through the flow
*/
// initially, the SI includes the ARs
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + CUST + "/service-subscriptions/service-subscription/" + SVC + "/service-instances/service-instance/" + INST))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + CUST + "/service-subscriptions/service-subscription/" + SVC + "/service-instances/service-instance/" + INST))
.inScenario("SI retrieval")
.whenScenarioStateIs(Scenario.STARTED)
.willReturn(aResponse()
@@ -103,7 +103,7 @@ public class DeleteVcpeResCustServiceIT extends AbstractTestBase {
.willSetStateTo("ARs Deleted"));
// once the ARs have been deleted, the SI should be empty
- stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + CUST + "/service-subscriptions/service-subscription/" + SVC + "/service-instances/service-instance/" + INST))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + CUST + "/service-subscriptions/service-subscription/" + SVC + "/service-instances/service-instance/" + INST))
.inScenario("SI retrieval")
.whenScenarioStateIs("ARs Deleted")
.willReturn(aResponse()
@@ -112,34 +112,34 @@ public class DeleteVcpeResCustServiceIT extends AbstractTestBase {
.withBodyFile("VCPE/DeleteVcpeResCustService/getSIAfterDelArs.xml")));
// for BRG
- MockQueryAllottedResourceById(AR_BRG_ID, "VCPE/DeleteVcpeResCustService/getBRGArUrlById.xml");
- MockGetAllottedResource(CUST, SVC, INST, AR_BRG_ID, "VCPE/DeleteVcpeResCustService/arGetBRGById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, AR_BRG_ID);
- MockDeleteAllottedResource(CUST, SVC, INST, AR_BRG_ID, ARVERS);
+ MockQueryAllottedResourceById(wireMockServer, AR_BRG_ID, "VCPE/DeleteVcpeResCustService/getBRGArUrlById.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, AR_BRG_ID, "VCPE/DeleteVcpeResCustService/arGetBRGById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, AR_BRG_ID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, AR_BRG_ID, ARVERS);
// for TXC
- MockQueryAllottedResourceById(AR_TXC_ID, "VCPE/DeleteVcpeResCustService/getTXCArUrlById.xml");
- MockGetAllottedResource(CUST, SVC, INST, AR_TXC_ID, "VCPE/DeleteVcpeResCustService/arGetTXCById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, AR_TXC_ID);
- MockDeleteAllottedResource(CUST, SVC, INST, AR_TXC_ID, ARVERS);
+ MockQueryAllottedResourceById(wireMockServer, AR_TXC_ID, "VCPE/DeleteVcpeResCustService/getTXCArUrlById.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, AR_TXC_ID, "VCPE/DeleteVcpeResCustService/arGetTXCById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, AR_TXC_ID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, AR_TXC_ID, ARVERS);
//MockGetGenericVnfById("vnfX.*", "GenericFlows/getGenericVnfByNameResponse.xml");
- stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*"))
+ wireMockServer.stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/xml")
.withBodyFile("GenericFlows/getGenericVnfByNameResponse.xml")));
- stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*"))
+ wireMockServer.stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/.*"))
.willReturn(aResponse()
.withStatus(204)
.withHeader("Content-Type", "text/xml")));
- MockDeleteServiceInstance(CUST,SVC,INST,SVC);
+ MockDeleteServiceInstance(wireMockServer, CUST,SVC,INST,SVC);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = setupVariables(businessKey);
@@ -193,7 +193,7 @@ public class DeleteVcpeResCustServiceIT extends AbstractTestBase {
@Test
public void testDeleteVcpeResCustService_NoBRG_NoTXC_NoVNF() throws Exception {
logStart();
- MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, INST, "GenericFlows/getSIUrlById.xml");
// TODO: use INST instead of DEC_INST
/*
@@ -201,12 +201,12 @@ public class DeleteVcpeResCustServiceIT extends AbstractTestBase {
* fail to URL-encode the SI id before performing the query so we'll
* add a stub for that case, too.
*/
- MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_INST, "GenericFlows/getSIUrlById.xml");
- MockGetServiceInstance(CUST, SVC, INST, "VCPE/DeleteVcpeResCustService/getSIAfterDelArs.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST, "VCPE/DeleteVcpeResCustService/getSIAfterDelArs.xml");
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = setupVariables(businessKey);
@@ -242,7 +242,7 @@ public class DeleteVcpeResCustServiceIT extends AbstractTestBase {
@Test
public void testDeleteVcpeResCustService_Fault() throws Exception {
logStart();
- MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, INST, "GenericFlows/getSIUrlById.xml");
// TODO: use INST instead of DEC_INST
/*
@@ -250,14 +250,14 @@ public class DeleteVcpeResCustServiceIT extends AbstractTestBase {
* fail to URL-encode the SI id before performing the query so we'll
* add a stub for that case, too.
*/
- MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_INST, "GenericFlows/getSIUrlById.xml");
- MockGetServiceInstance(CUST, SVC, INST, "VCPE/DeleteVcpeResCustService/getSIAfterDelArs.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST, "VCPE/DeleteVcpeResCustService/getSIAfterDelArs.xml");
// generate failure
- mockSDNCAdapter(404);
+ mockSDNCAdapter(wireMockServer, 404);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = setupVariables(businessKey);
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceBRGIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceBRGIT.java
index 2b1b5a3bd0..da9b45c8c8 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceBRGIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceBRGIT.java
@@ -60,15 +60,15 @@ public class DoCreateAllottedResourceBRGIT extends AbstractTestBase {
* have a bug in that they don't URL-encode the SI id before using
* it in the query
*/
- MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
- MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
- MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
- MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
- MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
- MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables,"testRequestId123");
@@ -99,15 +99,15 @@ public class DoCreateAllottedResourceBRGIT extends AbstractTestBase {
* have a bug in that they don't URL-encode the SI id before using
* it in the query
*/
- MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getNotFound.xml");
- MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
-
- MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
- MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
- MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
- MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_INST, "GenericFlows/getNotFound.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables,"testRequestId124");
@@ -133,16 +133,16 @@ public class DoCreateAllottedResourceBRGIT extends AbstractTestBase {
* have a bug in that they don't URL-encode the SI id before using
* it in the query
*/
- MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
- MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
- MockGetServiceInstance(CUST, SVC, INST, "VCPE/DoCreateAllottedResourceBRG/getSIandAR.xml");
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg2.xml");
- MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
- MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
- MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST, "VCPE/DoCreateAllottedResourceBRG/getSIandAR.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg2.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables,"testRequestId125");
@@ -174,15 +174,15 @@ public class DoCreateAllottedResourceBRGIT extends AbstractTestBase {
* have a bug in that they don't URL-encode the SI id before using
* it in the query
*/
- MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
- MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getNotFound.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_PARENT_INST, "GenericFlows/getNotFound.xml");
- MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
- MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
- MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
- MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables,"testRequestId126");
@@ -208,15 +208,15 @@ public class DoCreateAllottedResourceBRGIT extends AbstractTestBase {
* have a bug in that they don't URL-encode the SI id before using
* it in the query
*/
- MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
- MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
- MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
- MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
- MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
- MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
- mockSDNCAdapter(404);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(wireMockServer, 404);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables,"testRequestId127");
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackIT.java
index a19dec1f98..f0d275c5cc 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceBRGRollbackIT.java
@@ -56,11 +56,11 @@ public class DoCreateAllottedResourceBRGRollbackIT extends AbstractTestBase {
@Test
public void testDoCreateAllottedResourceBRGRollback_Success() throws Exception {
logStart();
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -86,11 +86,11 @@ public class DoCreateAllottedResourceBRGRollbackIT extends AbstractTestBase {
@Test
public void testDoCreateAllottedResourceBRGRollback_skipRollback() throws Exception {
logStart();
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -115,9 +115,9 @@ public class DoCreateAllottedResourceBRGRollbackIT extends AbstractTestBase {
@Test
public void testDoCreateAllottedResourceBRGRollback_DoNotRollBack() throws Exception {
logStart();
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -142,11 +142,11 @@ public class DoCreateAllottedResourceBRGRollbackIT extends AbstractTestBase {
@Test
public void testDoCreateAllottedResourceBRGRollback_NoDeactivate() throws Exception {
logStart();
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -173,11 +173,11 @@ public class DoCreateAllottedResourceBRGRollbackIT extends AbstractTestBase {
@Test
public void testDoCreateAllottedResourceBRGRollback_NoDelete() throws Exception {
logStart();
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -204,11 +204,11 @@ public class DoCreateAllottedResourceBRGRollbackIT extends AbstractTestBase {
@Test
public void testDoCreateAllottedResourceBRGRollback_NoUnassign() throws Exception {
logStart();
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -238,12 +238,12 @@ public class DoCreateAllottedResourceBRGRollbackIT extends AbstractTestBase {
@Test
public void testDoCreateAllottedResourceBRGRollback_SubProcessError() throws Exception {
logStart();
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
- mockSDNCAdapter(404);
+ mockSDNCAdapter(wireMockServer, 404);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -265,11 +265,11 @@ public class DoCreateAllottedResourceBRGRollbackIT extends AbstractTestBase {
@Test
public void testDoCreateAllottedResourceBRGRollback_JavaException() throws Exception {
logStart();
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceTXCIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceTXCIT.java
index 473661c860..6ecec3240d 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceTXCIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceTXCIT.java
@@ -65,15 +65,15 @@ public class DoCreateAllottedResourceTXCIT extends AbstractTestBase {
* have a bug in that they don't URL-encode the SI id before using
* it in the query
*/
- MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
- MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
- MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
- MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
- MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
- MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables, "testRequestId123");
@@ -108,15 +108,15 @@ public class DoCreateAllottedResourceTXCIT extends AbstractTestBase {
* have a bug in that they don't URL-encode the SI id before using
* it in the query
*/
- MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getNotFound.xml");
- MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_INST, "GenericFlows/getNotFound.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
- MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
- MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
- MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
- MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables, "testRequestId123");
@@ -142,16 +142,16 @@ public class DoCreateAllottedResourceTXCIT extends AbstractTestBase {
* have a bug in that they don't URL-encode the SI id before using
* it in the query
*/
- MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
- MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
- MockGetServiceInstance(CUST, SVC, INST, "VCPE/DoCreateAllottedResourceTXC/getSIandAR.xml");
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc2.xml");
- MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
- MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
- MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST, "VCPE/DoCreateAllottedResourceTXC/getSIandAR.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc2.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables, "testRequestId123");
@@ -184,16 +184,16 @@ public class DoCreateAllottedResourceTXCIT extends AbstractTestBase {
* have a bug in that they don't URL-encode the SI id before using
* it in the query
*/
- MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_INST, "GenericFlows/getSIUrlById.xml");
- MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getNotFound.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_PARENT_INST, "GenericFlows/getNotFound.xml");
- MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
- MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
- MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
- MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables, "testRequestId123");
@@ -219,15 +219,15 @@ public class DoCreateAllottedResourceTXCIT extends AbstractTestBase {
* have a bug in that they don't URL-encode the SI id before using
* it in the query
*/
- MockNodeQueryServiceInstanceById(DEC_INST, "GenericFlows/getSIUrlById.xml");
- MockNodeQueryServiceInstanceById(DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_INST, "GenericFlows/getSIUrlById.xml");
+ MockNodeQueryServiceInstanceById(wireMockServer, DEC_PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
- MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
- MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
- MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
- MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
- mockSDNCAdapter(404);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
+ MockGetServiceInstance(wireMockServer, CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
+ MockPutAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, PARENT_INST, ARID);
+ mockSDNCAdapter(wireMockServer, 404);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables, "testRequestId123");
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackIT.java
index 8b47174b3b..4f81a4f725 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoCreateAllottedResourceTXCRollbackIT.java
@@ -56,11 +56,11 @@ public class DoCreateAllottedResourceTXCRollbackIT extends AbstractTestBase {
@Test
public void testDoCreateAllottedResourceTXCRollback_Success() throws Exception {
logStart();
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -86,11 +86,11 @@ public class DoCreateAllottedResourceTXCRollbackIT extends AbstractTestBase {
@Test
public void testDoCreateAllottedResourceTXCRollback_skipRollback() throws Exception {
logStart();
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -115,9 +115,9 @@ public class DoCreateAllottedResourceTXCRollbackIT extends AbstractTestBase {
@Test
public void testDoCreateAllottedResourceTXCRollback_DoNotRollBack() throws Exception {
logStart();
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -142,11 +142,11 @@ public class DoCreateAllottedResourceTXCRollbackIT extends AbstractTestBase {
@Test
public void testDoCreateAllottedResourceTXCRollback_NoDeactivate() throws Exception {
logStart();
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -173,11 +173,11 @@ public class DoCreateAllottedResourceTXCRollbackIT extends AbstractTestBase {
@Test
public void testDoCreateAllottedResourceTXCRollback_NoDelete() throws Exception {
logStart();
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -204,11 +204,11 @@ public class DoCreateAllottedResourceTXCRollbackIT extends AbstractTestBase {
@Test
public void testDoCreateAllottedResourceTXCRollback_NoUnassign() throws Exception {
logStart();
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -238,12 +238,12 @@ public class DoCreateAllottedResourceTXCRollbackIT extends AbstractTestBase {
@Test
public void testDoCreateAllottedResourceTXCRollback_SubProcessError() throws Exception {
logStart();
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
- mockSDNCAdapter(404);
+ mockSDNCAdapter(wireMockServer, 404);
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -265,11 +265,11 @@ public class DoCreateAllottedResourceTXCRollbackIT extends AbstractTestBase {
@Test
public void testDoCreateAllottedResourceTXCRollback_JavaException() throws Exception {
logStart();
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoDeleteAllottedResourceBRGIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoDeleteAllottedResourceBRGIT.java
index 4edaf7d21f..42f32b8ecc 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoDeleteAllottedResourceBRGIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoDeleteAllottedResourceBRGIT.java
@@ -50,12 +50,12 @@ public class DoDeleteAllottedResourceBRGIT extends AbstractTestBase {
@Test
public void testDoDeleteAllottedResourceBRG_Success() {
logStart();
- MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml");
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockQueryAllottedResourceById(wireMockServer, ARID, "GenericFlows/getARUrlById.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -79,12 +79,12 @@ public class DoDeleteAllottedResourceBRGIT extends AbstractTestBase {
@Test
public void testDoDeleteAllottedResourceBRG_ARNotInSDNC() {
logStart();
- MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml");
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockQueryAllottedResourceById(wireMockServer, ARID, "GenericFlows/getARUrlById.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
String businessKey = UUID.randomUUID().toString();
Map<String, Object> variables = new HashMap<>();
@@ -109,13 +109,13 @@ public class DoDeleteAllottedResourceBRGIT extends AbstractTestBase {
@Test
public void testDoDeleteAllottedResourceBRG_SubProcessError() throws Exception {
logStart();
- MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml");
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockQueryAllottedResourceById(wireMockServer, ARID, "GenericFlows/getARUrlById.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
- mockSDNCAdapter(500);
+ mockSDNCAdapter(wireMockServer, 500);
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables);
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoDeleteAllottedResourceTXCIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoDeleteAllottedResourceTXCIT.java
index 520beaf07b..13ca58be03 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoDeleteAllottedResourceTXCIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/vcpe/DoDeleteAllottedResourceTXCIT.java
@@ -50,12 +50,12 @@ public class DoDeleteAllottedResourceTXCIT extends AbstractTestBase {
@Test
public void testDoDeleteAllottedResourceTXC_Success() throws Exception {
logStart();
- MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml");
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockQueryAllottedResourceById(wireMockServer, ARID, "GenericFlows/getARUrlById.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables);
@@ -78,12 +78,12 @@ public class DoDeleteAllottedResourceTXCIT extends AbstractTestBase {
@Test
public void testDoDeleteAllottedResourceTXC_ARNotInSDNC() throws Exception {
logStart();
- MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml");
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockSDNCAdapter(200);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockQueryAllottedResourceById(wireMockServer, ARID, "GenericFlows/getARUrlById.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockSDNCAdapter(wireMockServer, 200);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables);
@@ -104,13 +104,13 @@ public class DoDeleteAllottedResourceTXCIT extends AbstractTestBase {
@Test
public void testDoDeleteAllottedResourceTXC_SubProcessError() throws Exception {
logStart();
- MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml");
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml");
- MockPatchAllottedResource(CUST, SVC, INST, ARID);
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, ARVERS);
- mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
+ MockQueryAllottedResourceById(wireMockServer, ARID, "GenericFlows/getARUrlById.xml");
+ MockGetAllottedResource(wireMockServer, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml");
+ MockPatchAllottedResource(wireMockServer, CUST, SVC, INST, ARID);
+ MockDeleteAllottedResource(wireMockServer, CUST, SVC, INST, ARID, ARVERS);
+ mockUpdateRequestDB(wireMockServer, 200, "Database/DBUpdateResponse.xml");
- mockSDNCAdapter(500);
+ mockSDNCAdapter(wireMockServer, 500);
Map<String, Object> variables = new HashMap<>();
setVariablesSuccess(variables);
diff --git a/bpmn/so-bpmn-building-blocks/pom.xml b/bpmn/so-bpmn-building-blocks/pom.xml
index 0971a9d54e..09706746af 100644
--- a/bpmn/so-bpmn-building-blocks/pom.xml
+++ b/bpmn/so-bpmn-building-blocks/pom.xml
@@ -36,6 +36,9 @@
</configuration>
</execution>
</executions>
+ <configuration>
+ <parallel>suites</parallel>
+ </configuration>
</plugin>
</plugins>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/EtsiVnfDeleteBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/EtsiVnfDeleteBB.bpmn
new file mode 100644
index 0000000000..7f70cc5756
--- /dev/null
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/EtsiVnfDeleteBB.bpmn
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1as67q3" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4">
+ <bpmn:process id="vnfmFoundCheck" name="vnfmFoundCheck" isExecutable="true">
+ <bpmn:startEvent id="StartEvent_0i3wi1x">
+ <bpmn:outgoing>SequenceFlow_01pwrcr</bpmn:outgoing>
+ </bpmn:startEvent>
+ <bpmn:serviceTask id="ServiceTask_1d5jbsa" name="&#10;Invoke VNFM Adaptor&#10;" camunda:asyncAfter="true" camunda:expression="${EtsiVnfDeleteTask.invokeVnfmAdapter(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:incoming>SequenceFlow_01pwrcr</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1064iul</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:endEvent id="EndEvent_1khf4qw">
+ <bpmn:incoming>SequenceFlow_1064iul</bpmn:incoming>
+ </bpmn:endEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_1064iul" sourceRef="ServiceTask_1d5jbsa" targetRef="EndEvent_1khf4qw" />
+ <bpmn:sequenceFlow id="SequenceFlow_01pwrcr" sourceRef="StartEvent_0i3wi1x" targetRef="ServiceTask_1d5jbsa" />
+ </bpmn:process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="vnfmFoundCheck">
+ <bpmndi:BPMNShape id="StartEvent_0i3wi1x_di" bpmnElement="StartEvent_0i3wi1x">
+ <dc:Bounds x="325" y="183" width="36" height="36" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_1d5jbsa_di" bpmnElement="ServiceTask_1d5jbsa">
+ <dc:Bounds x="503" y="161" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="EndEvent_1khf4qw_di" bpmnElement="EndEvent_1khf4qw">
+ <dc:Bounds x="742" y="183" width="36" height="36" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1064iul_di" bpmnElement="SequenceFlow_1064iul">
+ <di:waypoint x="603" y="201" />
+ <di:waypoint x="742" y="201" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_01pwrcr_di" bpmnElement="SequenceFlow_01pwrcr">
+ <di:waypoint x="361" y="201" />
+ <di:waypoint x="503" y="201" />
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-infrastructure-common/pom.xml b/bpmn/so-bpmn-infrastructure-common/pom.xml
index 9ba278a119..e3ba0284dc 100644
--- a/bpmn/so-bpmn-infrastructure-common/pom.xml
+++ b/bpmn/so-bpmn-infrastructure-common/pom.xml
@@ -138,6 +138,9 @@
</configuration>
</execution>
</executions>
+ <configuration>
+ <parallel>suites</parallel>
+ </configuration>
</plugin>
</plugins>
</pluginManagement>
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstanceTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstanceTest.groovy
index ae40e9d7c6..101db4f021 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstanceTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstanceTest.groovy
@@ -41,9 +41,6 @@ import static org.mockito.Mockito.*
@RunWith(MockitoJUnitRunner.class)
class CreateCustomE2EServiceInstanceTest {
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
-
@Before
public void init() throws IOException {
MockitoAnnotations.initMocks(this);
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfraTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfraTest.groovy
index 77220da94f..c5fd377a72 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfraTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfraTest.groovy
@@ -44,9 +44,6 @@ class CreateVfModuleInfraTest {
def prefix = "CVFMI_"
def requestInfo = "<requestInfo><request-id>12345</request-id></requestInfo>"
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy
index 5ee10bc931..9214b386eb 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollbackTest.groovy
@@ -55,10 +55,7 @@ import org.apache.commons.lang3.*
@RunWith(MockitoJUnitRunner.class)
class DoCreateNetworkInstanceRollbackTest {
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
-
- def utils = new MsoUtils()
+ def utils = new MsoUtils()
String Prefix="CRENWKIR_"
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceTest.groovy
index b246caf40e..90c7b71a07 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceTest.groovy
@@ -41,9 +41,6 @@ class DoCreateServiceInstanceTest extends MsoGroovyTest{
def prefix = "DCRESI_"
@Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
- @Rule
public ExpectedException thrown = ExpectedException.none()
@Before
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollbackTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollbackTest.groovy
index fc5960b92f..dd18049b5f 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollbackTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollbackTest.groovy
@@ -62,9 +62,6 @@ class DoCreateVfModuleRollbackTest extends MsoGroovyTest{
@Spy
DoCreateVfModuleRollback doCreateVfModuleRollback
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy
index 30e3779b53..faa6a0e395 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleTest.groovy
@@ -47,9 +47,6 @@ import static org.mockito.Mockito.*
class DoCreateVfModuleTest {
def prefix = "DCVFM_"
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesTest.groovy
index 47db6b3b7b..a8c818e69c 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesTest.groovy
@@ -54,9 +54,6 @@ import static org.mockito.Mockito.*
@RunWith(MockitoJUnitRunner.class)
class DoCreateVnfAndModulesTest {
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfTest.groovy
index 9b421d8b63..d7ba10ad93 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfTest.groovy
@@ -44,9 +44,6 @@ import static org.mockito.Mockito.*
class DoCreateVnfTest {
def prefix = "DoCVNF_"
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstanceTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstanceTest.groovy
index a8bdfb0633..ea79e0eadd 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstanceTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstanceTest.groovy
@@ -46,9 +46,6 @@ import static org.mockito.Mockito.*
@RunWith(MockitoJUnitRunner.class)
class DoDeleteServiceInstanceTest {
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnfTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnfTest.groovy
index cfdeee2c32..f356845a1e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnfTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnfTest.groovy
@@ -54,9 +54,6 @@ import static org.mockito.Mockito.*
@RunWith(MockitoJUnitRunner.class)
class DoDeleteVfModuleFromVnfTest extends MsoGroovyTest {
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleTest.groovy
index 7776ab3fe6..b56e108faf 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleTest.groovy
@@ -61,9 +61,6 @@ class DoDeleteVfModuleTest extends MsoGroovyTest{
@Spy
DoDeleteVfModule doDeleteVfModule
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2Test.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2Test.groovy
index 94aec7a73f..eab1b89e10 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2Test.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2Test.groovy
@@ -56,8 +56,6 @@ import static org.mockito.Mockito.*
@RunWith(MockitoJUnitRunner.class)
class DoDeleteVfModuleVolumeV2Test extends MsoGroovyTest{
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModulesTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModulesTest.groovy
index f98d454eb0..9e4ab6f757 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModulesTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModulesTest.groovy
@@ -50,9 +50,6 @@ import static org.mockito.Mockito.*
@RunWith(MockitoJUnitRunner.class)
public class DoDeleteVnfAndModulesTest extends MsoGroovyTest{
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
-
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy
index 0189d065df..7bc82c1ccc 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollbackTest.groovy
@@ -52,9 +52,6 @@ import org.apache.commons.lang3.*
@RunWith(MockitoJUnitRunner.class)
class DoUpdateNetworkInstanceRollbackTest {
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
-
def utils = new MsoUtils()
String Prefix="UPDNETIR_"
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModuleTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModuleTest.groovy
index 59a2b0eda3..f16bc575a4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModuleTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModuleTest.groovy
@@ -57,9 +57,6 @@ class DoUpdateVfModuleTest extends MsoGroovyTest{
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090)
-
@Spy
DoUpdateVfModule doUpdateVfModule
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModulesTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModulesTest.groovy
index a86029ea30..8e81e91228 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModulesTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModulesTest.groovy
@@ -47,9 +47,6 @@ class DoUpdateVnfAndModulesTest {
@Captor
static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(28090);
-
@Before
public void init() {
MockitoAnnotations.initMocks(this)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy
index 41a862e00e..5c3521f5ba 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollbackTest.groovy
@@ -238,8 +238,8 @@ class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initUpdateAaiAROrchStatus(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
- MockPatchAllottedResource(CUST, SVC, INST, ARID)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
+ MockPatchAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
DoCreateAllottedResourceBRGRollback.updateAaiAROrchStatus(mex, "success")
@@ -265,8 +265,8 @@ class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initUpdateAaiAROrchStatus(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
- MockPatchAllottedResource(CUST, SVC, INST, ARID)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
+ MockPatchAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
when(mex.getVariable("aaiARPath")).thenReturn(null)
@@ -354,8 +354,8 @@ class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex)
@@ -366,8 +366,8 @@ class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenReturn("")
@@ -381,8 +381,8 @@ class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenThrow(new BpmnError("expected exception"))
@@ -396,8 +396,8 @@ class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenThrow(new RuntimeException("expected exception"))
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy
index f094ef25fa..09244bedc4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy
@@ -94,7 +94,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
@Test
@Ignore
public void getAaiAR() {
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
ExecutionEntity mex = setupMock()
initGetAaiAR(mex)
@@ -107,7 +107,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
@Test
public void getAaiAR_Duplicate() {
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
ExecutionEntity mex = setupMock()
initGetAaiAR(mex)
@@ -122,7 +122,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
@Test
public void getAaiAR_NotActive() {
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
ExecutionEntity mex = setupMock()
initGetAaiAR(mex)
@@ -138,7 +138,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
@Test
@Ignore
public void getAaiAR_NoStatus() {
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRG/getArBrg.xml")
ExecutionEntity mex = setupMock()
initGetAaiAR(mex)
@@ -205,7 +205,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
when(mex.getVariable("PSI_resourceLink")).thenReturn(null)
- MockPutAllottedResource(CUST, SVC, INST, ARID)
+ MockPutAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
@@ -217,7 +217,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initCreateAaiAr(mex)
- MockPutAllottedResource_500(CUST, SVC, INST, ARID)
+ MockPutAllottedResource_500(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
@@ -231,7 +231,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
when(mex.getVariable("aai.endpoint")).thenThrow(new BpmnError("expected exception"))
- MockPutAllottedResource(CUST, SVC, INST, ARID)
+ MockPutAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
@@ -245,7 +245,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
when(mex.getVariable("aai.endpoint")).thenThrow(new RuntimeException("expected exception"))
- MockPutAllottedResource(CUST, SVC, INST, ARID)
+ MockPutAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
@@ -621,7 +621,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
@Test
@Ignore
public void updateAaiAROrchStatus() {
- MockPatchAllottedResource(CUST, SVC, INST, ARID)
+ MockPatchAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
ExecutionEntity mex = setupMock()
initUpdateAaiAROrchStatus(mex)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy
index a877ce42e7..e25f43f796 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollbackTest.groovy
@@ -238,8 +238,8 @@ class DoCreateAllottedResourceTXCRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initUpdateAaiAROrchStatus(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
- MockPatchAllottedResource(CUST, SVC, INST, ARID)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
+ MockPatchAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback()
DoCreateAllottedResourceTXCRollback.updateAaiAROrchStatus(mex, "success")
@@ -265,8 +265,8 @@ class DoCreateAllottedResourceTXCRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initUpdateAaiAROrchStatus(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
- MockPatchAllottedResource(CUST, SVC, INST, ARID)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
+ MockPatchAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
when(mex.getVariable("aaiARPath")).thenReturn(null)
@@ -354,8 +354,8 @@ class DoCreateAllottedResourceTXCRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
DoCreateAllottedResourceTXCRollback DoCreateAllottedResourceTXCRollback = new DoCreateAllottedResourceTXCRollback()
DoCreateAllottedResourceTXCRollback.deleteAaiAR(mex)
@@ -366,8 +366,8 @@ class DoCreateAllottedResourceTXCRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenReturn("")
@@ -381,8 +381,8 @@ class DoCreateAllottedResourceTXCRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenThrow(new BpmnError("expected exception"))
@@ -396,8 +396,8 @@ class DoCreateAllottedResourceTXCRollbackTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenThrow(new RuntimeException("expected exception"))
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy
index b53e5fce21..901bdaf7b3 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy
@@ -93,7 +93,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
@Test
@Ignore
public void getAaiAR() {
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
ExecutionEntity mex = setupMock()
initGetAaiAR(mex)
@@ -107,7 +107,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
@Test
public void getAaiAR_Duplicate() {
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
ExecutionEntity mex = setupMock()
initGetAaiAR(mex)
@@ -122,7 +122,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
@Test
public void getAaiAR_NotActive() {
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
ExecutionEntity mex = setupMock()
initGetAaiAR(mex)
@@ -138,7 +138,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
@Test
@Ignore
public void getAaiAR_NoStatus() {
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
ExecutionEntity mex = setupMock()
initGetAaiAR(mex)
@@ -177,7 +177,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
when(mex.getVariable("PSI_resourceLink")).thenReturn(null)
- MockPutAllottedResource(CUST, SVC, INST, ARID)
+ MockPutAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC()
@@ -189,7 +189,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initCreateAaiAr(mex)
- MockPutAllottedResource_500(CUST, SVC, INST, ARID)
+ MockPutAllottedResource_500(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC()
@@ -203,7 +203,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
when(mex.getVariable("aai.endpoint")).thenThrow(new BpmnError("expected exception"))
- MockPutAllottedResource(CUST, SVC, INST, ARID)
+ MockPutAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC()
@@ -217,7 +217,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
when(mex.getVariable("aai.endpoint")).thenThrow(new RuntimeException("expected exception"))
- MockPutAllottedResource(CUST, SVC, INST, ARID)
+ MockPutAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoCreateAllottedResourceTXC DoCreateAllottedResourceTXC = new DoCreateAllottedResourceTXC()
@@ -559,7 +559,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
@Test
@Ignore
public void updateAaiAROrchStatus() {
- MockPatchAllottedResource(CUST, SVC, INST, ARID)
+ MockPatchAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
ExecutionEntity mex = setupMock()
initUpdateAaiAROrchStatus(mex)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy
index e77c1dd9ed..ab9be8217d 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRGTest.groovy
@@ -132,7 +132,7 @@ class DoDeleteAllottedResourceBRGTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initUpdateAaiAROrchStatus(mex)
- MockPatchAllottedResource(CUST, SVC, INST, ARID)
+ MockPatchAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
DoDeleteAllottedResourceBRG.updateAaiAROrchStatus(mex, "success")
@@ -412,8 +412,8 @@ class DoDeleteAllottedResourceBRGTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
DoDeleteAllottedResourceBRG.deleteAaiAR(mex)
@@ -424,8 +424,8 @@ class DoDeleteAllottedResourceBRGTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenReturn("")
@@ -439,8 +439,8 @@ class DoDeleteAllottedResourceBRGTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenThrow(new BpmnError("expected exception"))
@@ -454,8 +454,8 @@ class DoDeleteAllottedResourceBRGTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenThrow(new RuntimeException("expected exception"))
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy
index 23115874a2..6a75c145ff 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXCTest.groovy
@@ -132,7 +132,7 @@ class DoDeleteAllottedResourceTXCTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initUpdateAaiAROrchStatus(mex)
- MockPatchAllottedResource(CUST, SVC, INST, ARID)
+ MockPatchAllottedResource(wireMockRule, CUST, SVC, INST, ARID)
DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC()
DoDeleteAllottedResourceTXC.updateAaiAROrchStatus(mex, "success")
@@ -412,8 +412,8 @@ class DoDeleteAllottedResourceTXCTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
DoDeleteAllottedResourceTXC DoDeleteAllottedResourceTXC = new DoDeleteAllottedResourceTXC()
DoDeleteAllottedResourceTXC.deleteAaiAR(mex)
@@ -424,8 +424,8 @@ class DoDeleteAllottedResourceTXCTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenReturn("")
@@ -439,8 +439,8 @@ class DoDeleteAllottedResourceTXCTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenThrow(new BpmnError("expected exception"))
@@ -454,8 +454,8 @@ class DoDeleteAllottedResourceTXCTest extends GroovyTestBase {
ExecutionEntity mex = setupMock()
initDeleteAaiAR(mex)
- MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml")
- MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
+ MockGetAllottedResource(wireMockRule, CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceTXC/arGetById.xml")
+ MockDeleteAllottedResource(wireMockRule, CUST, SVC, INST, ARID, VERS)
when(mex.getVariable("aaiARPath")).thenThrow(new RuntimeException("expected exception"))
diff --git a/bpmn/so-bpmn-infrastructure-flows/pom.xml b/bpmn/so-bpmn-infrastructure-flows/pom.xml
index b3275eb6ec..59b9027000 100644
--- a/bpmn/so-bpmn-infrastructure-flows/pom.xml
+++ b/bpmn/so-bpmn-infrastructure-flows/pom.xml
@@ -104,6 +104,9 @@
</configuration>
</execution>
</executions>
+ <configuration>
+ <parallel>suites</parallel>
+ </configuration>
</plugin>
</plugins>
</pluginManagement>
diff --git a/bpmn/so-bpmn-tasks/pom.xml b/bpmn/so-bpmn-tasks/pom.xml
index 8adffb29b5..14eb42ff79 100644
--- a/bpmn/so-bpmn-tasks/pom.xml
+++ b/bpmn/so-bpmn-tasks/pom.xml
@@ -43,6 +43,9 @@
</configuration>
</execution>
</executions>
+ <configuration>
+ <parallel>suites</parallel>
+ </configuration>
</plugin>
<plugin>
<groupId>io.swagger</groupId>
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/Constants.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/Constants.java
index 667ac133af..0153b4b3f9 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/Constants.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/Constants.java
@@ -25,21 +25,20 @@ package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
*/
public class Constants {
- public static final String CREATE_VNF_REQUEST_PARAM_NAME = "createVnfRequest";
- public static final String CREATE_VNF_RESPONSE_PARAM_NAME = "createVnfResponse";
-
- public static final String INPUT_PARAMETER = "inputParameter";
+ public static final String CREATE_VNF_REQUEST_PARAM_NAME = "createVnfRequest";
+ public static final String CREATE_VNF_RESPONSE_PARAM_NAME = "createVnfResponse";
+ public static final String INPUT_PARAMETER = "inputParameter";
+ public static final String DELETE_VNF_RESPONSE_PARAM_NAME = "deleteVnfResponse";
- public static final String DOT = ".";
- public static final String UNDERSCORE = "_";
- public static final String SPACE = "\\s+";
+ public static final String DOT = ".";
+ public static final String UNDERSCORE = "_";
+ public static final String SPACE = "\\s+";
- public static final String VNFM_ADAPTER_DEFAULT_URL = "http://so-vnfm-adapter.onap:9092/so/vnfm-adapter/v1/";
- public static final String VNFM_ADAPTER_DEFAULT_AUTH = "Basic dm5mbTpwYXNzd29yZDEk";
-
- public static final String FORWARD_SLASH = "/";
- public static final String PRELOAD_VNFS_URL = "/restconf/config/VNF-API:preload-vnfs/vnf-preload-list/";
+ public static final String VNFM_ADAPTER_DEFAULT_URL = "http://so-vnfm-adapter.onap:9092/so/vnfm-adapter/v1/";
+ public static final String VNFM_ADAPTER_DEFAULT_AUTH = "Basic dm5mbTpwYXNzd29yZDEk";
+ public static final String FORWARD_SLASH = "/";
+ public static final String PRELOAD_VNFS_URL = "/restconf/config/VNF-API:preload-vnfs/vnf-preload-list/";
- private Constants() {}
+ private Constants() {}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/EtsiVnfDeleteTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/EtsiVnfDeleteTask.java
new file mode 100644
index 0000000000..857c5cb6fe
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/EtsiVnfDeleteTask.java
@@ -0,0 +1,84 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import static org.onap.so.bpmn.servicedecomposition.entities.ResourceKey.GENERIC_VNF_ID;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.vnfmadapter.v1.model.DeleteVnfResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import com.google.common.base.Optional;
+
+/**
+ *
+ * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
+ */
+@Component
+public class EtsiVnfDeleteTask {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(EtsiVnfDeleteTask.class);
+ private final ExtractPojosForBB extractPojosForBB;
+ private final ExceptionBuilder exceptionUtil;
+ private final VnfmAdapterServiceProvider vnfmAdapterServiceProvider;
+
+ @Autowired
+ public EtsiVnfDeleteTask(final ExceptionBuilder exceptionUtil, final ExtractPojosForBB extractPojosForBB,
+ final VnfmAdapterServiceProvider vnfmAdapterServiceProvider) {
+ this.exceptionUtil = exceptionUtil;
+ this.extractPojosForBB = extractPojosForBB;
+ this.vnfmAdapterServiceProvider = vnfmAdapterServiceProvider;
+ }
+
+ /**
+ * Invoke VNFM adapter to delete the VNF
+ *
+ * @param execution {@link org.onap.so.bpmn.common.DelegateExecutionImpl}
+ */
+ public void invokeVnfmAdapter(final BuildingBlockExecution execution) {
+ try {
+ LOGGER.debug("Executing invokeVnfmAdapter ...");
+ final GenericVnf vnf = extractPojosForBB.extractByKey(execution, GENERIC_VNF_ID);
+
+ final Optional<DeleteVnfResponse> response = vnfmAdapterServiceProvider.invokeDeleteRequest(vnf.getVnfId());
+
+ if (!response.isPresent()) {
+ final String errorMessage = "Unexpected error while processing delete request";
+ LOGGER.error(errorMessage);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1211, errorMessage);
+ }
+
+ final DeleteVnfResponse vnfResponse = response.get();
+
+ LOGGER.debug("Vnf delete response: {}", vnfResponse);
+ execution.setVariable(Constants.DELETE_VNF_RESPONSE_PARAM_NAME, vnfResponse);
+
+ LOGGER.debug("Finished executing invokeVnfmAdapter ...");
+ } catch (final Exception exception) {
+ LOGGER.error("Unable to invoke delete request", exception);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1212, exception);
+ }
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProvider.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProvider.java
index 02303ef09d..a76a4bf3c1 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProvider.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProvider.java
@@ -22,17 +22,19 @@ package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
import org.onap.vnfmadapter.v1.model.CreateVnfRequest;
import org.onap.vnfmadapter.v1.model.CreateVnfResponse;
-
+import org.onap.vnfmadapter.v1.model.DeleteVnfResponse;
import com.google.common.base.Optional;
/**
* Provide a service which interacts with VNFM adapter for instantiating, monitoring VNF
- *
+ *
* @author waqas.ikram@est.tech
*/
public interface VnfmAdapterServiceProvider {
- Optional<CreateVnfResponse> invokeCreateInstantiationRequest(final String vnfId, final CreateVnfRequest request);
+ Optional<CreateVnfResponse> invokeCreateInstantiationRequest(final String vnfId, final CreateVnfRequest request);
+
+ Optional<DeleteVnfResponse> invokeDeleteRequest(final String vnfId);
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java
index afdcccfd36..f727423e85 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java
@@ -25,13 +25,13 @@ import org.onap.so.rest.exceptions.RestProcessingException;
import org.onap.so.rest.service.HttpRestServiceProvider;
import org.onap.vnfmadapter.v1.model.CreateVnfRequest;
import org.onap.vnfmadapter.v1.model.CreateVnfResponse;
+import org.onap.vnfmadapter.v1.model.DeleteVnfResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
-
import com.google.common.base.Optional;
/**
@@ -40,50 +40,85 @@ import com.google.common.base.Optional;
@Service
public class VnfmAdapterServiceProviderImpl implements VnfmAdapterServiceProvider {
- private static final Logger LOGGER = LoggerFactory.getLogger(VnfmAdapterServiceProviderImpl.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(VnfmAdapterServiceProviderImpl.class);
+
+ private final VnfmAdapterUrlProvider urlProvider;
+ private final HttpRestServiceProvider httpServiceProvider;
+
+ @Autowired
+ public VnfmAdapterServiceProviderImpl(final VnfmAdapterUrlProvider urlProvider,
+ final HttpRestServiceProvider httpServiceProvider) {
+ this.urlProvider = urlProvider;
+ this.httpServiceProvider = httpServiceProvider;
+ }
+
+ @Override
+ public Optional<CreateVnfResponse> invokeCreateInstantiationRequest(final String vnfId,
+ final CreateVnfRequest request) {
+ try {
+ final String url = urlProvider.getCreateInstantiateUrl(vnfId);
+
+ final ResponseEntity<CreateVnfResponse> response =
+ httpServiceProvider.postHttpRequest(request, url, CreateVnfResponse.class);
+
+ final HttpStatus httpStatus = response.getStatusCode();
+ if (!(httpStatus.equals(HttpStatus.ACCEPTED)) && !(httpStatus.equals(HttpStatus.OK))) {
+ LOGGER.error("Unable to invoke HTTP POST using URL: {}, Response Code: {}", url, httpStatus.value());
+ return Optional.absent();
+ }
+
+ if (!response.hasBody()) {
+ LOGGER.error("Received response without body: {}", response);
+ return Optional.absent();
+ }
+
+ final CreateVnfResponse createVnfResponse = response.getBody();
- private final VnfmAdapterUrlProvider urlProvider;
- private final HttpRestServiceProvider httpServiceProvider;
+ if (createVnfResponse.getJobId() == null || createVnfResponse.getJobId().isEmpty()) {
+ LOGGER.error("Received invalid instantiation response: {}", response);
+ return Optional.absent();
+ }
- @Autowired
- public VnfmAdapterServiceProviderImpl(final VnfmAdapterUrlProvider urlProvider,
- final HttpRestServiceProvider httpServiceProvider) {
- this.urlProvider = urlProvider;
- this.httpServiceProvider = httpServiceProvider;
+ return Optional.of(createVnfResponse);
+ } catch (final RestProcessingException | InvalidRestRequestException httpInvocationException) {
+ LOGGER.error("Unexpected error while processing create and instantiation request", httpInvocationException);
+ return Optional.absent();
}
- @Override
- public Optional<CreateVnfResponse> invokeCreateInstantiationRequest(final String vnfId,
- final CreateVnfRequest request) {
- try {
- final String url = urlProvider.getCreateInstantiateUrl(vnfId);
+ }
- final ResponseEntity<CreateVnfResponse> response =
- httpServiceProvider.postHttpRequest(request, url, CreateVnfResponse.class);
+ @Override
+ public Optional<DeleteVnfResponse> invokeDeleteRequest(final String vnfId) {
+ try {
+ final String url = urlProvider.getDeleteUrl(vnfId);
+ LOGGER.debug("Will send request to vnfm adapter using url: {}", url);
- final HttpStatus httpStatus = response.getStatusCode();
- if (!(httpStatus.equals(HttpStatus.ACCEPTED)) && !(httpStatus.equals(HttpStatus.OK))) {
- LOGGER.error("Unable to invoke HTTP POST using URL: {}, Response Code: {}", url, httpStatus.value());
- return Optional.absent();
- }
+ final ResponseEntity<DeleteVnfResponse> response =
+ httpServiceProvider.deleteHttpRequest(url, DeleteVnfResponse.class);
- if (!response.hasBody()) {
- LOGGER.error("Received response without body: {}", response);
- return Optional.absent();
- }
+ LOGGER.debug("Response received: ", response);
- final CreateVnfResponse createVnfResponse = response.getBody();
+ final HttpStatus httpStatus = response.getStatusCode();
- if (createVnfResponse.getJobId() == null || createVnfResponse.getJobId().isEmpty()) {
- LOGGER.error("Received invalid instantiation response: {}", response);
- return Optional.absent();
- }
+ if (!(httpStatus.equals(HttpStatus.ACCEPTED)) && !(httpStatus.equals(HttpStatus.OK))) {
+ LOGGER.error("Unable to invoke HTTP DELETE using URL: {}, Response Code: {}", url, httpStatus.value());
+ return Optional.absent();
+ }
- return Optional.of(createVnfResponse);
- } catch (final RestProcessingException | InvalidRestRequestException httpInvocationException) {
- LOGGER.error("Unexpected error while processing create and instantiation request", httpInvocationException);
- return Optional.absent();
- }
+ if (!response.hasBody()) {
+ LOGGER.error("Received response without body: {}", response);
+ return Optional.absent();
+ }
+ final DeleteVnfResponse deleteVnfResponse = response.getBody();
+ if (deleteVnfResponse.getJobId() == null || deleteVnfResponse.getJobId().isEmpty()) {
+ LOGGER.error("Received invalid delete response: {}", response);
+ return Optional.absent();
+ }
+ return Optional.of(deleteVnfResponse);
+ } catch (final RestProcessingException | InvalidRestRequestException httpInvocationException) {
+ LOGGER.error("Unexpected error while processing delete request", httpInvocationException);
+ return Optional.absent();
}
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterUrlProvider.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterUrlProvider.java
index 03ee0712e7..61063fe90e 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterUrlProvider.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterUrlProvider.java
@@ -21,7 +21,6 @@
package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
import java.net.URI;
-
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.util.UriComponentsBuilder;
@@ -36,23 +35,34 @@ import org.springframework.web.util.UriComponentsBuilder;
@Service
public class VnfmAdapterUrlProvider {
- private final URI baseUri;
-
- @Autowired
- public VnfmAdapterUrlProvider(final VnfmBasicHttpConfigProvider etsiVnfmAdapter) {
- this.baseUri = UriComponentsBuilder.fromHttpUrl(etsiVnfmAdapter.getUrl()).build().toUri();
- }
-
- /**
- * Get VNFM create and instantiate URL
- *
- * @param vnfId The identifier of the VNF. This must be the vnf-id of an existing generic-vnf in
- * AAI.
- * @return VNFM create and instantiate URL
- */
- public String getCreateInstantiateUrl(final String vnfId) {
- return UriComponentsBuilder.fromUri(baseUri).pathSegment("vnfs").pathSegment(vnfId).build().toString();
- }
+ private final URI baseUri;
+
+ @Autowired
+ public VnfmAdapterUrlProvider(final VnfmBasicHttpConfigProvider etsiVnfmAdapter) {
+ this.baseUri = UriComponentsBuilder.fromHttpUrl(etsiVnfmAdapter.getUrl()).build().toUri();
+ }
+
+ /**
+ * Get VNFM create and instantiate URL
+ *
+ * @param vnfId The identifier of the VNF. This must be the vnf-id of an existing generic-vnf in
+ * AAI.
+ * @return VNFM create and instantiate URL
+ */
+ public String getCreateInstantiateUrl(final String vnfId) {
+ return UriComponentsBuilder.fromUri(baseUri).pathSegment("vnfs").pathSegment(vnfId).build().toString();
+ }
+
+ /**
+ * Get VNFM delete URL
+ *
+ * @param vnfId The identifier of the VNF. This must be the vnf-id of an existing generic-vnf in
+ * AAI.
+ * @return VNFM delete URL
+ */
+ public String getDeleteUrl(final String vnfId) {
+ return UriComponentsBuilder.fromUri(baseUri).pathSegment("vnfs").pathSegment(vnfId).build().toString();
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapper.java
index b11e2caafa..7b86756afa 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapper.java
@@ -21,6 +21,7 @@
package org.onap.so.client.sdnc.mapper;
import java.net.URI;
+import java.util.UUID;
import org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiGcTopologyOperationInformation;
@@ -52,9 +53,13 @@ public class GCTopologyOperationRequestMapper {
Configuration vnrConfiguration,
GenericVnf voiceVnf, String sdncReqId,URI callbackUri) {
+ String msoRequestId = UUID.randomUUID().toString();
+ if (requestContext != null && requestContext.getMsoRequestId() != null) {
+ msoRequestId = requestContext.getMsoRequestId();
+ }
GenericResourceApiGcTopologyOperationInformation req = new GenericResourceApiGcTopologyOperationInformation();
GenericResourceApiSdncrequestheaderSdncRequestHeader sdncRequestHeader = generalTopologyObjectMapper.buildSdncRequestHeader(svcAction, sdncReqId,callbackUri.toString());
- GenericResourceApiRequestinformationRequestInformation requestInformation = generalTopologyObjectMapper.buildGenericResourceApiRequestinformationRequestInformation(sdncReqId, reqAction);
+ GenericResourceApiRequestinformationRequestInformation requestInformation = generalTopologyObjectMapper.buildGenericResourceApiRequestinformationRequestInformation(msoRequestId, reqAction);
GenericResourceApiServiceinformationServiceInformation serviceInformation = generalTopologyObjectMapper.buildServiceInformation(serviceInstance, requestContext, customer, false);
GenericResourceApiConfigurationinformationConfigurationInformation configurationInformation = generalTopologyObjectMapper.buildConfigurationInformation(vnrConfiguration,true);
GenericResourceApiGcrequestinputGcRequestInput gcRequestInput = generalTopologyObjectMapper.buildGcRequestInformation(voiceVnf,null);
@@ -74,11 +79,15 @@ public class GCTopologyOperationRequestMapper {
RequestContext requestContext,
Configuration vnrConfiguration, String sdncReqId, URI callbackUri) {
+ String msoRequestId = null;
+ if (requestContext != null) {
+ msoRequestId = requestContext.getMsoRequestId();
+ }
GenericResourceApiGcTopologyOperationInformation req = new GenericResourceApiGcTopologyOperationInformation();
GenericResourceApiSdncrequestheaderSdncRequestHeader sdncRequestHeader =
generalTopologyObjectMapper.buildSdncRequestHeader(svcAction, sdncReqId,callbackUri.toString());
GenericResourceApiRequestinformationRequestInformation requestInformation = generalTopologyObjectMapper
- .buildGenericResourceApiRequestinformationRequestInformation(sdncReqId,
+ .buildGenericResourceApiRequestinformationRequestInformation(msoRequestId,
GenericResourceApiRequestActionEnumeration.DELETEGENERICCONFIGURATIONINSTANCE);
GenericResourceApiServiceinformationServiceInformation serviceInformation = new GenericResourceApiServiceinformationServiceInformation();
serviceInformation.setServiceInstanceId(serviceInstance.getServiceInstanceId());
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapper.java
index b086b8a7ff..756e5b068e 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/GeneralTopologyObjectMapper.java
@@ -60,10 +60,10 @@ public class GeneralTopologyObjectMapper {
/*
* Build GenericResourceApiRequestinformationRequestInformation
*/
- public GenericResourceApiRequestinformationRequestInformation buildGenericResourceApiRequestinformationRequestInformation(String sdncReqId, GenericResourceApiRequestActionEnumeration requestAction){
+ public GenericResourceApiRequestinformationRequestInformation buildGenericResourceApiRequestinformationRequestInformation(String msoReqId, GenericResourceApiRequestActionEnumeration requestAction){
GenericResourceApiRequestinformationRequestInformation requestInformation = new GenericResourceApiRequestinformationRequestInformation();
- requestInformation.setRequestId(sdncReqId);
+ requestInformation.setRequestId(msoReqId);
requestInformation.setRequestAction(requestAction);
requestInformation.setSource("MSO");
return requestInformation;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapper.java
index 188a228e5d..aef7e9e044 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapper.java
@@ -57,8 +57,12 @@ public class NetworkTopologyOperationRequestMapper {
Customer customer, RequestContext requestContext, CloudRegion cloudRegion) {
GenericResourceApiNetworkOperationInformation req = new GenericResourceApiNetworkOperationInformation();
String sdncReqId = UUID.randomUUID().toString();
+ String msoRequestId = UUID.randomUUID().toString();
+ if (requestContext != null && requestContext.getMsoRequestId() != null) {
+ msoRequestId = requestContext.getMsoRequestId();
+ }
GenericResourceApiSdncrequestheaderSdncRequestHeader sdncRequestHeader = generalTopologyObjectMapper.buildSdncRequestHeader(svcAction, sdncReqId);
- GenericResourceApiRequestinformationRequestInformation requestInformation = generalTopologyObjectMapper.buildGenericResourceApiRequestinformationRequestInformation(sdncReqId, reqAction);
+ GenericResourceApiRequestinformationRequestInformation requestInformation = generalTopologyObjectMapper.buildGenericResourceApiRequestinformationRequestInformation(msoRequestId, reqAction);
GenericResourceApiServiceinformationServiceInformation serviceInformation = generalTopologyObjectMapper.buildServiceInformation(serviceInstance, requestContext, customer, true);
GenericResourceApiNetworkinformationNetworkInformation networkInformation = generalTopologyObjectMapper.buildNetworkInformation(network);
GenericResourceApiNetworkrequestinputNetworkRequestInput networkRequestInput = buildNetworkRequestInput(network, serviceInstance, cloudRegion);
@@ -68,7 +72,7 @@ public class NetworkTopologyOperationRequestMapper {
req.setServiceInformation(serviceInformation);
req.setNetworkInformation(networkInformation);
- if (requestContext.getUserParams() != null) {
+ if (requestContext != null && requestContext.getUserParams() != null) {
for (Map.Entry<String, Object> entry : requestContext.getUserParams().entrySet()) {
GenericResourceApiParam networkInputParameters = new GenericResourceApiParam();
GenericResourceApiParamParam paramItem = new GenericResourceApiParamParam();
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapper.java
index 505466b22c..cdb4ab96aa 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapper.java
@@ -49,9 +49,13 @@ public class ServiceTopologyOperationMapper{
SDNCSvcAction svcAction, GenericResourceApiRequestActionEnumeration resourceAction,ServiceInstance serviceInstance, Customer customer, RequestContext requestContext) {
String sdncReqId = UUID.randomUUID().toString();
+ String msoRequestId = UUID.randomUUID().toString();
+ if (requestContext != null && requestContext.getMsoRequestId() != null) {
+ msoRequestId = requestContext.getMsoRequestId();
+ }
GenericResourceApiServiceOperationInformation servOpInput = new GenericResourceApiServiceOperationInformation();
GenericResourceApiSdncrequestheaderSdncRequestHeader sdncRequestHeader = generalTopologyObjectMapper.buildSdncRequestHeader(svcAction, sdncReqId);
- GenericResourceApiRequestinformationRequestInformation reqInfo = generalTopologyObjectMapper.buildGenericResourceApiRequestinformationRequestInformation(sdncReqId, resourceAction);
+ GenericResourceApiRequestinformationRequestInformation reqInfo = generalTopologyObjectMapper.buildGenericResourceApiRequestinformationRequestInformation(msoRequestId, resourceAction);
GenericResourceApiServiceinformationServiceInformation servInfo = generalTopologyObjectMapper.buildServiceInformation(serviceInstance, requestContext, customer, true);
GenericResourceApiServicerequestinputServiceRequestInput servReqInfo = new GenericResourceApiServicerequestinputServiceRequestInput();
@@ -62,7 +66,7 @@ public class ServiceTopologyOperationMapper{
servOpInput.setServiceInformation(servInfo);
servOpInput.setServiceRequestInput(servReqInfo);
- if(requestContext.getUserParams()!=null){
+ if(requestContext != null && requestContext.getUserParams()!=null){
for (Map.Entry<String, Object> entry : requestContext.getUserParams().entrySet()) {
GenericResourceApiServicerequestinputServiceRequestInput serviceRequestInput = new GenericResourceApiServicerequestinputServiceRequestInput();
serviceRequestInput.setServiceInstanceName(serviceInstance.getServiceInstanceName());
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java
index b8c5fad41d..86c718d165 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java
@@ -96,8 +96,12 @@ public class VfModuleTopologyOperationRequestMapper {
}
String sdncReqId = UUID.randomUUID().toString();
+ String msoRequestId = UUID.randomUUID().toString();
+ if (requestContext != null && requestContext.getMsoRequestId() != null) {
+ msoRequestId = requestContext.getMsoRequestId();
+ }
- GenericResourceApiRequestinformationRequestInformation requestInformation = generalTopologyObjectMapper.buildGenericResourceApiRequestinformationRequestInformation(sdncReqId,
+ GenericResourceApiRequestinformationRequestInformation requestInformation = generalTopologyObjectMapper.buildGenericResourceApiRequestinformationRequestInformation(msoRequestId,
requestAction);
GenericResourceApiServiceinformationServiceInformation serviceInformation = generalTopologyObjectMapper.buildServiceInformation(serviceInstance, requestContext, customer, includeModelInformation);
GenericResourceApiVnfinformationVnfInformation vnfInformation = generalTopologyObjectMapper.buildVnfInformation(vnf, serviceInstance, includeModelInformation);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java
index 7de393bb2f..85e5b85529 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java
@@ -59,11 +59,15 @@ public class VnfTopologyOperationRequestMapper {
GenericResourceApiRequestActionEnumeration requestAction, GenericVnf vnf, ServiceInstance serviceInstance,
Customer customer, CloudRegion cloudRegion, RequestContext requestContext, boolean homing) {
String sdncReqId = UUID.randomUUID().toString();
+ String msoRequestId = UUID.randomUUID().toString();
+ if (requestContext != null && requestContext.getMsoRequestId() != null) {
+ msoRequestId = requestContext.getMsoRequestId();
+ }
GenericResourceApiVnfOperationInformation req = new GenericResourceApiVnfOperationInformation();
GenericResourceApiSdncrequestheaderSdncRequestHeader sdncRequestHeader = generalTopologyObjectMapper
.buildSdncRequestHeader(svcAction, sdncReqId);
GenericResourceApiRequestinformationRequestInformation requestInformation = generalTopologyObjectMapper
- .buildGenericResourceApiRequestinformationRequestInformation(sdncReqId, requestAction);
+ .buildGenericResourceApiRequestinformationRequestInformation(msoRequestId, requestAction);
GenericResourceApiServiceinformationServiceInformation serviceInformation = generalTopologyObjectMapper
.buildServiceInformation(serviceInstance, requestContext, customer, true);
GenericResourceApiVnfinformationVnfInformation vnfInformation = generalTopologyObjectMapper
@@ -84,7 +88,7 @@ public class VnfTopologyOperationRequestMapper {
req.setVnfInformation(vnfInformation);
GenericResourceApiParam vnfInputParameters = new GenericResourceApiParam();
- if (requestContext.getUserParams() != null) {
+ if (requestContext != null && requestContext.getUserParams() != null) {
for (Map.Entry<String, Object> entry : requestContext.getUserParams().entrySet()) {
GenericResourceApiParamParam paramItem = new GenericResourceApiParamParam();
paramItem.setName(entry.getKey());
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/BaseIntegrationTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/BaseIntegrationTest.java
index 6500e3a850..aefe4c64bf 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/BaseIntegrationTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/BaseIntegrationTest.java
@@ -31,6 +31,7 @@ import org.onap.so.client.orchestration.SDNOHealthCheckResources;
import org.onap.so.client.sdnc.SDNCClient;
import org.onap.so.client.sniro.SniroClient;
import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
@@ -40,7 +41,7 @@ import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
-import com.github.tomakehurst.wiremock.client.WireMock;
+import com.github.tomakehurst.wiremock.WireMockServer;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@@ -69,10 +70,13 @@ public abstract class BaseIntegrationTest extends TestDataSetup {
@MockBean
protected CatalogDbClient catalogDbClient;
+
+ @Autowired
+ protected WireMockServer wireMockServer;
@Before
public void baseTestBefore() {
- WireMock.reset();
+ wireMockServer.resetAll();
}
public String readResourceFile(String fileName) {
InputStream stream;
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/EtsiVnfDeleteTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/EtsiVnfDeleteTaskTest.java
new file mode 100644
index 0000000000..5c76018ced
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/EtsiVnfDeleteTaskTest.java
@@ -0,0 +1,111 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import java.util.UUID;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.onap.so.bpmn.BaseTaskTest;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
+import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
+import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf;
+import org.onap.vnfmadapter.v1.model.DeleteVnfResponse;
+import com.google.common.base.Optional;
+
+/**
+ *
+ * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
+ *
+ */
+public class EtsiVnfDeleteTaskTest extends BaseTaskTest {
+
+ private static final String MODEL_INSTANCE_NAME = "MODEL_INSTANCE_NAME";
+
+ private static final String VNF_ID = UUID.randomUUID().toString();
+
+ private static final String VNF_NAME = "VNF_NAME";
+
+ private static final String JOB_ID = UUID.randomUUID().toString();
+
+ @Mock
+ private VnfmAdapterServiceProvider mockedVnfmAdapterServiceProvider;
+
+ @Mock
+ private GeneralBuildingBlock buildingBlock;
+
+ @Mock
+ private RequestContext requestContext;
+
+ private final BuildingBlockExecution stubbedxecution = new StubbedBuildingBlockExecution();
+
+ @Test
+ public void testInvokeVnfmAdapter() throws Exception {
+ final EtsiVnfDeleteTask objUnderTest = getEtsiVnfDeleteTask();
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(getGenericVnf());
+ when(mockedVnfmAdapterServiceProvider.invokeDeleteRequest(eq(VNF_ID))).thenReturn(getDeleteVnfResponse());
+ objUnderTest.invokeVnfmAdapter(stubbedxecution);
+ assertNotNull(stubbedxecution.getVariable(Constants.DELETE_VNF_RESPONSE_PARAM_NAME));
+ }
+
+ @Test
+ public void testInvokeVnfmAdapterException() throws Exception {
+ final EtsiVnfDeleteTask objUnderTest = getEtsiVnfDeleteTask();
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(getGenericVnf());
+ when(mockedVnfmAdapterServiceProvider.invokeDeleteRequest(eq(VNF_ID))).thenReturn(Optional.absent());
+ objUnderTest.invokeVnfmAdapter(stubbedxecution);
+ assertNull(stubbedxecution.getVariable(Constants.DELETE_VNF_RESPONSE_PARAM_NAME));
+ verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1212),
+ any(Exception.class));
+ }
+
+ private Optional<DeleteVnfResponse> getDeleteVnfResponse() {
+ final DeleteVnfResponse response = new DeleteVnfResponse();
+ response.setJobId(JOB_ID);
+ return Optional.of(response);
+ }
+
+ private GenericVnf getGenericVnf() {
+ final GenericVnf genericVnf = new GenericVnf();
+ genericVnf.setVnfId(VNF_ID);
+ genericVnf.setModelInfoGenericVnf(getModelInfoGenericVnf());
+ genericVnf.setVnfName(VNF_NAME);
+ return genericVnf;
+ }
+
+ private ModelInfoGenericVnf getModelInfoGenericVnf() {
+ final ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf();
+ modelInfoGenericVnf.setModelInstanceName(MODEL_INSTANCE_NAME);
+ return modelInfoGenericVnf;
+ }
+
+ private EtsiVnfDeleteTask getEtsiVnfDeleteTask() {
+ return new EtsiVnfDeleteTask(exceptionUtil, extractPojosForBB, mockedVnfmAdapterServiceProvider);
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/StubbedBuildingBlockExecution.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/StubbedBuildingBlockExecution.java
new file mode 100644
index 0000000000..260585d208
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/StubbedBuildingBlockExecution.java
@@ -0,0 +1,100 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.common.exceptions.RequiredExecutionVariableExeception;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
+import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
+import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+
+/**
+ *
+ * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
+ *
+ */
+public class StubbedBuildingBlockExecution implements BuildingBlockExecution {
+
+ private static final String CLOUD_OWNER = "CLOUD_OWNER";
+ private static final String LCP_CLOUD_REGIONID = "RegionOnce";
+ private static final String TENANT_ID = UUID.randomUUID().toString();
+ private final Map<String, Serializable> execution = new HashMap<>();
+ private final GeneralBuildingBlock generalBuildingBlock;
+
+ StubbedBuildingBlockExecution() {
+ generalBuildingBlock = getGeneralBuildingBlockValue();
+ }
+
+ @Override
+ public GeneralBuildingBlock getGeneralBuildingBlock() {
+ return generalBuildingBlock;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T getVariable(final String key) {
+ return (T) execution.get(key);
+ }
+
+ @Override
+ public <T> T getRequiredVariable(final String key) throws RequiredExecutionVariableExeception {
+ return null;
+ }
+
+ @Override
+ public void setVariable(final String key, final Serializable value) {
+ execution.put(key, value);
+ }
+
+ @Override
+ public Map<ResourceKey, String> getLookupMap() {
+ return Collections.emptyMap();
+ }
+
+ @Override
+ public String getFlowToBeCalled() {
+ return null;
+ }
+
+ public static String getTenantId() {
+ return TENANT_ID;
+ }
+
+ private GeneralBuildingBlock getGeneralBuildingBlockValue() {
+ final GeneralBuildingBlock buildingBlock = new GeneralBuildingBlock();
+ buildingBlock.setCloudRegion(getCloudRegion());
+ return buildingBlock;
+ }
+
+ private CloudRegion getCloudRegion() {
+ final CloudRegion cloudRegion = new CloudRegion();
+ cloudRegion.setCloudOwner(CLOUD_OWNER);
+ cloudRegion.setLcpCloudRegionId(LCP_CLOUD_REGIONID);
+ cloudRegion.setTenantId(TENANT_ID);
+ return cloudRegion;
+ }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java
index 20abe6ece1..22c4c15079 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterCreateVnfTaskTest.java
@@ -30,28 +30,19 @@ import static org.mockito.Mockito.when;
import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_REQUEST_PARAM_NAME;
import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_RESPONSE_PARAM_NAME;
import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.INPUT_PARAMETER;
-
-import java.io.Serializable;
import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
import java.util.UUID;
-
import org.junit.Test;
import org.mockito.Mock;
import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.bpmn.common.BuildingBlockExecution;
-import org.onap.so.bpmn.common.exceptions.RequiredExecutionVariableExeception;
import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils.InputParameter;
-import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
-import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf;
import org.onap.vnfmadapter.v1.model.CreateVnfRequest;
import org.onap.vnfmadapter.v1.model.CreateVnfResponse;
import org.onap.vnfmadapter.v1.model.Tenant;
-
import com.google.common.base.Optional;
@@ -60,191 +51,131 @@ import com.google.common.base.Optional;
*/
public class VnfmAdapterCreateVnfTaskTest extends BaseTaskTest {
- private static final String MODEL_INSTANCE_NAME = "MODEL_INSTANCE_NAME";
-
- private static final String CLOUD_OWNER = "CLOUD_OWNER";
-
- private static final String LCP_CLOUD_REGIONID = "RegionOnce";
-
- private static final String TENANT_ID = UUID.randomUUID().toString();
-
- private static final String VNF_ID = UUID.randomUUID().toString();
-
- private static final String VNF_NAME = "VNF_NAME";
-
- private static final String JOB_ID = UUID.randomUUID().toString();
-
- @Mock
- private VnfmAdapterServiceProvider mockedVnfmAdapterServiceProvider;
-
- private final BuildingBlockExecution stubbedxecution = new StubbedBuildingBlockExecution();
-
- @Test
- public void testBuildCreateVnfRequest_withValidValues_storesRequestInExecution() throws Exception {
-
- final VnfmAdapterCreateVnfTask objUnderTest = getEtsiVnfInstantiateTask();
- stubbedxecution.setVariable(INPUT_PARAMETER,
- new InputParameter(Collections.emptyMap(), Collections.emptyList()));
-
- when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(getGenericVnf());
- objUnderTest.buildCreateVnfRequest(stubbedxecution);
-
- final CreateVnfRequest actual = stubbedxecution.getVariable(CREATE_VNF_REQUEST_PARAM_NAME);
- assertNotNull(actual);
- assertEquals(VNF_NAME + "." + MODEL_INSTANCE_NAME, actual.getName());
-
- final Tenant actualTenant = actual.getTenant();
- assertEquals(CLOUD_OWNER, actualTenant.getCloudOwner());
- assertEquals(LCP_CLOUD_REGIONID, actualTenant.getRegionName());
- assertEquals(TENANT_ID, actualTenant.getTenantId());
-
- }
+ private static final String MODEL_INSTANCE_NAME = "MODEL_INSTANCE_NAME";
- @Test
- public void testBuildCreateVnfRequest_extractPojosForBBThrowsException_exceptionBuilderCalled() throws Exception {
+ private static final String CLOUD_OWNER = "CLOUD_OWNER";
- final VnfmAdapterCreateVnfTask objUnderTest = getEtsiVnfInstantiateTask();
+ private static final String LCP_CLOUD_REGIONID = "RegionOnce";
- when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenThrow(RuntimeException.class);
+ private static final String VNF_ID = UUID.randomUUID().toString();
- objUnderTest.buildCreateVnfRequest(stubbedxecution);
+ private static final String VNF_NAME = "VNF_NAME";
- final CreateVnfRequest actual = stubbedxecution.getVariable(CREATE_VNF_REQUEST_PARAM_NAME);
+ private static final String JOB_ID = UUID.randomUUID().toString();
- assertNull(actual);
- verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1200),
- any(Exception.class));
+ @Mock
+ private VnfmAdapterServiceProvider mockedVnfmAdapterServiceProvider;
- }
+ private final BuildingBlockExecution stubbedxecution = new StubbedBuildingBlockExecution();
- @Test
- public void testInvokeVnfmAdapter_validValues_storesResponseInExecution() throws Exception {
+ @Test
+ public void testBuildCreateVnfRequest_withValidValues_storesRequestInExecution() throws Exception {
- final VnfmAdapterCreateVnfTask objUnderTest = getEtsiVnfInstantiateTask();
+ final VnfmAdapterCreateVnfTask objUnderTest = getEtsiVnfInstantiateTask();
+ stubbedxecution.setVariable(INPUT_PARAMETER, new InputParameter(Collections.emptyMap(), Collections.emptyList()));
- stubbedxecution.setVariable(CREATE_VNF_REQUEST_PARAM_NAME, new CreateVnfRequest());
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(getGenericVnf());
+ objUnderTest.buildCreateVnfRequest(stubbedxecution);
- when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(getGenericVnf());
- when(mockedVnfmAdapterServiceProvider.invokeCreateInstantiationRequest(eq(VNF_ID), any(CreateVnfRequest.class)))
- .thenReturn(getCreateVnfResponse());
+ final CreateVnfRequest actual = stubbedxecution.getVariable(CREATE_VNF_REQUEST_PARAM_NAME);
+ assertNotNull(actual);
+ assertEquals(VNF_NAME + "." + MODEL_INSTANCE_NAME, actual.getName());
- objUnderTest.invokeVnfmAdapter(stubbedxecution);
+ final Tenant actualTenant = actual.getTenant();
+ assertEquals(CLOUD_OWNER, actualTenant.getCloudOwner());
+ assertEquals(LCP_CLOUD_REGIONID, actualTenant.getRegionName());
+ assertEquals(StubbedBuildingBlockExecution.getTenantId(), actualTenant.getTenantId());
- assertNotNull(stubbedxecution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME));
- }
+ }
- @Test
- public void testInvokeVnfmAdapter_invalidValues_storesResponseInExecution() throws Exception {
+ @Test
+ public void testBuildCreateVnfRequest_extractPojosForBBThrowsException_exceptionBuilderCalled() throws Exception {
- final VnfmAdapterCreateVnfTask objUnderTest = getEtsiVnfInstantiateTask();
+ final VnfmAdapterCreateVnfTask objUnderTest = getEtsiVnfInstantiateTask();
- stubbedxecution.setVariable(CREATE_VNF_REQUEST_PARAM_NAME, new CreateVnfRequest());
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenThrow(RuntimeException.class);
- when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(getGenericVnf());
- when(mockedVnfmAdapterServiceProvider.invokeCreateInstantiationRequest(eq(VNF_ID), any(CreateVnfRequest.class)))
- .thenReturn(Optional.absent());
+ objUnderTest.buildCreateVnfRequest(stubbedxecution);
- objUnderTest.invokeVnfmAdapter(stubbedxecution);
+ final CreateVnfRequest actual = stubbedxecution.getVariable(CREATE_VNF_REQUEST_PARAM_NAME);
- assertNull(stubbedxecution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME));
- verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1202),
- any(Exception.class));
- }
+ assertNull(actual);
+ verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1200),
+ any(Exception.class));
+ }
- @Test
- public void testInvokeVnfmAdapter_extractPojosForBBThrowsException_exceptionBuilderCalled() throws Exception {
+ @Test
+ public void testInvokeVnfmAdapter_validValues_storesResponseInExecution() throws Exception {
- final VnfmAdapterCreateVnfTask objUnderTest = getEtsiVnfInstantiateTask();
+ final VnfmAdapterCreateVnfTask objUnderTest = getEtsiVnfInstantiateTask();
- when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenThrow(RuntimeException.class);
+ stubbedxecution.setVariable(CREATE_VNF_REQUEST_PARAM_NAME, new CreateVnfRequest());
- objUnderTest.invokeVnfmAdapter(stubbedxecution);
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(getGenericVnf());
+ when(mockedVnfmAdapterServiceProvider.invokeCreateInstantiationRequest(eq(VNF_ID), any(CreateVnfRequest.class)))
+ .thenReturn(getCreateVnfResponse());
- assertNull(stubbedxecution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME));
- verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1202),
- any(Exception.class));
+ objUnderTest.invokeVnfmAdapter(stubbedxecution);
- }
+ assertNotNull(stubbedxecution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME));
+ }
- private Optional<CreateVnfResponse> getCreateVnfResponse() {
- final CreateVnfResponse response = new CreateVnfResponse();
- response.setJobId(JOB_ID);
- return Optional.of(response);
- }
+ @Test
+ public void testInvokeVnfmAdapter_invalidValues_storesResponseInExecution() throws Exception {
- private GenericVnf getGenericVnf() {
- final GenericVnf genericVnf = new GenericVnf();
- genericVnf.setVnfId(VNF_ID);
- genericVnf.setModelInfoGenericVnf(getModelInfoGenericVnf());
- genericVnf.setVnfName(VNF_NAME);
- return genericVnf;
- }
+ final VnfmAdapterCreateVnfTask objUnderTest = getEtsiVnfInstantiateTask();
- private ModelInfoGenericVnf getModelInfoGenericVnf() {
- final ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf();
- modelInfoGenericVnf.setModelInstanceName(MODEL_INSTANCE_NAME);
- return modelInfoGenericVnf;
- }
+ stubbedxecution.setVariable(CREATE_VNF_REQUEST_PARAM_NAME, new CreateVnfRequest());
- private VnfmAdapterCreateVnfTask getEtsiVnfInstantiateTask() {
- return new VnfmAdapterCreateVnfTask(exceptionUtil, extractPojosForBB, mockedVnfmAdapterServiceProvider);
- }
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(getGenericVnf());
+ when(mockedVnfmAdapterServiceProvider.invokeCreateInstantiationRequest(eq(VNF_ID), any(CreateVnfRequest.class)))
+ .thenReturn(Optional.absent());
- private class StubbedBuildingBlockExecution implements BuildingBlockExecution {
+ objUnderTest.invokeVnfmAdapter(stubbedxecution);
- private final Map<String, Serializable> execution = new HashMap<>();
- private final GeneralBuildingBlock generalBuildingBlock;
+ assertNull(stubbedxecution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME));
+ verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1202),
+ any(Exception.class));
+ }
- StubbedBuildingBlockExecution() {
- generalBuildingBlock = getGeneralBuildingBlockValue();
- }
- @Override
- public GeneralBuildingBlock getGeneralBuildingBlock() {
- return generalBuildingBlock;
- }
+ @Test
+ public void testInvokeVnfmAdapter_extractPojosForBBThrowsException_exceptionBuilderCalled() throws Exception {
- @SuppressWarnings("unchecked")
- @Override
- public <T> T getVariable(final String key) {
- return (T) execution.get(key);
- }
+ final VnfmAdapterCreateVnfTask objUnderTest = getEtsiVnfInstantiateTask();
- @Override
- public <T> T getRequiredVariable(final String key) throws RequiredExecutionVariableExeception {
- return null;
- }
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenThrow(RuntimeException.class);
- @Override
- public void setVariable(final String key, final Serializable value) {
- execution.put(key, value);
- }
+ objUnderTest.invokeVnfmAdapter(stubbedxecution);
- @Override
- public Map<ResourceKey, String> getLookupMap() {
- return Collections.emptyMap();
- }
+ assertNull(stubbedxecution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME));
+ verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1202),
+ any(Exception.class));
- @Override
- public String getFlowToBeCalled() {
- return null;
- }
+ }
- private GeneralBuildingBlock getGeneralBuildingBlockValue() {
- final GeneralBuildingBlock buildingBlock = new GeneralBuildingBlock();
- buildingBlock.setCloudRegion(getCloudRegion());
- return buildingBlock;
- }
+ private Optional<CreateVnfResponse> getCreateVnfResponse() {
+ final CreateVnfResponse response = new CreateVnfResponse();
+ response.setJobId(JOB_ID);
+ return Optional.of(response);
+ }
- private CloudRegion getCloudRegion() {
- final CloudRegion cloudRegion = new CloudRegion();
- cloudRegion.setCloudOwner(CLOUD_OWNER);
- cloudRegion.setLcpCloudRegionId(LCP_CLOUD_REGIONID);
- cloudRegion.setTenantId(TENANT_ID);
- return cloudRegion;
- }
+ private GenericVnf getGenericVnf() {
+ final GenericVnf genericVnf = new GenericVnf();
+ genericVnf.setVnfId(VNF_ID);
+ genericVnf.setModelInfoGenericVnf(getModelInfoGenericVnf());
+ genericVnf.setVnfName(VNF_NAME);
+ return genericVnf;
+ }
- }
+ private ModelInfoGenericVnf getModelInfoGenericVnf() {
+ final ModelInfoGenericVnf modelInfoGenericVnf = new ModelInfoGenericVnf();
+ modelInfoGenericVnf.setModelInstanceName(MODEL_INSTANCE_NAME);
+ return modelInfoGenericVnf;
+ }
+ private VnfmAdapterCreateVnfTask getEtsiVnfInstantiateTask() {
+ return new VnfmAdapterCreateVnfTask(exceptionUtil, extractPojosForBB, mockedVnfmAdapterServiceProvider);
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java
index 0f443916c4..79894d513d 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java
@@ -28,23 +28,18 @@ import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;
import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.DUMMY_GENERIC_VND_ID;
import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.TestConstants.getVnfmBasicHttpConfigProvider;
-
import java.util.UUID;
-
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
-import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.VnfmAdapterServiceProvider;
-import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.VnfmAdapterServiceProviderImpl;
-import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.VnfmAdapterUrlProvider;
import org.onap.so.rest.exceptions.RestProcessingException;
import org.onap.so.rest.service.HttpRestServiceProvider;
import org.onap.vnfmadapter.v1.model.CreateVnfRequest;
import org.onap.vnfmadapter.v1.model.CreateVnfResponse;
+import org.onap.vnfmadapter.v1.model.DeleteVnfResponse;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
-
import com.google.common.base.Optional;
@@ -66,6 +61,9 @@ public class VnfmAdapterServiceProviderImplTest {
@Mock
private ResponseEntity<CreateVnfResponse> mockedResponseEntity;
+ @Mock
+ private ResponseEntity<DeleteVnfResponse> deleteVnfResponse;
+
@Test
public void testInvokeCreateInstantiationRequest_httpServiceProviderReturnsStatusAcceptedWithBody_validResponse() {
@@ -120,6 +118,67 @@ public class VnfmAdapterServiceProviderImplTest {
}
+ @Test
+ public void testInvokeDeleteRequest() {
+ when(mockedHttpServiceProvider.deleteHttpRequest(anyString(), eq(DeleteVnfResponse.class)))
+ .thenReturn(deleteVnfResponse);
+ when(deleteVnfResponse.getStatusCode()).thenReturn(HttpStatus.ACCEPTED);
+ when(deleteVnfResponse.hasBody()).thenReturn(true);
+ final DeleteVnfResponse response = getDeleteVnfResponse(DUMMY_JOB_ID);
+ when(deleteVnfResponse.getBody()).thenReturn(response);
+ final VnfmAdapterServiceProvider objUnderTest =
+ new VnfmAdapterServiceProviderImpl(getVnfmAdapterUrlProvider(), mockedHttpServiceProvider);
+ final Optional<DeleteVnfResponse> actual = objUnderTest.invokeDeleteRequest(DUMMY_GENERIC_VND_ID);
+ assertTrue(actual.isPresent());
+ }
+
+ @Test
+ public void testInvokeDeleteRequestNotAccepted() {
+ when(mockedHttpServiceProvider.deleteHttpRequest(anyString(), eq(DeleteVnfResponse.class)))
+ .thenReturn(deleteVnfResponse);
+ when(deleteVnfResponse.getStatusCode()).thenReturn(HttpStatus.BAD_GATEWAY);
+ final VnfmAdapterServiceProvider objUnderTest =
+ new VnfmAdapterServiceProviderImpl(getVnfmAdapterUrlProvider(), mockedHttpServiceProvider);
+ final Optional<DeleteVnfResponse> actual = objUnderTest.invokeDeleteRequest(DUMMY_GENERIC_VND_ID);
+ assertFalse(actual.isPresent());
+ }
+
+ @Test
+ public void testInvokeDeleteRequestNoBody() {
+ when(mockedHttpServiceProvider.deleteHttpRequest(anyString(), eq(DeleteVnfResponse.class)))
+ .thenReturn(deleteVnfResponse);
+ when(deleteVnfResponse.getStatusCode()).thenReturn(HttpStatus.ACCEPTED);
+ when(deleteVnfResponse.hasBody()).thenReturn(false);
+ final VnfmAdapterServiceProvider objUnderTest =
+ new VnfmAdapterServiceProviderImpl(getVnfmAdapterUrlProvider(), mockedHttpServiceProvider);
+ final Optional<DeleteVnfResponse> actual = objUnderTest.invokeDeleteRequest(DUMMY_GENERIC_VND_ID);
+ assertFalse(actual.isPresent());
+ }
+
+ @Test
+ public void testInvokeDeleteRequestNoJobId() {
+ when(mockedHttpServiceProvider.deleteHttpRequest(anyString(), eq(DeleteVnfResponse.class)))
+ .thenReturn(deleteVnfResponse);
+ when(deleteVnfResponse.getStatusCode()).thenReturn(HttpStatus.ACCEPTED);
+ when(deleteVnfResponse.hasBody()).thenReturn(true);
+ final DeleteVnfResponse response = getDeleteVnfResponse("");
+ when(deleteVnfResponse.getBody()).thenReturn(response);
+ final VnfmAdapterServiceProvider objUnderTest =
+ new VnfmAdapterServiceProviderImpl(getVnfmAdapterUrlProvider(), mockedHttpServiceProvider);
+ final Optional<DeleteVnfResponse> actual = objUnderTest.invokeDeleteRequest(DUMMY_GENERIC_VND_ID);
+ assertFalse(actual.isPresent());
+ }
+
+ @Test
+ public void testInvokeDeleteRequestException() {
+ when(mockedHttpServiceProvider.deleteHttpRequest(anyString(), eq(DeleteVnfResponse.class)))
+ .thenThrow(RestProcessingException.class);
+ final VnfmAdapterServiceProvider objUnderTest =
+ new VnfmAdapterServiceProviderImpl(getVnfmAdapterUrlProvider(), mockedHttpServiceProvider);
+ final Optional<DeleteVnfResponse> actual = objUnderTest.invokeDeleteRequest(DUMMY_GENERIC_VND_ID);
+ assertFalse(actual.isPresent());
+ }
+
private void assertWithJobId(final String jobId) {
when(mockedHttpServiceProvider.postHttpRequest(eq(CREATE_VNF_REQUEST), anyString(),
@@ -160,6 +219,12 @@ public class VnfmAdapterServiceProviderImplTest {
return response;
}
+ private DeleteVnfResponse getDeleteVnfResponse(final String jobId) {
+ final DeleteVnfResponse response = new DeleteVnfResponse();
+ response.setJobId(jobId);
+ return response;
+ }
+
private VnfmAdapterUrlProvider getVnfmAdapterUrlProvider() {
return new VnfmAdapterUrlProvider(getVnfmBasicHttpConfigProvider());
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/SniroHomingV2IT.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/SniroHomingV2IT.java
index c4129a3b96..b50cd69f73 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/SniroHomingV2IT.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/SniroHomingV2IT.java
@@ -22,7 +22,6 @@ package org.onap.so.bpmn.infrastructure.flowspecific.tasks;
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;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -41,6 +40,7 @@ import org.json.JSONObject;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
+import org.onap.so.BaseIntegrationTest;
import org.onap.so.bpmn.servicedecomposition.bbobjects.AllottedResource;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
@@ -53,7 +53,7 @@ import org.onap.so.bpmn.servicedecomposition.homingobjects.Candidate;
import org.onap.so.bpmn.servicedecomposition.homingobjects.CandidateType;
import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.sniro.beans.SniroManagerRequest;
-import org.onap.so.BaseIntegrationTest;
+
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -117,7 +117,7 @@ public class SniroHomingV2IT extends BaseIntegrationTest{
public void testCallSniro_success_1VpnLink() throws BadResponseException, IOException{
beforeVpnBondingLink("1");
- stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
+ wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -138,7 +138,7 @@ public class SniroHomingV2IT extends BaseIntegrationTest{
beforeVpnBondingLink("2");
beforeVpnBondingLink("3");
- stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
+ wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -157,7 +157,7 @@ public class SniroHomingV2IT extends BaseIntegrationTest{
public void testCallSniro_success_3Allotteds() throws BadResponseException, JsonProcessingException{
beforeAllottedResource();
- stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
+ wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -176,7 +176,7 @@ public class SniroHomingV2IT extends BaseIntegrationTest{
public void testCallSniro_success_1Vnf() throws JsonProcessingException, BadResponseException{
beforeVnf();
- stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
+ wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -193,7 +193,7 @@ public class SniroHomingV2IT extends BaseIntegrationTest{
beforeAllottedResource();
beforeVnf();
- stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
+ wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -482,7 +482,7 @@ public class SniroHomingV2IT extends BaseIntegrationTest{
beforeAllottedResource();
mockResponse = "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"\", \"requestStatus\": \"failed\"}";
- stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
+ wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/NetworkAdapterClientIT.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/NetworkAdapterClientIT.java
index 1bcc464fa0..fe9e1c1608 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/NetworkAdapterClientIT.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/NetworkAdapterClientIT.java
@@ -21,15 +21,17 @@
package org.onap.so.client.adapter.network;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.delete;
import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
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.put;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+
import javax.ws.rs.core.Response;
+
import org.junit.BeforeClass;
import org.junit.Test;
import org.onap.so.BaseIntegrationTest;
@@ -74,7 +76,7 @@ public class NetworkAdapterClientIT extends BaseIntegrationTest{
CreateNetworkResponse mockResponse = new CreateNetworkResponse();
mockResponse.setNetworkCreated(true);
- stubFor(post(urlPathEqualTo(REST_ENDPOINT))
+ wireMockServer.stubFor(post(urlPathEqualTo(REST_ENDPOINT))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(mapper.writeValueAsString(mockResponse)).withStatus(200)));
@@ -89,7 +91,7 @@ public class NetworkAdapterClientIT extends BaseIntegrationTest{
CreateNetworkError mockResponse = new CreateNetworkError();
mockResponse.setMessage("Error in create network");
- stubFor(post(urlPathEqualTo(REST_ENDPOINT))
+ wireMockServer.stubFor(post(urlPathEqualTo(REST_ENDPOINT))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(mapper.writeValueAsString(mockResponse)).withStatus(500)));
@@ -104,7 +106,7 @@ public class NetworkAdapterClientIT extends BaseIntegrationTest{
DeleteNetworkResponse mockResponse = new DeleteNetworkResponse();
mockResponse.setNetworkDeleted(true);
- stubFor(post(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID))
+ wireMockServer.stubFor(delete(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(mapper.writeValueAsString(mockResponse)).withStatus(200)));
@@ -119,7 +121,7 @@ public class NetworkAdapterClientIT extends BaseIntegrationTest{
DeleteNetworkError mockResponse = new DeleteNetworkError();
mockResponse.setMessage("Error in delete network");
- stubFor(post(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID))
+ wireMockServer.stubFor(delete(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(mapper.writeValueAsString(mockResponse)).withStatus(500)));
@@ -136,7 +138,7 @@ public class NetworkAdapterClientIT extends BaseIntegrationTest{
RollbackNetworkResponse mockResponse = new RollbackNetworkResponse();
mockResponse.setNetworkRolledBack(true);
- stubFor(post(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID))
+ wireMockServer.stubFor(delete(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(mapper.writeValueAsString(mockResponse)).withStatus(200)));
@@ -154,7 +156,7 @@ public class NetworkAdapterClientIT extends BaseIntegrationTest{
RollbackNetworkError mockResponse = new RollbackNetworkError();
mockResponse.setMessage("Error in rollback network");
- stubFor(post(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID))
+ wireMockServer.stubFor(delete(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(mapper.writeValueAsString(mockResponse)).withStatus(500)));
@@ -166,7 +168,7 @@ public class NetworkAdapterClientIT extends BaseIntegrationTest{
QueryNetworkResponse mockResponse = new QueryNetworkResponse();
mockResponse.setNetworkExists(true);
- stubFor(get(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID)).withQueryParam("cloudSiteId", equalTo(TESTING_ID))
+ wireMockServer.stubFor(get(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID)).withQueryParam("cloudSiteId", equalTo(TESTING_ID))
.withQueryParam("tenantId", equalTo(TESTING_ID))
.withQueryParam("networkStackId", equalTo("networkStackId")).withQueryParam("skipAAI", equalTo("true"))
.withQueryParam("msoRequest.requestId", equalTo("testRequestId"))
@@ -184,7 +186,7 @@ public class NetworkAdapterClientIT extends BaseIntegrationTest{
QueryNetworkError mockResponse = new QueryNetworkError();
mockResponse.setMessage("Error in query network");
- stubFor(get(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID)).withQueryParam("cloudSiteId", equalTo(TESTING_ID))
+ wireMockServer.stubFor(get(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID)).withQueryParam("cloudSiteId", equalTo(TESTING_ID))
.withQueryParam("tenantId", equalTo(TESTING_ID))
.withQueryParam("networkStackId", equalTo("networkStackId")).withQueryParam("skipAAI", equalTo("true"))
.withQueryParam("msoRequest.requestId", equalTo("testRequestId"))
@@ -204,7 +206,7 @@ public class NetworkAdapterClientIT extends BaseIntegrationTest{
UpdateNetworkResponse mockResponse = new UpdateNetworkResponse();
mockResponse.setNetworkId("test1");
- stubFor(put(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID))
+ wireMockServer.stubFor(put(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(mapper.writeValueAsString(mockResponse)).withStatus(200)));
@@ -220,7 +222,7 @@ public class NetworkAdapterClientIT extends BaseIntegrationTest{
UpdateNetworkResponse mockResponse = new UpdateNetworkResponse();
mockResponse.setNetworkId("test1");
- stubFor(put(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID))
+ wireMockServer.stubFor(put(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(mapper.writeValueAsString(mockResponse)).withStatus(200)));
@@ -236,7 +238,7 @@ public class NetworkAdapterClientIT extends BaseIntegrationTest{
UpdateNetworkError mockResponse = new UpdateNetworkError();
mockResponse.setMessage("Error in update network");
- stubFor(put(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID))
+ wireMockServer.stubFor(put(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(mapper.writeValueAsString(mockResponse)).withStatus(500)));
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/VnfAdapterClientIT.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/VnfAdapterClientIT.java
index 3387920d40..90e99eb0ad 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/VnfAdapterClientIT.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/VnfAdapterClientIT.java
@@ -21,11 +21,11 @@
package org.onap.so.client.adapter.vnf;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.delete;
import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
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.put;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static org.junit.Assert.assertEquals;
@@ -70,7 +70,7 @@ public class VnfAdapterClientIT extends BaseIntegrationTest{
CreateVfModuleResponse mockResponse = new CreateVfModuleResponse();
mockResponse.setVfModuleCreated(true);
- stubFor(post(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules"))
+ wireMockServer.stubFor(post(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules"))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(mapper.writeValueAsString(mockResponse)).withStatus(200)));
@@ -85,7 +85,7 @@ public class VnfAdapterClientIT extends BaseIntegrationTest{
VfModuleExceptionResponse mockResponse = new VfModuleExceptionResponse();
mockResponse.setMessage("Error in create Vf module");
- stubFor(post(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules"))
+ wireMockServer.stubFor(post(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules"))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(mapper.writeValueAsString(mockResponse)).withStatus(500)));
@@ -101,8 +101,8 @@ public class VnfAdapterClientIT extends BaseIntegrationTest{
RollbackVfModuleResponse mockResponse = new RollbackVfModuleResponse();
mockResponse.setVfModuleRolledback(true);
- stubFor(
- post(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID + "/rollback"))
+ wireMockServer.stubFor(
+ delete(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID + "/rollback"))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(mapper.writeValueAsString(mockResponse)).withStatus(200)));
@@ -119,8 +119,8 @@ public class VnfAdapterClientIT extends BaseIntegrationTest{
VfModuleExceptionResponse mockResponse = new VfModuleExceptionResponse();
mockResponse.setMessage("Error in rollback Vf module");
- stubFor(
- post(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID + "/rollback"))
+ wireMockServer.stubFor(
+ delete(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID + "/rollback"))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(mapper.writeValueAsString(mockResponse)).withStatus(500)));
@@ -134,7 +134,7 @@ public class VnfAdapterClientIT extends BaseIntegrationTest{
DeleteVfModuleResponse mockResponse = new DeleteVfModuleResponse();
mockResponse.setVfModuleDeleted(true);
- stubFor(post(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID))
+ wireMockServer.stubFor(delete(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(mapper.writeValueAsString(mockResponse)).withStatus(200)));
@@ -149,7 +149,7 @@ public class VnfAdapterClientIT extends BaseIntegrationTest{
VfModuleExceptionResponse mockResponse = new VfModuleExceptionResponse();
mockResponse.setMessage("Error in delete Vf module");
- stubFor(post(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID))
+ wireMockServer.stubFor(delete(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(mapper.writeValueAsString(mockResponse)).withStatus(500)));
@@ -164,7 +164,7 @@ public class VnfAdapterClientIT extends BaseIntegrationTest{
UpdateVfModuleResponse mockResponse = new UpdateVfModuleResponse();
mockResponse.setVfModuleId("test1");
- stubFor(put(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID))
+ wireMockServer.stubFor(put(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(mapper.writeValueAsString(mockResponse)).withStatus(200)));
@@ -180,7 +180,7 @@ public class VnfAdapterClientIT extends BaseIntegrationTest{
VfModuleExceptionResponse mockResponse = new VfModuleExceptionResponse();
mockResponse.setMessage("Error in update Vf module");
- stubFor(put(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID))
+ wireMockServer.stubFor(put(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(mapper.writeValueAsString(mockResponse)).withStatus(500)));
@@ -192,7 +192,7 @@ public class VnfAdapterClientIT extends BaseIntegrationTest{
QueryVfModuleResponse mockResponse = new QueryVfModuleResponse();
mockResponse.setVnfId(AAI_VNF_ID);
mockResponse.setVfModuleId(AAI_VF_MODULE_ID);
- stubFor(get(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID))
+ wireMockServer.stubFor(get(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID))
.withQueryParam("cloudSiteId", equalTo(TESTING_ID))
.withQueryParam("tenantId", equalTo(TESTING_ID))
.withQueryParam("vfModuleName", equalTo("someName"))
@@ -210,7 +210,7 @@ public class VnfAdapterClientIT extends BaseIntegrationTest{
public void queryVfModuleTestThrowException() throws JsonProcessingException, VnfAdapterClientException {
VfModuleExceptionResponse mockResponse = new VfModuleExceptionResponse();
mockResponse.setMessage("Error in update Vf module");
- stubFor(get(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID))
+ wireMockServer.stubFor(get(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID))
.withQueryParam("cloudSiteId", equalTo(TESTING_ID))
.withQueryParam("tenantId", equalTo(TESTING_ID))
.withQueryParam("vfModuleName", equalTo("someName"))
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientIT.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientIT.java
index 40b6498034..4a006f8b66 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientIT.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/vnf/VnfVolumeAdapterClientIT.java
@@ -44,8 +44,6 @@ import org.onap.so.adapters.vnfrest.UpdateVolumeGroupResponse;
import org.onap.so.client.adapter.rest.AdapterRestClient;
import org.onap.so.BaseIntegrationTest;
-
-@RunWith(MockitoJUnitRunner.Silent.class)
public class VnfVolumeAdapterClientIT extends BaseIntegrationTest{
private static final String TESTING_ID = "___TESTING___";
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/namingservice/NamingClientTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/namingservice/NamingClientTest.java
index d6f8c70aa1..4bae5b40e4 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/namingservice/NamingClientTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/namingservice/NamingClientTest.java
@@ -23,7 +23,6 @@ package org.onap.so.client.namingservice;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.delete;
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.urlPathEqualTo;
import static org.junit.Assert.assertTrue;
@@ -55,7 +54,7 @@ public class NamingClientTest extends BaseIntegrationTest{
@Test
public void assignNameGenRequest() throws BadResponseException, IOException{
- stubFor(post(urlPathEqualTo("/web/service/v1/genNetworkElementName"))
+ wireMockServer.stubFor(post(urlPathEqualTo("/web/service/v1/genNetworkElementName"))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBodyFile("NamingClient/AssignResponse.json")
.withStatus(HttpStatus.SC_ACCEPTED)));
@@ -66,7 +65,7 @@ public class NamingClientTest extends BaseIntegrationTest{
}
@Test
public void assignNameGenRequestError() throws BadResponseException, IOException{
- stubFor(post(urlPathEqualTo("/web/service/v1/genNetworkElementName"))
+ wireMockServer.stubFor(post(urlPathEqualTo("/web/service/v1/genNetworkElementName"))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBodyFile("NamingClient/ErrorResponse.json")
.withStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR)));
@@ -78,7 +77,7 @@ public class NamingClientTest extends BaseIntegrationTest{
}
@Test
public void unassignNameGenRequest() throws BadResponseException, IOException{
- stubFor(delete(urlPathEqualTo("/web/service/v1/genNetworkElementName"))
+ wireMockServer.stubFor(delete(urlPathEqualTo("/web/service/v1/genNetworkElementName"))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBodyFile("NamingClient/UnassignResponse.json")
.withStatus(HttpStatus.SC_ACCEPTED)));
@@ -88,7 +87,7 @@ public class NamingClientTest extends BaseIntegrationTest{
}
@Test
public void unassignNameGenRequestError() throws BadResponseException, IOException{
- stubFor(delete(urlPathEqualTo("/web/service/v1/genNetworkElementName"))
+ wireMockServer.stubFor(delete(urlPathEqualTo("/web/service/v1/genNetworkElementName"))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBodyFile("NamingClient/ErrorResponse.json")
.withStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR)));
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/oof/OofClientTestIT.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/oof/OofClientTestIT.java
index 0b33b1d187..05ba512c9d 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/oof/OofClientTestIT.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/oof/OofClientTestIT.java
@@ -22,7 +22,6 @@ package org.onap.so.client.oof;
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;
import org.junit.Test;
@@ -44,7 +43,7 @@ public class OofClientTestIT extends BaseIntegrationTest {
public void testPostDemands_success() throws BadResponseException, JsonProcessingException {
String mockResponse = "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"status\", \"requestStatus\": \"accepted\"}";
- stubFor(post(urlEqualTo("/api/oof/v1/placement"))
+ wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -56,7 +55,7 @@ public class OofClientTestIT extends BaseIntegrationTest {
public void testAsyncResponse_success() throws BadResponseException, JsonProcessingException {
String mockResponse = "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"status\", \"requestStatus\": \"accepted\"}";
- stubFor(post(urlEqualTo("/api/oof/v1/placement"))
+ wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -68,7 +67,7 @@ public class OofClientTestIT extends BaseIntegrationTest {
public void testPostDemands_error_failed() throws JsonProcessingException, BadResponseException {
String mockResponse = "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"missing data\", \"requestStatus\": \"failed\"}";
- stubFor(post(urlEqualTo("/api/oof/v1/placement"))
+ wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -84,7 +83,7 @@ public class OofClientTestIT extends BaseIntegrationTest {
public void testPostDemands_error_noMessage() throws JsonProcessingException, BadResponseException {
String mockResponse = "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"\", \"requestStatus\": \"failed\"}";
- stubFor(post(urlEqualTo("/api/oof/v1/placement"))
+ wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -98,7 +97,7 @@ public class OofClientTestIT extends BaseIntegrationTest {
public void testPostDemands_error_noStatus() throws JsonProcessingException, BadResponseException {
String mockResponse = "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"missing data\", \"requestStatus\": null}";
- stubFor(post(urlEqualTo("/api/oof/v1/placement"))
+ wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -112,7 +111,7 @@ public class OofClientTestIT extends BaseIntegrationTest {
public void testPostDemands_error_empty() throws JsonProcessingException, BadResponseException {
String mockResponse = "{ }";
- stubFor(post(urlEqualTo("/api/oof/v1/placement"))
+ wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/SDNCClientIT.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/SDNCClientIT.java
index 9117b8ea64..70f196db8c 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/SDNCClientIT.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/SDNCClientIT.java
@@ -23,7 +23,6 @@ package org.onap.so.client.sdnc;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
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.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
@@ -46,7 +45,7 @@ public class SDNCClientIT extends BaseIntegrationTest {
String responseJson = new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "SDNCClientGetResponse.json")));
String queryLink = "/topologyQuery";
- stubFor(get(urlEqualTo(queryLink))
+ wireMockServer.stubFor(get(urlEqualTo(queryLink))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json").withBody(responseJson)));
String response = SPY_sdncClient.get(queryLink);
@@ -59,7 +58,7 @@ public class SDNCClientIT extends BaseIntegrationTest {
String queryLink = "/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation/";
- stubFor(post(urlMatching(queryLink))
+ wireMockServer.stubFor(post(urlMatching(queryLink))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json").withBody(responseJson)));
@@ -72,7 +71,7 @@ public class SDNCClientIT extends BaseIntegrationTest {
String queryLink = "/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation/";
- stubFor(post(urlMatching(queryLink))
+ wireMockServer.stubFor(post(urlMatching(queryLink))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json").withBody(responseJson)));
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapperTest.java
index 0ca80c75f7..302bb551c3 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/GCTopologyOperationRequestMapperTest.java
@@ -75,6 +75,7 @@ public class GCTopologyOperationRequestMapperTest extends TestDataSetup {
Assert.assertEquals("VLAN-NETWORK-RECEPTOR", genericInfo.getConfigurationInformation().getConfigurationType());
Assert.assertEquals("uuid",genericInfo.getSdncRequestHeader().getSvcRequestId());
Assert.assertEquals("http://localhost",genericInfo.getSdncRequestHeader().getSvcNotificationUrl());
+ Assert.assertEquals("MsoRequestId",genericInfo.getRequestInformation().getRequestId());
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapperTest.java
index 6a14f8b567..1bfa78ad6d 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/NetworkTopologyOperationRequestMapperTest.java
@@ -23,6 +23,7 @@ package org.onap.so.client.sdnc.mapper;
import static com.shazam.shazamcrest.MatcherAssert.assertThat;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import java.io.IOException;
@@ -109,6 +110,7 @@ public class NetworkTopologyOperationRequestMapperTest {
userParams.put("key1", "value1");
requestContext.setUserParams(userParams);
requestContext.setProductFamilyId("productFamilyId");
+ requestContext.setMsoRequestId("MsoRequestId");
network = new L3Network();
network.setNetworkId("TEST_NETWORK_ID");
@@ -138,8 +140,24 @@ public class NetworkTopologyOperationRequestMapperTest {
assertThat(networkSDNCrequest, sameBeanAs(reqMapper1).ignoring("sdncRequestHeader.svcRequestId")
.ignoring("requestInformation.requestId"));
+ assertEquals("MsoRequestId", networkSDNCrequest.getRequestInformation().getRequestId());
}
+
+ @Test
+ public void createGenericResourceApiNetworkOperationInformationReqContextNullTest() throws Exception {
+ RequestContext rc = new RequestContext();
+ rc.setMsoRequestId(null);
+ GenericResourceApiNetworkOperationInformation networkSDNCrequest = mapper.reqMapper(
+ SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN, GenericResourceApiRequestActionEnumeration.CREATENETWORKINSTANCE, network, serviceInstance, customer,
+ rc, cloudRegion);
+ assertNotNull(networkSDNCrequest.getRequestInformation().getRequestId());
+ GenericResourceApiNetworkOperationInformation networkSDNCrequest2 = mapper.reqMapper(
+ SDNCSvcOperation.NETWORK_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN, GenericResourceApiRequestActionEnumeration.CREATENETWORKINSTANCE, network, serviceInstance, customer,
+ null, cloudRegion);
+ assertNotNull(networkSDNCrequest2.getRequestInformation().getRequestId());
+ }
+
@Test
public void reqMapperTest() throws Exception {
@@ -175,7 +193,8 @@ public class NetworkTopologyOperationRequestMapperTest {
assertThat(reqMapperUnassign, sameBeanAs(networkSDNCrequestUnassign).ignoring("sdncRequestHeader.svcRequestId")
.ignoring("requestInformation.requestId"));
-
+ assertEquals("MsoRequestId", networkSDNCrequestUnassign.getRequestInformation().getRequestId());
+
}
@Test
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapperTest.java
index 0bf06a0bb0..1919ef437b 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/ServiceTopologyOperationMapperTest.java
@@ -22,6 +22,8 @@ package org.onap.so.client.sdnc.mapper;
import static com.shazam.shazamcrest.MatcherAssert.assertThat;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import java.nio.file.Files;
import java.nio.file.Paths;
@@ -80,10 +82,14 @@ public class ServiceTopologyOperationMapperTest {
userParams.put("key1", "value1");
requestContext.setUserParams(userParams);
requestContext.setProductFamilyId("productFamilyId");
+ requestContext.setMsoRequestId("MsoRequestId");
GenericResourceApiServiceOperationInformation serviceOpInformation = mapper.reqMapper(
SDNCSvcOperation.SERVICE_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN, GenericResourceApiRequestActionEnumeration.CREATESERVICEINSTANCE, serviceInstance, customer,
requestContext);
+ GenericResourceApiServiceOperationInformation serviceOpInformationNullReqContext = mapper.reqMapper(
+ SDNCSvcOperation.SERVICE_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN, GenericResourceApiRequestActionEnumeration.CREATESERVICEINSTANCE, serviceInstance, customer,
+ null);
String jsonToCompare = new String(Files.readAllBytes(Paths.get("src/test/resources/__files/BuildingBlocks/genericResourceApiEcompModelInformation.json")));
@@ -92,5 +98,7 @@ public class ServiceTopologyOperationMapperTest {
GenericResourceApiOnapmodelinformationOnapModelInformation.class);
assertThat(reqMapper1, sameBeanAs(serviceOpInformation.getServiceInformation().getOnapModelInformation()));
+ assertEquals("MsoRequestId", serviceOpInformation.getRequestInformation().getRequestId());
+ assertNotNull(serviceOpInformationNullReqContext.getRequestInformation().getRequestId());
}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java
index 282f23caa7..7fce8c48c8 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapperTest.java
@@ -23,6 +23,7 @@ package org.onap.so.client.sdnc.mapper;
import static com.shazam.shazamcrest.MatcherAssert.assertThat;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import java.nio.file.Files;
@@ -102,6 +103,7 @@ public class VfModuleTopologyOperationRequestMapperTest {
RequestParameters requestParameters = new RequestParameters();
requestParameters.setUsePreload(true);
requestContext.setRequestParameters(requestParameters);
+ requestContext.setMsoRequestId("MsoRequestId");
GenericVnf vnf = new GenericVnf();
vnf.setVnfId("testVnfId");
@@ -148,6 +150,7 @@ public class VfModuleTopologyOperationRequestMapperTest {
assertThat(reqMapper1, sameBeanAs(vfModuleSDNCrequest).ignoring("sdncRequestHeader.svcRequestId")
.ignoring("requestInformation.requestId"));
+ assertEquals("MsoRequestId", vfModuleSDNCrequest.getRequestInformation().getRequestId());
}
@Test
@@ -168,10 +171,13 @@ public class VfModuleTopologyOperationRequestMapperTest {
VfModule vfModule = new VfModule();
vfModule.setVfModuleId("testVfModuleId");
vfModule.setVfModuleName("testVfModuleName");
+
+ RequestContext requestContext = new RequestContext();
+ requestContext.setMsoRequestId("MsoRequestId");
GenericResourceApiVfModuleOperationInformation vfModuleSDNCrequest = mapper.reqMapper(
SDNCSvcOperation.VF_MODULE_TOPOLOGY_OPERATION, SDNCSvcAction.UNASSIGN, vfModule, null, vnf, serviceInstance, null,
- null, null, null);
+ null, requestContext, null);
String jsonToCompare = new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "genericResourceApiVfModuleOperationInformationUnassign.json")));
@@ -182,6 +188,35 @@ public class VfModuleTopologyOperationRequestMapperTest {
assertThat(reqMapper1, sameBeanAs(vfModuleSDNCrequest).ignoring("sdncRequestHeader.svcRequestId")
.ignoring("requestInformation.requestId"));
+ assertEquals("MsoRequestId", vfModuleSDNCrequest.getRequestInformation().getRequestId());
+ }
+
+ @Test
+ public void unassignGenericResourceApiVfModuleInformationNullMsoReqIdTest() throws Exception {
+
+ // prepare and set service instance
+ ServiceInstance serviceInstance = new ServiceInstance();
+ serviceInstance.setServiceInstanceId("serviceInstanceId");
+
+ // prepare and set vnf instance
+
+ GenericVnf vnf = new GenericVnf();
+ vnf.setVnfId("testVnfId");
+ vnf.setVnfType("testVnfType");
+
+ // prepare and set vf module instance
+
+ VfModule vfModule = new VfModule();
+ vfModule.setVfModuleId("testVfModuleId");
+ vfModule.setVfModuleName("testVfModuleName");
+
+ RequestContext requestContext = new RequestContext();
+
+ GenericResourceApiVfModuleOperationInformation vfModuleSDNCrequest = mapper.reqMapper(
+ SDNCSvcOperation.VF_MODULE_TOPOLOGY_OPERATION, SDNCSvcAction.UNASSIGN, vfModule, null, vnf, serviceInstance, null,
+ null, requestContext, null);
+
+ assertNotNull(vfModuleSDNCrequest.getRequestInformation().getRequestId());
}
@Test
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java
index 229a8cf601..64b532fd07 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java
@@ -21,6 +21,7 @@
package org.onap.so.client.sdnc.mapper;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import java.util.ArrayList;
@@ -122,12 +123,16 @@ public class VnfTopologyOperationRequestMapperTest {
userParams.put("key1", "value1");
requestContext.setUserParams(userParams);
requestContext.setProductFamilyId("productFamilyId");
+ requestContext.setMsoRequestId("MsoRequestId");
CloudRegion cloudRegion = new CloudRegion();
GenericResourceApiVnfOperationInformation vnfOpInformation = mapper.reqMapper(
SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN,GenericResourceApiRequestActionEnumeration.CREATEVNFINSTANCE, vnf, serviceInstance, customer,
cloudRegion, requestContext,true);
+ GenericResourceApiVnfOperationInformation vnfOpInformationNullReqContext = mapper.reqMapper(
+ SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN,GenericResourceApiRequestActionEnumeration.CREATEVNFINSTANCE, vnf, serviceInstance, customer,
+ cloudRegion, null,true);
assertNull(vnfOpInformation.getServiceInformation().getOnapModelInformation().getModelCustomizationUuid());
assertEquals("vnfModelCustomizationUUID", vnfOpInformation.getVnfInformation().getOnapModelInformation().getModelCustomizationUuid());
@@ -136,5 +141,7 @@ public class VnfTopologyOperationRequestMapperTest {
assertEquals("l3-network-ig-222", vnfOpInformation.getVnfRequestInput().getVnfNetworkInstanceGroupIds().get(1).getVnfNetworkInstanceGroupId());
assertEquals("entitlementPoolUuid", vnfOpInformation.getVnfRequestInput().getVnfInputParameters().getParam().get(1).getValue());
assertEquals("licenseKeyGroupUuid", vnfOpInformation.getVnfRequestInput().getVnfInputParameters().getParam().get(2).getValue());
+ assertEquals("MsoRequestId", vnfOpInformation.getRequestInformation().getRequestId());
+ assertNotNull(vnfOpInformationNullReqContext.getRequestInformation().getRequestId());
}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sniro/SniroClientTestIT.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sniro/SniroClientTestIT.java
index 3387e9ddef..722180f54b 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sniro/SniroClientTestIT.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sniro/SniroClientTestIT.java
@@ -22,7 +22,6 @@ package org.onap.so.client.sniro;
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;
import org.junit.Test;
@@ -45,7 +44,7 @@ public class SniroClientTestIT extends BaseIntegrationTest {
public void testPostDemands_success() throws BadResponseException, JsonProcessingException {
String mockResponse = "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"corys cool\", \"requestStatus\": \"accepted\"}";
- stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
+ wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -58,7 +57,7 @@ public class SniroClientTestIT extends BaseIntegrationTest {
public void testPostDemands_error_failed() throws JsonProcessingException, BadResponseException {
String mockResponse = "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"missing data\", \"requestStatus\": \"failed\"}";
- stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
+ wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -74,7 +73,7 @@ public class SniroClientTestIT extends BaseIntegrationTest {
public void testPostDemands_error_noMessage() throws JsonProcessingException, BadResponseException {
String mockResponse = "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"\", \"requestStatus\": \"failed\"}";
- stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
+ wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -88,7 +87,7 @@ public class SniroClientTestIT extends BaseIntegrationTest {
public void testPostDemands_error_noStatus() throws JsonProcessingException, BadResponseException {
String mockResponse = "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"missing data\", \"requestStatus\": null}";
- stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
+ wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -102,7 +101,7 @@ public class SniroClientTestIT extends BaseIntegrationTest {
public void testPostDemands_error_empty() throws JsonProcessingException, BadResponseException {
String mockResponse = "{ }";
- stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
+ wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -115,7 +114,7 @@ public class SniroClientTestIT extends BaseIntegrationTest {
public void testPostRelease_success() throws BadResponseException, JsonProcessingException {
String mockResponse = "{\"status\": \"success\", \"message\": \"corys cool\"}";
- stubFor(post(urlEqualTo("/v1/release-orders"))
+ wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -127,7 +126,7 @@ public class SniroClientTestIT extends BaseIntegrationTest {
public void testPostRelease_error_failed() throws BadResponseException, JsonProcessingException {
String mockResponse = "{\"status\": \"failure\", \"message\": \"corys cool\"}";
- stubFor(post(urlEqualTo("/v1/release-orders"))
+ wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -139,7 +138,7 @@ public class SniroClientTestIT extends BaseIntegrationTest {
public void testPostRelease_error_noStatus() throws BadResponseException, JsonProcessingException {
String mockResponse = "{\"status\": \"\", \"message\": \"corys cool\"}";
- stubFor(post(urlEqualTo("/v1/release-orders"))
+ wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -152,7 +151,7 @@ public class SniroClientTestIT extends BaseIntegrationTest {
public void testPostRelease_error_noMessage() throws BadResponseException, JsonProcessingException {
String mockResponse = "{\"status\": \"failure\", \"message\": null}";
- stubFor(post(urlEqualTo("/v1/release-orders"))
+ wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));
@@ -165,7 +164,7 @@ public class SniroClientTestIT extends BaseIntegrationTest {
public void testPostRelease_error_empty() throws BadResponseException, JsonProcessingException {
String mockResponse = "{ }";
- stubFor(post(urlEqualTo("/v1/release-orders"))
+ wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders"))
.willReturn(aResponse().withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody(mockResponse)));