2  * ============LICENSE_START=======================================================
 
   4  * ================================================================================
 
   5  * Copyright (C) 2020  Tech Mahindra
 
   6  * ================================================================================
 
   7  * Licensed under the Apache License, Version 2.0 (the "License");
 
   8  * you may not use this file except in compliance with the License.
 
   9  * You may obtain a copy of the License at
 
  11  *      http://www.apache.org/licenses/LICENSE-2.0
 
  13  * Unless required by applicable law or agreed to in writing, software
 
  14  * distributed under the License is distributed on an "AS IS" BASIS,
 
  15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
  16  * See the License for the specific language governing permissions and
 
  17  * limitations under the License.
 
  18  * ============LICENSE_END=========================================================
 
  21 package org.onap.so.bpmn.infrastructure.scripts
 
  23 import static org.junit.Assert.*
 
  25 import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
 
  26 import org.junit.Before
 
  28 import org.mockito.ArgumentCaptor
 
  29 import org.mockito.Captor
 
  30 import org.onap.so.bpmn.common.scripts.MsoGroovyTest
 
  31 import org.slf4j.Logger
 
  32 import org.mockito.Mockito
 
  33 import org.onap.aaiclient.client.aai.AAIObjectType
 
  34 import org.onap.aaiclient.client.aai.entities.AAIResultWrapper
 
  35 import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri
 
  36 import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory
 
  38 import static org.mockito.Mockito.spy
 
  39 import static org.mockito.Mockito.times
 
  40 import static org.mockito.Mockito.verify
 
  41 import static org.mockito.Mockito.when
 
  42 import static org.mockito.ArgumentMatchers.eq
 
  44 import javax.ws.rs.NotFoundException
 
  46 class DoActivateCoreNSSITest extends MsoGroovyTest {
 
  48     DoActivateCoreNSSI doActivate = new DoActivateCoreNSSI()
 
  50     void init() throws IOException {
 
  51         super.init("DoActivateCoreNSSI")
 
  55     static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
 
  58     void testPreProcessRequest(){
 
  60         setUpMockdataFromCommonActivateSliceSubnet()
 
  61         doActivate.preProcessRequest(mockExecution)
 
  63         Mockito.verify(mockExecution, times(1)).setVariable(eq("oStatus"), captor.capture())
 
  64         def statusValue = captor.getValue()
 
  65         assertEquals("deactivated", statusValue)
 
  67         Mockito.verify(mockExecution, times(1)).setVariable(eq("sNssai"), captor.capture())
 
  68         def sNssai = captor.getValue()
 
  69         assertEquals("01-5B179BD4", sNssai)
 
  71         Mockito.verify(mockExecution,times(3)).setVariable(captor.capture() as String, captor.capture())
 
  72         List<ExecutionEntity> values = captor.getAllValues()
 
  77     void testGetNetworkInstanceWithSPInstanceAssociatedWithNssiId(){
 
  79         setUpMockdataFromCommonActivateSliceSubnet()
 
  80         when(mockExecution.getVariable("serviceType")).thenReturn("5G")
 
  82         DoActivateCoreNSSI obj = spy(DoActivateCoreNSSI.class)
 
  83         when(obj.getAAIClient()).thenReturn(client)
 
  84         AAIResourceUri resourceUri1 = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, "5GCustomer", "5G", "NSSI-C-7Q4-HDBNJ-NSSMF-01-A-ZX")
 
  85         when(client.exists(resourceUri1)).thenReturn(true)
 
  86         AAIResultWrapper wrapper1 = new AAIResultWrapper(mockQuerySliceServiceReturn())
 
  87         when(client.get(resourceUri1, NotFoundException.class)).thenReturn(wrapper1)
 
  89         //networkServiceInstanceId
 
  90         when(mockExecution.getVariable("networkServiceInstanceId")).thenReturn("206535e7-77c9-4036-9387-3f1cf57b4379")
 
  92         AAIResourceUri resourceUri2 = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, "5GCustomer", "5G", "206535e7-77c9-4036-9387-3f1cf57b4379")
 
  93         when(client.exists(resourceUri2)).thenReturn(true)
 
  94         AAIResultWrapper wrapper2 = new AAIResultWrapper(mockQueryNS())
 
  95         when(client.get(resourceUri2, NotFoundException.class)).thenReturn(wrapper2)
 
  98         when(mockExecution.getVariable("vnfId")).thenReturn("eeb66c6f-36bd-47ad-8294-48f46b1aa912")
 
  99         AAIResourceUri resourceUri3 = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "eeb66c6f-36bd-47ad-8294-48f46b1aa912")
 
 100         when(client.exists(resourceUri3)).thenReturn(true)
 
 101         AAIResultWrapper wrapper3 = new AAIResultWrapper(mockQueryVnf())
 
 102         when(client.get(resourceUri3, NotFoundException.class)).thenReturn(wrapper3)
 
 105         //Allotted Resources-1
 
 106         //when(mockExecution.getVariable("vnfId")).thenReturn("eeb66c6f-36bd-47ad-8294-48f46b1aa912")
 
 107         AAIResourceUri resourceUri4 = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, "5GCustomer", "5G", "0d3d3cce-46a8-486d-816a-954e71697c4e")
 
 108         when(client.exists(resourceUri4)).thenReturn(true)
 
 109         AAIResultWrapper wrapper4 = new AAIResultWrapper(mockServiceProfile1())
 
 110         when(client.get(resourceUri4, NotFoundException.class)).thenReturn(wrapper4)
 
 112         //Allotted Resources-2
 
 113         //when(mockExecution.getVariable("vnfId")).thenReturn("eeb66c6f-36bd-47ad-8294-48f46b1aa912")
 
 114         AAIResourceUri resourceUri5 = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, "5GCustomer", "5G", "1c7046f2-a5a3-4d7f-9da8-388ee641a795")
 
 115         when(client.exists(resourceUri5)).thenReturn(true)
 
 116         AAIResultWrapper wrapper5 = new AAIResultWrapper(mockServiceProfile2())
 
 117         when(client.get(resourceUri5, NotFoundException.class)).thenReturn(wrapper5)
 
 119         obj.getNetworkInstanceWithSPInstanceAssociatedWithNssiId(mockExecution)
 
 121         Mockito.verify(mockExecution, times(1)).setVariable(eq("networkServiceInstanceId"), captor.capture())
 
 122         assertEquals("206535e7-77c9-4036-9387-3f1cf57b4379", captor.getValue())
 
 124         Mockito.verify(mockExecution, times(1)).setVariable(eq("networkServiceInstanceName"), captor.capture())
 
 125         assertEquals("nsi_DemoEmbb", captor.getValue())
 
 127         Mockito.verify(mockExecution, times(1)).setVariable(eq("networkServiceModelInvariantUuid"), captor.capture())
 
 128         assertEquals("848c5656-5594-4d41-84bb-7afc7c64765c", captor.getValue())
 
 130         Mockito.verify(mockExecution, times(1)).setVariable(eq("owningEntityId"), captor.capture())
 
 131         assertEquals("OE-generic", captor.getValue())
 
 134         Mockito.verify(mockExecution, times(1)).setVariable(eq("vnfId"), captor.capture())
 
 135         assertEquals("eeb66c6f-36bd-47ad-8294-48f46b1aa912", captor.getValue())
 
 137         Mockito.verify(mockExecution, times(1)).setVariable(eq("snssaiAndOrchStatusList"), captor.capture())
 
 138         List<Map<String, Object>> snssaiList = new ArrayList<>()
 
 139         Map<String, Object> snssaiMap = new LinkedHashMap<>()
 
 140         snssaiMap.put("snssai", "01-5C83F071")
 
 141         snssaiMap.put("status", "activated")
 
 142         snssaiList.add(snssaiMap)
 
 143         Map<String, Object> snssaiMap1 = new LinkedHashMap<>()
 
 144         snssaiMap1.put("snssai", "01-5B179BD4")
 
 145         snssaiMap1.put("status", "activated")
 
 146         snssaiList.add(snssaiMap1)
 
 147         assertEquals(snssaiList, captor.getValue())
 
 150         Mockito.verify(mockExecution, times(1)).setVariable(eq("projectName"), captor.capture())
 
 151         assertEquals("Project-generic", captor.getValue())
 
 153         Mockito.verify(mockExecution, times(1)).setVariable(eq("tenantId"), captor.capture())
 
 154         assertEquals("3d5819f1542e4ef9a4ccb0bcb278ca10", captor.getValue())
 
 156         Mockito.verify(mockExecution, times(1)).setVariable(eq("cloudOwner"), captor.capture())
 
 157         assertEquals("k8scloudowner", captor.getValue())
 
 159         Mockito.verify(mockExecution, times(1)).setVariable(eq("lcpCloudRegionId"), captor.capture())
 
 160         assertEquals("k8sregion", captor.getValue())
 
 162         Mockito.verify(mockExecution, times(1)).setVariable(eq("platformName"), captor.capture())
 
 163         assertEquals("test", captor.getValue())
 
 165         Mockito.verify(mockExecution, times(1)).setVariable(eq("lineOfBusinessName"), captor.capture())
 
 166         assertEquals("LOB-Demonstration", captor.getValue())
 
 171     void testPrepareVnfInstanceParamsJson() {
 
 172         List<Map<String, Object>> snssaiList = new ArrayList<>()
 
 173         Map<String, Object> snssaiMap = new LinkedHashMap<>()
 
 174         snssaiMap.put("snssai", "01-5C83F071")
 
 175         snssaiMap.put("status", "activated")
 
 176         snssaiList.add(snssaiMap)
 
 177         Map<String, Object> snssaiMap1 = new LinkedHashMap<>()
 
 178         snssaiMap1.put("snssai", "01-5B179BD4")
 
 179         snssaiMap1.put("status", "activated")
 
 180         snssaiList.add(snssaiMap1)
 
 182         when(mockExecution.getVariable("snssaiAndOrchStatusList")).thenReturn(snssaiList)
 
 184         String returnedJsonAsString= doActivate.prepareVnfInstanceParamsJson(mockExecution)
 
 186         String expectedJsonAsString = """{supportedNssai={"sNssai":[{"snssai":"01-5C83F071","status":"activated"},{"snssai":"01-5B179BD4","status":"activated"}]}}"""
 
 187         assertEquals(expectedJsonAsString, returnedJsonAsString)
 
 191     String mockQueryNS() {
 
 194  "service-instance-id": "206535e7-77c9-4036-9387-3f1cf57b4379",
 
 195  "service-instance-name": "nsi_DemoEmbb",
 
 196  "environment-context": "General_Revenue-Bearing",
 
 197  "workload-context": "Production",
 
 198  "model-invariant-id": "848c5656-5594-4d41-84bb-7afc7c64765c",
 
 199  "model-version-id": "2de92587-3395-44e8-bb2c-b9529747e580",
 
 200  "resource-version": "1599228110527",
 
 201  "selflink": "restconf/config/GENERIC-RESOURCE-API:services/service/206535e7-77c9-4036-9387-3f1cf57b4379/service-data/service-topology/",
 
 202  "orchestration-status": "Assigned",
 
 203  "relationship-list": {
 
 205    "related-to": "owning-entity",
 
 206    "relationship-label": "org.onap.relationships.inventory.BelongsTo",
 
 207    "related-link": "/aai/v19/business/owning-entities/owning-entity/OE-generic",
 
 208    "relationship-data": [{
 
 209     "relationship-key": "owning-entity.owning-entity-id",
 
 210     "relationship-value": "OE-generic"
 
 213    "related-to": "generic-vnf",
 
 214    "relationship-label": "org.onap.relationships.inventory.ComposedOf",
 
 215    "related-link": "/aai/v19/network/generic-vnfs/generic-vnf/eeb66c6f-36bd-47ad-8294-48f46b1aa912",
 
 216    "relationship-data": [{
 
 217     "relationship-key": "generic-vnf.vnf-id",
 
 218     "relationship-value": "eeb66c6f-36bd-47ad-8294-48f46b1aa912"
 
 220    "related-to-property": [{
 
 221     "property-key": "generic-vnf.vnf-name",
 
 222     "property-value": "vfwuctest 0"
 
 225    "related-to": "project",
 
 226    "relationship-label": "org.onap.relationships.inventory.Uses",
 
 227    "related-link": "/aai/v19/business/projects/project/Project-generic",
 
 228    "relationship-data": [{
 
 229     "relationship-key": "project.project-name",
 
 230     "relationship-value": "Project-generic"
 
 238     String mockQueryVnf() {
 
 242   "vnf-id": "eeb66c6f-36bd-47ad-8294-48f46b1aa912",
 
 243   "vnf-name": "vfwuctest 0",
 
 244   "vnf-type": "vfwuctest/null",
 
 245   "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
 
 246   "prov-status": "PREPROV",
 
 247   "orchestration-status": "ConfigAssigned",
 
 249   "is-closed-loop-disabled": false,
 
 250   "resource-version": "1599228155361",
 
 251   "model-invariant-id": "1086e068-c932-4b61-ae3b-2d2eb0cbe3ec",
 
 252   "model-version-id": "7fbb28cf-7dfc-447a-892c-4a3130b371d2",
 
 253   "model-customization-id": "471b3188-e8f2-470b-9f4d-89e74d45445f",
 
 254   "relationship-list": {
 
 256       "related-to": "tenant",
 
 257       "relationship-label": "org.onap.relationships.inventory.BelongsTo",
 
 258       "related-link": "/aai/v19/cloud-infrastructure/cloud-regions/cloud-region/k8scloudowner/k8sregion/tenants/tenant/3d5819f1542e4ef9a4ccb0bcb278ca10",
 
 259       "relationship-data": [{
 
 260         "relationship-key": "cloud-region.cloud-owner",
 
 261         "relationship-value": "k8scloudowner"
 
 263         "relationship-key": "cloud-region.cloud-region-id",
 
 264         "relationship-value": "k8sregion"
 
 266         "relationship-key": "tenant.tenant-id",
 
 267         "relationship-value": "3d5819f1542e4ef9a4ccb0bcb278ca10"
 
 269       "related-to-property": [{
 
 270         "property-key": "tenant.tenant-name",
 
 271         "property-value": "onap-tm5g-dev"
 
 274       "related-to": "cloud-region",
 
 275       "relationship-label": "org.onap.relationships.inventory.LocatedIn",
 
 276       "related-link": "/aai/v19/cloud-infrastructure/cloud-regions/cloud-region/k8scloudowner/k8sregion",
 
 277       "relationship-data": [{
 
 278         "relationship-key": "cloud-region.cloud-owner",
 
 279         "relationship-value": "k8scloudowner"
 
 281         "relationship-key": "cloud-region.cloud-region-id",
 
 282         "relationship-value": "k8sregion"
 
 284       "related-to-property": [{
 
 285         "property-key": "cloud-region.owner-defined-type",
 
 286         "property-value": "OwnerType"
 
 289       "related-to": "service-instance",
 
 290       "relationship-label": "org.onap.relationships.inventory.ComposedOf",
 
 291       "related-link": "/aai/v19/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vfw-k8s/service-instances/service-instance/206535e7-77c9-4036-9387-3f1cf57b4379",
 
 292       "relationship-data": [{
 
 293         "relationship-key": "customer.global-customer-id",
 
 294         "relationship-value": "Demonstration"
 
 296         "relationship-key": "service-subscription.service-type",
 
 297         "relationship-value": "vfw-k8s"
 
 299         "relationship-key": "service-instance.service-instance-id",
 
 300         "relationship-value": "206535e7-77c9-4036-9387-3f1cf57b4379"
 
 302       "related-to-property": [{
 
 303         "property-key": "service-instance.service-instance-name",
 
 304         "property-value": "vfw-0201"
 
 307       "related-to": "platform",
 
 308       "relationship-label": "org.onap.relationships.inventory.Uses",
 
 309       "related-link": "/aai/v19/business/platforms/platform/test",
 
 310       "relationship-data": [{
 
 311         "relationship-key": "platform.platform-name",
 
 312         "relationship-value": "test"
 
 315       "related-to": "line-of-business",
 
 316       "relationship-label": "org.onap.relationships.inventory.Uses",
 
 317       "related-link": "/aai/v19/business/lines-of-business/line-of-business/LOB-Demonstration",
 
 318       "relationship-data": [{
 
 319         "relationship-key": "line-of-business.line-of-business-name",
 
 320         "relationship-value": "LOB-Demonstration"
 
 328     String mockServiceProfile1() {
 
 331   "service-instance-id": "0d3d3cce-46a8-486d-816a-954e71697c4e",
 
 332   "service-instance-name": "DemoEmbb2",
 
 333   "service-role": "e2esliceprofile-service",
 
 334   "environment-context": "01-5C83F071",
 
 335   "model-invariant-id": "040b1b40-3120-446b-b8e3-4f21d153d11e",
 
 336   "model-version-id": "8b7dabb3-3f27-4555-a9fe-803e862b0292",
 
 337   "service-instance-location-id": "39-00",
 
 338   "resource-version": "1593511782269",
 
 339   "orchestration-status": "activated",
 
 340   "relationship-list": {
 
 342       "related-to": "service-instance",
 
 343       "relationship-label": "org.onap.relationships.inventory.ComposedOf",
 
 344       "related-link": "/aai/v19/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/4b2bdbc0-cf7e-4c50-882a-f660e3ab8520",
 
 345       "relationship-data": [{
 
 346         "relationship-key": "customer.global-customer-id",
 
 347         "relationship-value": "5GCustomer"
 
 349         "relationship-key": "service-subscription.service-type",
 
 350         "relationship-value": "5G"
 
 352         "relationship-key": "service-instance.service-instance-id",
 
 353         "relationship-value": "4b2bdbc0-cf7e-4c50-882a-f660e3ab8520"
 
 355       "related-to-property": [{
 
 356         "property-key": "service-instance.service-instance-name",
 
 357         "property-value": "DemoEmbb"
 
 361   "allotted-resources": {
 
 362     "allotted-resource": [{
 
 363       "id": "362e46c2-cd84-45e4-a6c1-77f4ef88328d",
 
 364       "model-invariant-id": "e5941a50-ddb4-4f74-be03-25449ae02ddc",
 
 365       "model-version-id": "ab171d60-c2cc-4903-ac1d-c451b647e461",
 
 366       "resource-version": "1593511173712",
 
 367       "type": "Allotted Resource",
 
 368       "allotted-resource-name": "Allotted_DemoEmbb",
 
 369       "relationship-list": {
 
 371           "related-to": "service-instance",
 
 372           "relationship-label": "org.onap.relationships.inventory.Uses",
 
 373           "related-link": "/aai/v19/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/ea107578-9854-4718-8145-7c7febf0de6c",
 
 374           "relationship-data": [{
 
 375             "relationship-key": "customer.global-customer-id",
 
 376             "relationship-value": "5GCustomer"
 
 378             "relationship-key": "service-subscription.service-type",
 
 379             "relationship-value": "5G"
 
 381             "relationship-key": "service-instance.service-instance-id",
 
 382             "relationship-value": "ea107578-9854-4718-8145-7c7febf0de6c"
 
 384           "related-to-property": [{
 
 385             "property-key": "service-instance.service-instance-name",
 
 386             "property-value": "nsi_DemoEmbb"
 
 394     "profile-id": "31a83df8-5bd0-4df7-a50f-7900476b81a2",
 
 396     "max-number-of-UEs": 0,
 
 397     "coverage-area-TA-list": "Beijing;Beijing;HaidianDistrict;WanshouluStreet",
 
 398     "ue-mobility-level": "stationary",
 
 399     "resource-sharing-level": "0",
 
 400     "exp-data-rate-UL": 500,
 
 401     "exp-data-rate-DL": 2000,
 
 402     "activity-factor": 0,
 
 408     "traffic-density": 0,
 
 410     "s-nssai": "01-5C83F071",
 
 411     "resource-version": "1593525640617"
 
 419     String mockServiceProfile2() {
 
 422   "service-instance-id": "1c7046f2-a5a3-4d7f-9da8-388ee641a795",
 
 423   "service-instance-name": "DemoEmbb",
 
 424   "service-role": "e2esliceprofile-service",
 
 425   "environment-context": "01-5B179BD4",
 
 426   "model-invariant-id": "040b1b40-3120-446b-b8e3-4f21d153d12e",
 
 427   "model-version-id": "8b7dabb3-3f27-4555-a9fe-803e862b0282",
 
 428   "service-instance-location-id": "39-00",
 
 429   "resource-version": "1593511782169",
 
 430   "orchestration-status": "activated",
 
 431   "relationship-list": {
 
 433       "related-to": "service-instance",
 
 434       "relationship-label": "org.onap.relationships.inventory.ComposedOf",
 
 435       "related-link": "/aai/v19/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/4b2bdbc0-cf7e-4c50-882a-f660e3ab8520",
 
 436       "relationship-data": [{
 
 437         "relationship-key": "customer.global-customer-id",
 
 438         "relationship-value": "5GCustomer"
 
 440         "relationship-key": "service-subscription.service-type",
 
 441         "relationship-value": "5G"
 
 443         "relationship-key": "service-instance.service-instance-id",
 
 444         "relationship-value": "4b2bdbc0-cf7e-4c50-882a-f660e3ab8520"
 
 446       "related-to-property": [{
 
 447         "property-key": "service-instance.service-instance-name",
 
 448         "property-value": "DemoEmbb"
 
 452   "allotted-resources": {
 
 453     "allotted-resource": [{
 
 454       "id": "362e46c2-cd84-45e4-a6c1-77f4ef88328d",
 
 455       "model-invariant-id": "e5941a50-ddb4-4f74-be03-25449ae02ddc",
 
 456       "model-version-id": "ab171d60-c2cc-4903-ac1d-c451b647e461",
 
 457       "resource-version": "1593511173712",
 
 458       "type": "Allotted Resource",
 
 459       "allotted-resource-name": "Allotted_DemoEmbb",
 
 460       "relationship-list": {
 
 462           "related-to": "service-instance",
 
 463           "relationship-label": "org.onap.relationships.inventory.Uses",
 
 464           "related-link": "/aai/v19/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/ea107578-9854-4718-8145-7c7febf0de6c",
 
 465           "relationship-data": [{
 
 466             "relationship-key": "customer.global-customer-id",
 
 467             "relationship-value": "5GCustomer"
 
 469             "relationship-key": "service-subscription.service-type",
 
 470             "relationship-value": "5G"
 
 472             "relationship-key": "service-instance.service-instance-id",
 
 473             "relationship-value": "ea107578-9854-4718-8145-7c7febf0de6c"
 
 475           "related-to-property": [{
 
 476             "property-key": "service-instance.service-instance-name",
 
 477             "property-value": "nsi_DemoEmbb"
 
 485     "profile-id": "b86df550-9d70-452b-a5a9-eb8823417255",
 
 487     "max-number-of-UEs": 0,
 
 488     "coverage-area-TA-list": "Beijing;Beijing;HaidianDistrict;WanshouluStreet",
 
 489     "ue-mobility-level": "stationary",
 
 490     "resource-sharing-level": "0",
 
 491     "exp-data-rate-UL": 500,
 
 492     "exp-data-rate-DL": 1000,
 
 493     "activity-factor": 0,
 
 499     "traffic-density": 0,
 
 501     "s-nssai": "01-5B179BD4",
 
 502     "resource-version": "1593511356725"
 
 509     String mockQuerySliceServiceReturn(){
 
 512   "service-instance-id": "NSSI-C-7Q4-HDBNJ-NSSMF-01-A-ZX",
 
 513   "service-instance-name": "nssi_DemoEmbb",
 
 514   "service-role": "nssi",
 
 515   "environment-context": "cn",
 
 516   "model-invariant-id": "da575e8e-0863-4172-88b3-b3a9ead67895",
 
 517   "model-version-id": "e398c92f-27da-44b9-a717-1dbfc1bdd82e",
 
 518   "service-instance-location-id": "39-00",
 
 519   "resource-version": "1593525640482",
 
 520   "orchestration-status": "activated",
 
 521   "relationship-list": {
 
 523       "related-to": "service-instance",
 
 524       "relationship-label": "org.onap.relationships.inventory.ComposedOf",
 
 525       "related-link": "/aai/v19/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/206535e7-77c9-4036-9387-3f1cf57b4379",
 
 526       "relationship-data": [{
 
 527         "relationship-key": "customer.global-customer-id",
 
 528         "relationship-value": "5GCustomer"
 
 530         "relationship-key": "service-subscription.service-type",
 
 531         "relationship-value": "5G"
 
 533         "relationship-key": "service-instance.service-instance-id",
 
 534         "relationship-value": "206535e7-77c9-4036-9387-3f1cf57b4379"
 
 536       "related-to-property": [{
 
 537         "property-key": "service-instance.service-instance-name",
 
 538         "property-value": "nsi_DemoEmbb"
 
 542       "related-to": "allotted-resource",
 
 543       "relationship-label": "org.onap.relationships.inventory.Uses",
 
 544       "related-link": "/aai/v19/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/0d3d3cce-46a8-486d-816a-954e71697c4e/allotted-resources/allotted-resource/d63c241a-4c0b-4294-b4c3-5a57421a1769",
 
 545       "relationship-data": [{
 
 546         "relationship-key": "customer.global-customer-id",
 
 547         "relationship-value": "5GCustomer"
 
 549         "relationship-key": "service-subscription.service-type",
 
 550         "relationship-value": "5G"
 
 552         "relationship-key": "service-instance.service-instance-id",
 
 553         "relationship-value": "0d3d3cce-46a8-486d-816a-954e71697c4e"
 
 555         "relationship-key": "allotted-resource.id",
 
 556         "relationship-value": "d63c241a-4c0b-4294-b4c3-5a57421a1769"
 
 558       "related-to-property": [{
 
 559         "property-key": "allotted-resource.description"
 
 561         "property-key": "allotted-resource.allotted-resource-name",
 
 562         "property-value": "Allotted_DemoEmbb_shared"
 
 565       "related-to": "allotted-resource",
 
 566       "relationship-label": "org.onap.relationships.inventory.Uses",
 
 567       "related-link": "/aai/v19/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/1c7046f2-a5a3-4d7f-9da8-388ee641a795/allotted-resources/allotted-resource/362e46c2-cd84-45e4-a6c1-77f4ef88328d",
 
 568       "relationship-data": [{
 
 569         "relationship-key": "customer.global-customer-id",
 
 570         "relationship-value": "5GCustomer"
 
 572         "relationship-key": "service-subscription.service-type",
 
 573         "relationship-value": "5G"
 
 575         "relationship-key": "service-instance.service-instance-id",
 
 576         "relationship-value": "1c7046f2-a5a3-4d7f-9da8-388ee641a795"
 
 578         "relationship-key": "allotted-resource.id",
 
 579         "relationship-value": "362e46c2-cd84-45e4-a6c1-77f4ef88328d"
 
 581       "related-to-property": [{
 
 582         "property-key": "allotted-resource.description"
 
 584         "property-key": "allotted-resource.allotted-resource-name",
 
 585         "property-value": "Allotted_DemoEmbb"
 
 595     void setUpMockdataFromCommonActivateSliceSubnet() {
 
 597         String bpmnRequest = """
 
 599        "serviceInstanceID": "NSSI-C-7Q4-HDBNJ-NSSMF-01-A-ZX",
 
 600        "networkType": "an/cn/tn",
 
 601        "globalSubscriberId": "5GCustomer",
 
 602        "subscriptionServiceType": "5G",
 
 603        "additionalProperties": {
 
 604         "nsiId": "NSI-M-001-HDBNJ-NSMF-01-A-ZX",
 
 608         "sliceProfileId": "ab9af40f13f721b5f13539d87484098"
 
 613         String sliceParams ="""{
 
 614      "nsiId": "NSI-M-001-HDBNJ-NSMF-01-A-ZX",
 
 618      "sliceProfileId": "ab9af40f13f721b5f13539d87484098"
 
 621         when(mockExecution.getVariable("msoRequestId")).thenReturn("5ad89cf9-0569-4a93-4509-d8324321e2be")
 
 622         when(mockExecution.getVariable("serviceInstanceID")).thenReturn("NSSI-C-7Q4-HDBNJ-NSSMF-01-A-ZX")
 
 623         when(mockExecution.getVariable("nsiId")).thenReturn("NSI-M-001-HDBNJ-NSMF-01-A-ZX")
 
 624         when(mockExecution.getVariable("globalSubscriberId")).thenReturn("5GCustomer")
 
 625         when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("5G")
 
 626         when(mockExecution.getVariable("operationType")).thenReturn("deactivateInstance")
 
 627         when(mockExecution.getVariable("jobId")).thenReturn("5ad89cf9-0569-4a93-9999-d8324321e2be")
 
 628         when(mockExecution.getVariable("bpmnRequest")).thenReturn(bpmnRequest)
 
 629         when(mockExecution.getVariable("sliceParams")).thenReturn(sliceParams)