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
37 import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder
38 import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types
40 import static org.mockito.Mockito.spy
41 import static org.mockito.Mockito.times
42 import static org.mockito.Mockito.verify
43 import static org.mockito.Mockito.when
44 import static org.mockito.ArgumentMatchers.eq
46 import javax.ws.rs.NotFoundException
48 class DoActivateCoreNSSITest extends MsoGroovyTest {
50 DoActivateCoreNSSI doActivate = new DoActivateCoreNSSI()
52 void init() throws IOException {
53 super.init("DoActivateCoreNSSI")
57 static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class)
60 void testPreProcessRequest(){
62 setUpMockdataFromCommonActivateSliceSubnet()
63 doActivate.preProcessRequest(mockExecution)
65 Mockito.verify(mockExecution, times(1)).setVariable(eq("oStatus"), captor.capture())
66 def statusValue = captor.getValue()
67 assertEquals("deactivated", statusValue)
69 Mockito.verify(mockExecution, times(1)).setVariable(eq("sNssai"), captor.capture())
70 def sNssai = captor.getValue()
71 assertEquals("01-5B179BD4", sNssai)
73 Mockito.verify(mockExecution,times(3)).setVariable(captor.capture() as String, captor.capture())
74 List<ExecutionEntity> values = captor.getAllValues()
79 void testGetNetworkInstanceWithSPInstanceAssociatedWithNssiId(){
81 setUpMockdataFromCommonActivateSliceSubnet()
82 when(mockExecution.getVariable("serviceType")).thenReturn("5G")
84 DoActivateCoreNSSI obj = spy(DoActivateCoreNSSI.class)
85 when(obj.getAAIClient()).thenReturn(client)
86 AAIResourceUri resourceUri1 = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer("5GCustomer").serviceSubscription("5G").serviceInstance("NSSI-C-7Q4-HDBNJ-NSSMF-01-A-ZX"))
87 when(client.exists(resourceUri1)).thenReturn(true)
88 AAIResultWrapper wrapper1 = new AAIResultWrapper(mockQuerySliceServiceReturn())
89 when(client.get(resourceUri1, NotFoundException.class)).thenReturn(wrapper1)
91 //networkServiceInstanceId
92 when(mockExecution.getVariable("networkServiceInstanceId")).thenReturn("206535e7-77c9-4036-9387-3f1cf57b4379")
94 AAIResourceUri resourceUri2 = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer("5GCustomer").serviceSubscription("5G").serviceInstance("206535e7-77c9-4036-9387-3f1cf57b4379"))
95 when(client.exists(resourceUri2)).thenReturn(true)
96 AAIResultWrapper wrapper2 = new AAIResultWrapper(mockQueryNS())
97 when(client.get(resourceUri2, NotFoundException.class)).thenReturn(wrapper2)
100 when(mockExecution.getVariable("vnfId")).thenReturn("eeb66c6f-36bd-47ad-8294-48f46b1aa912")
101 AAIResourceUri resourceUri3 = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf("eeb66c6f-36bd-47ad-8294-48f46b1aa912"))
102 when(client.exists(resourceUri3)).thenReturn(true)
103 AAIResultWrapper wrapper3 = new AAIResultWrapper(mockQueryVnf())
104 when(client.get(resourceUri3, NotFoundException.class)).thenReturn(wrapper3)
107 //Allotted Resources-1
108 //when(mockExecution.getVariable("vnfId")).thenReturn("eeb66c6f-36bd-47ad-8294-48f46b1aa912")
109 AAIResourceUri resourceUri4 = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer("5GCustomer").serviceSubscription("5G").serviceInstance("0d3d3cce-46a8-486d-816a-954e71697c4e"))
110 when(client.exists(resourceUri4)).thenReturn(true)
111 AAIResultWrapper wrapper4 = new AAIResultWrapper(mockServiceProfile1())
112 when(client.get(resourceUri4, NotFoundException.class)).thenReturn(wrapper4)
114 //Allotted Resources-2
115 //when(mockExecution.getVariable("vnfId")).thenReturn("eeb66c6f-36bd-47ad-8294-48f46b1aa912")
116 AAIResourceUri resourceUri5 = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer("5GCustomer").serviceSubscription("5G").serviceInstance("1c7046f2-a5a3-4d7f-9da8-388ee641a795"))
117 when(client.exists(resourceUri5)).thenReturn(true)
118 AAIResultWrapper wrapper5 = new AAIResultWrapper(mockServiceProfile2())
119 when(client.get(resourceUri5, NotFoundException.class)).thenReturn(wrapper5)
121 obj.getNetworkInstanceWithSPInstanceAssociatedWithNssiId(mockExecution)
123 Mockito.verify(mockExecution, times(1)).setVariable(eq("networkServiceInstanceId"), captor.capture())
124 assertEquals("206535e7-77c9-4036-9387-3f1cf57b4379", captor.getValue())
126 Mockito.verify(mockExecution, times(1)).setVariable(eq("networkServiceInstanceName"), captor.capture())
127 assertEquals("nsi_DemoEmbb", captor.getValue())
129 Mockito.verify(mockExecution, times(1)).setVariable(eq("networkServiceModelInvariantUuid"), captor.capture())
130 assertEquals("848c5656-5594-4d41-84bb-7afc7c64765c", captor.getValue())
132 Mockito.verify(mockExecution, times(1)).setVariable(eq("owningEntityId"), captor.capture())
133 assertEquals("OE-generic", captor.getValue())
136 Mockito.verify(mockExecution, times(1)).setVariable(eq("vnfId"), captor.capture())
137 assertEquals("eeb66c6f-36bd-47ad-8294-48f46b1aa912", captor.getValue())
139 Mockito.verify(mockExecution, times(1)).setVariable(eq("snssaiAndOrchStatusList"), captor.capture())
140 List<Map<String, Object>> snssaiList = new ArrayList<>()
141 Map<String, Object> snssaiMap = new LinkedHashMap<>()
142 snssaiMap.put("snssai", "01-5C83F071")
143 snssaiMap.put("status", "activated")
144 snssaiList.add(snssaiMap)
145 Map<String, Object> snssaiMap1 = new LinkedHashMap<>()
146 snssaiMap1.put("snssai", "01-5B179BD4")
147 snssaiMap1.put("status", "activated")
148 snssaiList.add(snssaiMap1)
149 assertEquals(snssaiList, captor.getValue())
152 Mockito.verify(mockExecution, times(1)).setVariable(eq("projectName"), captor.capture())
153 assertEquals("Project-generic", captor.getValue())
155 Mockito.verify(mockExecution, times(1)).setVariable(eq("tenantId"), captor.capture())
156 assertEquals("3d5819f1542e4ef9a4ccb0bcb278ca10", captor.getValue())
158 Mockito.verify(mockExecution, times(1)).setVariable(eq("cloudOwner"), captor.capture())
159 assertEquals("k8scloudowner", captor.getValue())
161 Mockito.verify(mockExecution, times(1)).setVariable(eq("lcpCloudRegionId"), captor.capture())
162 assertEquals("k8sregion", captor.getValue())
164 Mockito.verify(mockExecution, times(1)).setVariable(eq("platformName"), captor.capture())
165 assertEquals("test", captor.getValue())
167 Mockito.verify(mockExecution, times(1)).setVariable(eq("lineOfBusinessName"), captor.capture())
168 assertEquals("LOB-Demonstration", captor.getValue())
173 void testPrepareVnfInstanceParamsJson() {
174 List<Map<String, Object>> snssaiList = new ArrayList<>()
175 Map<String, Object> snssaiMap = new LinkedHashMap<>()
176 snssaiMap.put("snssai", "01-5C83F071")
177 snssaiMap.put("status", "activated")
178 snssaiList.add(snssaiMap)
179 Map<String, Object> snssaiMap1 = new LinkedHashMap<>()
180 snssaiMap1.put("snssai", "01-5B179BD4")
181 snssaiMap1.put("status", "activated")
182 snssaiList.add(snssaiMap1)
184 when(mockExecution.getVariable("snssaiAndOrchStatusList")).thenReturn(snssaiList)
186 String returnedJsonAsString= doActivate.prepareVnfInstanceParamsJson(mockExecution)
187 String expectedJsonAsString = """{"sNssai":[{"snssai":"01-5C83F071","status":"activated"},{"snssai":"01-5B179BD4","status":"activated"}]}"""
188 assertEquals(expectedJsonAsString, returnedJsonAsString)
192 String mockQueryNS() {
195 "service-instance-id": "206535e7-77c9-4036-9387-3f1cf57b4379",
196 "service-instance-name": "nsi_DemoEmbb",
197 "environment-context": "General_Revenue-Bearing",
198 "workload-context": "Production",
199 "model-invariant-id": "848c5656-5594-4d41-84bb-7afc7c64765c",
200 "model-version-id": "2de92587-3395-44e8-bb2c-b9529747e580",
201 "resource-version": "1599228110527",
202 "selflink": "restconf/config/GENERIC-RESOURCE-API:services/service/206535e7-77c9-4036-9387-3f1cf57b4379/service-data/service-topology/",
203 "orchestration-status": "Assigned",
204 "relationship-list": {
206 "related-to": "owning-entity",
207 "relationship-label": "org.onap.relationships.inventory.BelongsTo",
208 "related-link": "/aai/v19/business/owning-entities/owning-entity/OE-generic",
209 "relationship-data": [{
210 "relationship-key": "owning-entity.owning-entity-id",
211 "relationship-value": "OE-generic"
214 "related-to": "generic-vnf",
215 "relationship-label": "org.onap.relationships.inventory.ComposedOf",
216 "related-link": "/aai/v19/network/generic-vnfs/generic-vnf/eeb66c6f-36bd-47ad-8294-48f46b1aa912",
217 "relationship-data": [{
218 "relationship-key": "generic-vnf.vnf-id",
219 "relationship-value": "eeb66c6f-36bd-47ad-8294-48f46b1aa912"
221 "related-to-property": [{
222 "property-key": "generic-vnf.vnf-name",
223 "property-value": "vfwuctest 0"
226 "related-to": "project",
227 "relationship-label": "org.onap.relationships.inventory.Uses",
228 "related-link": "/aai/v19/business/projects/project/Project-generic",
229 "relationship-data": [{
230 "relationship-key": "project.project-name",
231 "relationship-value": "Project-generic"
239 String mockQueryVnf() {
243 "vnf-id": "eeb66c6f-36bd-47ad-8294-48f46b1aa912",
244 "vnf-name": "vfwuctest 0",
245 "vnf-type": "vfwuctest/null",
246 "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
247 "prov-status": "PREPROV",
248 "orchestration-status": "ConfigAssigned",
250 "is-closed-loop-disabled": false,
251 "resource-version": "1599228155361",
252 "model-invariant-id": "1086e068-c932-4b61-ae3b-2d2eb0cbe3ec",
253 "model-version-id": "7fbb28cf-7dfc-447a-892c-4a3130b371d2",
254 "model-customization-id": "471b3188-e8f2-470b-9f4d-89e74d45445f",
255 "relationship-list": {
257 "related-to": "tenant",
258 "relationship-label": "org.onap.relationships.inventory.BelongsTo",
259 "related-link": "/aai/v19/cloud-infrastructure/cloud-regions/cloud-region/k8scloudowner/k8sregion/tenants/tenant/3d5819f1542e4ef9a4ccb0bcb278ca10",
260 "relationship-data": [{
261 "relationship-key": "cloud-region.cloud-owner",
262 "relationship-value": "k8scloudowner"
264 "relationship-key": "cloud-region.cloud-region-id",
265 "relationship-value": "k8sregion"
267 "relationship-key": "tenant.tenant-id",
268 "relationship-value": "3d5819f1542e4ef9a4ccb0bcb278ca10"
270 "related-to-property": [{
271 "property-key": "tenant.tenant-name",
272 "property-value": "onap-tm5g-dev"
275 "related-to": "cloud-region",
276 "relationship-label": "org.onap.relationships.inventory.LocatedIn",
277 "related-link": "/aai/v19/cloud-infrastructure/cloud-regions/cloud-region/k8scloudowner/k8sregion",
278 "relationship-data": [{
279 "relationship-key": "cloud-region.cloud-owner",
280 "relationship-value": "k8scloudowner"
282 "relationship-key": "cloud-region.cloud-region-id",
283 "relationship-value": "k8sregion"
285 "related-to-property": [{
286 "property-key": "cloud-region.owner-defined-type",
287 "property-value": "OwnerType"
290 "related-to": "service-instance",
291 "relationship-label": "org.onap.relationships.inventory.ComposedOf",
292 "related-link": "/aai/v19/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vfw-k8s/service-instances/service-instance/206535e7-77c9-4036-9387-3f1cf57b4379",
293 "relationship-data": [{
294 "relationship-key": "customer.global-customer-id",
295 "relationship-value": "Demonstration"
297 "relationship-key": "service-subscription.service-type",
298 "relationship-value": "vfw-k8s"
300 "relationship-key": "service-instance.service-instance-id",
301 "relationship-value": "206535e7-77c9-4036-9387-3f1cf57b4379"
303 "related-to-property": [{
304 "property-key": "service-instance.service-instance-name",
305 "property-value": "vfw-0201"
308 "related-to": "platform",
309 "relationship-label": "org.onap.relationships.inventory.Uses",
310 "related-link": "/aai/v19/business/platforms/platform/test",
311 "relationship-data": [{
312 "relationship-key": "platform.platform-name",
313 "relationship-value": "test"
316 "related-to": "line-of-business",
317 "relationship-label": "org.onap.relationships.inventory.Uses",
318 "related-link": "/aai/v19/business/lines-of-business/line-of-business/LOB-Demonstration",
319 "relationship-data": [{
320 "relationship-key": "line-of-business.line-of-business-name",
321 "relationship-value": "LOB-Demonstration"
329 String mockServiceProfile1() {
332 "service-instance-id": "0d3d3cce-46a8-486d-816a-954e71697c4e",
333 "service-instance-name": "DemoEmbb2",
334 "service-role": "e2esliceprofile-service",
335 "environment-context": "01-5C83F071",
336 "model-invariant-id": "040b1b40-3120-446b-b8e3-4f21d153d11e",
337 "model-version-id": "8b7dabb3-3f27-4555-a9fe-803e862b0292",
338 "service-instance-location-id": "39-00",
339 "resource-version": "1593511782269",
340 "orchestration-status": "activated",
341 "relationship-list": {
343 "related-to": "service-instance",
344 "relationship-label": "org.onap.relationships.inventory.ComposedOf",
345 "related-link": "/aai/v19/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/4b2bdbc0-cf7e-4c50-882a-f660e3ab8520",
346 "relationship-data": [{
347 "relationship-key": "customer.global-customer-id",
348 "relationship-value": "5GCustomer"
350 "relationship-key": "service-subscription.service-type",
351 "relationship-value": "5G"
353 "relationship-key": "service-instance.service-instance-id",
354 "relationship-value": "4b2bdbc0-cf7e-4c50-882a-f660e3ab8520"
356 "related-to-property": [{
357 "property-key": "service-instance.service-instance-name",
358 "property-value": "DemoEmbb"
362 "allotted-resources": {
363 "allotted-resource": [{
364 "id": "362e46c2-cd84-45e4-a6c1-77f4ef88328d",
365 "model-invariant-id": "e5941a50-ddb4-4f74-be03-25449ae02ddc",
366 "model-version-id": "ab171d60-c2cc-4903-ac1d-c451b647e461",
367 "resource-version": "1593511173712",
368 "type": "Allotted Resource",
369 "allotted-resource-name": "Allotted_DemoEmbb",
370 "relationship-list": {
372 "related-to": "service-instance",
373 "relationship-label": "org.onap.relationships.inventory.Uses",
374 "related-link": "/aai/v19/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/ea107578-9854-4718-8145-7c7febf0de6c",
375 "relationship-data": [{
376 "relationship-key": "customer.global-customer-id",
377 "relationship-value": "5GCustomer"
379 "relationship-key": "service-subscription.service-type",
380 "relationship-value": "5G"
382 "relationship-key": "service-instance.service-instance-id",
383 "relationship-value": "ea107578-9854-4718-8145-7c7febf0de6c"
385 "related-to-property": [{
386 "property-key": "service-instance.service-instance-name",
387 "property-value": "nsi_DemoEmbb"
395 "profile-id": "31a83df8-5bd0-4df7-a50f-7900476b81a2",
397 "max-number-of-UEs": 0,
398 "coverage-area-TA-list": "Beijing;Beijing;HaidianDistrict;WanshouluStreet",
399 "ue-mobility-level": "stationary",
400 "resource-sharing-level": "0",
401 "exp-data-rate-UL": 500,
402 "exp-data-rate-DL": 2000,
403 "activity-factor": 0,
409 "traffic-density": 0,
411 "s-nssai": "01-5C83F071",
412 "resource-version": "1593525640617"
420 String mockServiceProfile2() {
423 "service-instance-id": "1c7046f2-a5a3-4d7f-9da8-388ee641a795",
424 "service-instance-name": "DemoEmbb",
425 "service-role": "e2esliceprofile-service",
426 "environment-context": "01-5B179BD4",
427 "model-invariant-id": "040b1b40-3120-446b-b8e3-4f21d153d12e",
428 "model-version-id": "8b7dabb3-3f27-4555-a9fe-803e862b0282",
429 "service-instance-location-id": "39-00",
430 "resource-version": "1593511782169",
431 "orchestration-status": "activated",
432 "relationship-list": {
434 "related-to": "service-instance",
435 "relationship-label": "org.onap.relationships.inventory.ComposedOf",
436 "related-link": "/aai/v19/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/4b2bdbc0-cf7e-4c50-882a-f660e3ab8520",
437 "relationship-data": [{
438 "relationship-key": "customer.global-customer-id",
439 "relationship-value": "5GCustomer"
441 "relationship-key": "service-subscription.service-type",
442 "relationship-value": "5G"
444 "relationship-key": "service-instance.service-instance-id",
445 "relationship-value": "4b2bdbc0-cf7e-4c50-882a-f660e3ab8520"
447 "related-to-property": [{
448 "property-key": "service-instance.service-instance-name",
449 "property-value": "DemoEmbb"
453 "allotted-resources": {
454 "allotted-resource": [{
455 "id": "362e46c2-cd84-45e4-a6c1-77f4ef88328d",
456 "model-invariant-id": "e5941a50-ddb4-4f74-be03-25449ae02ddc",
457 "model-version-id": "ab171d60-c2cc-4903-ac1d-c451b647e461",
458 "resource-version": "1593511173712",
459 "type": "Allotted Resource",
460 "allotted-resource-name": "Allotted_DemoEmbb",
461 "relationship-list": {
463 "related-to": "service-instance",
464 "relationship-label": "org.onap.relationships.inventory.Uses",
465 "related-link": "/aai/v19/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/ea107578-9854-4718-8145-7c7febf0de6c",
466 "relationship-data": [{
467 "relationship-key": "customer.global-customer-id",
468 "relationship-value": "5GCustomer"
470 "relationship-key": "service-subscription.service-type",
471 "relationship-value": "5G"
473 "relationship-key": "service-instance.service-instance-id",
474 "relationship-value": "ea107578-9854-4718-8145-7c7febf0de6c"
476 "related-to-property": [{
477 "property-key": "service-instance.service-instance-name",
478 "property-value": "nsi_DemoEmbb"
486 "profile-id": "b86df550-9d70-452b-a5a9-eb8823417255",
488 "max-number-of-UEs": 0,
489 "coverage-area-TA-list": "Beijing;Beijing;HaidianDistrict;WanshouluStreet",
490 "ue-mobility-level": "stationary",
491 "resource-sharing-level": "0",
492 "exp-data-rate-UL": 500,
493 "exp-data-rate-DL": 1000,
494 "activity-factor": 0,
500 "traffic-density": 0,
502 "s-nssai": "01-5B179BD4",
503 "resource-version": "1593511356725"
510 String mockQuerySliceServiceReturn(){
513 "service-instance-id": "NSSI-C-7Q4-HDBNJ-NSSMF-01-A-ZX",
514 "service-instance-name": "nssi_DemoEmbb",
515 "service-role": "nssi",
516 "environment-context": "cn",
517 "model-invariant-id": "da575e8e-0863-4172-88b3-b3a9ead67895",
518 "model-version-id": "e398c92f-27da-44b9-a717-1dbfc1bdd82e",
519 "service-instance-location-id": "39-00",
520 "resource-version": "1593525640482",
521 "orchestration-status": "activated",
522 "relationship-list": {
524 "related-to": "service-instance",
525 "relationship-label": "org.onap.relationships.inventory.ComposedOf",
526 "related-link": "/aai/v19/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/206535e7-77c9-4036-9387-3f1cf57b4379",
527 "relationship-data": [{
528 "relationship-key": "customer.global-customer-id",
529 "relationship-value": "5GCustomer"
531 "relationship-key": "service-subscription.service-type",
532 "relationship-value": "5G"
534 "relationship-key": "service-instance.service-instance-id",
535 "relationship-value": "206535e7-77c9-4036-9387-3f1cf57b4379"
537 "related-to-property": [{
538 "property-key": "service-instance.service-instance-name",
539 "property-value": "nsi_DemoEmbb"
543 "related-to": "allotted-resource",
544 "relationship-label": "org.onap.relationships.inventory.Uses",
545 "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",
546 "relationship-data": [{
547 "relationship-key": "customer.global-customer-id",
548 "relationship-value": "5GCustomer"
550 "relationship-key": "service-subscription.service-type",
551 "relationship-value": "5G"
553 "relationship-key": "service-instance.service-instance-id",
554 "relationship-value": "0d3d3cce-46a8-486d-816a-954e71697c4e"
556 "relationship-key": "allotted-resource.id",
557 "relationship-value": "d63c241a-4c0b-4294-b4c3-5a57421a1769"
559 "related-to-property": [{
560 "property-key": "allotted-resource.description"
562 "property-key": "allotted-resource.allotted-resource-name",
563 "property-value": "Allotted_DemoEmbb_shared"
566 "related-to": "allotted-resource",
567 "relationship-label": "org.onap.relationships.inventory.Uses",
568 "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",
569 "relationship-data": [{
570 "relationship-key": "customer.global-customer-id",
571 "relationship-value": "5GCustomer"
573 "relationship-key": "service-subscription.service-type",
574 "relationship-value": "5G"
576 "relationship-key": "service-instance.service-instance-id",
577 "relationship-value": "1c7046f2-a5a3-4d7f-9da8-388ee641a795"
579 "relationship-key": "allotted-resource.id",
580 "relationship-value": "362e46c2-cd84-45e4-a6c1-77f4ef88328d"
582 "related-to-property": [{
583 "property-key": "allotted-resource.description"
585 "property-key": "allotted-resource.allotted-resource-name",
586 "property-value": "Allotted_DemoEmbb"
596 void setUpMockdataFromCommonActivateSliceSubnet() {
598 String bpmnRequest = """
600 "serviceInstanceID": "NSSI-C-7Q4-HDBNJ-NSSMF-01-A-ZX",
601 "networkType": "an/cn/tn",
602 "globalSubscriberId": "5GCustomer",
603 "subscriptionServiceType": "5G",
604 "additionalProperties": {
605 "nsiId": "NSI-M-001-HDBNJ-NSMF-01-A-ZX",
609 "sliceProfileId": "ab9af40f13f721b5f13539d87484098"
614 String sliceParams ="""{
615 "nsiId": "NSI-M-001-HDBNJ-NSMF-01-A-ZX",
619 "sliceProfileId": "ab9af40f13f721b5f13539d87484098"
622 when(mockExecution.getVariable("msoRequestId")).thenReturn("5ad89cf9-0569-4a93-4509-d8324321e2be")
623 when(mockExecution.getVariable("serviceInstanceID")).thenReturn("NSSI-C-7Q4-HDBNJ-NSSMF-01-A-ZX")
624 when(mockExecution.getVariable("nsiId")).thenReturn("NSI-M-001-HDBNJ-NSMF-01-A-ZX")
625 when(mockExecution.getVariable("globalSubscriberId")).thenReturn("5GCustomer")
626 when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("5G")
627 when(mockExecution.getVariable("operationType")).thenReturn("deactivateInstance")
628 when(mockExecution.getVariable("jobId")).thenReturn("5ad89cf9-0569-4a93-9999-d8324321e2be")
629 when(mockExecution.getVariable("bpmnRequest")).thenReturn(bpmnRequest)
630 when(mockExecution.getVariable("sliceParams")).thenReturn(sliceParams)