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())
140 Mockito.verify(mockExecution, times(1)).setVariable(eq("projectName"), captor.capture())
141 assertEquals("Project-generic", captor.getValue())
143 Mockito.verify(mockExecution, times(1)).setVariable(eq("tenantId"), captor.capture())
144 assertEquals("3d5819f1542e4ef9a4ccb0bcb278ca10", captor.getValue())
146 Mockito.verify(mockExecution, times(1)).setVariable(eq("cloudOwner"), captor.capture())
147 assertEquals("k8scloudowner", captor.getValue())
149 Mockito.verify(mockExecution, times(1)).setVariable(eq("lcpCloudRegionId"), captor.capture())
150 assertEquals("k8sregion", captor.getValue())
152 Mockito.verify(mockExecution, times(1)).setVariable(eq("platformName"), captor.capture())
153 assertEquals("test", captor.getValue())
155 Mockito.verify(mockExecution, times(1)).setVariable(eq("lineOfBusinessName"), captor.capture())
156 assertEquals("LOB-Demonstration", captor.getValue())
161 void testPrepareVnfInstanceParamsJson() {
162 List<Map<String, Object>> snssaiList = new ArrayList<>()
163 Map<String, Object> snssaiMap = new LinkedHashMap<>()
164 snssaiMap.put("snssai", "01-5C83F071")
165 snssaiMap.put("status", "activated")
166 snssaiList.add(snssaiMap)
167 Map<String, Object> snssaiMap1 = new LinkedHashMap<>()
168 snssaiMap1.put("snssai", "01-5B179BD4")
169 snssaiMap1.put("status", "activated")
170 snssaiList.add(snssaiMap1)
172 when(mockExecution.getVariable("snssaiAndOrchStatusList")).thenReturn(snssaiList)
174 String returnedJsonAsString= doActivate.prepareVnfInstanceParamsJson(mockExecution)
175 String expectedJsonAsString = """{"sNssai":[{"snssai":"01-5C83F071","status":"activated"},{"snssai":"01-5B179BD4","status":"activated"}]}"""
176 assertEquals(expectedJsonAsString, returnedJsonAsString)
180 String mockQueryNS() {
183 "service-instance-id": "206535e7-77c9-4036-9387-3f1cf57b4379",
184 "service-instance-name": "nsi_DemoEmbb",
185 "environment-context": "General_Revenue-Bearing",
186 "workload-context": "Production",
187 "model-invariant-id": "848c5656-5594-4d41-84bb-7afc7c64765c",
188 "model-version-id": "2de92587-3395-44e8-bb2c-b9529747e580",
189 "resource-version": "1599228110527",
190 "selflink": "restconf/config/GENERIC-RESOURCE-API:services/service/206535e7-77c9-4036-9387-3f1cf57b4379/service-data/service-topology/",
191 "orchestration-status": "Assigned",
192 "relationship-list": {
194 "related-to": "owning-entity",
195 "relationship-label": "org.onap.relationships.inventory.BelongsTo",
196 "related-link": "/aai/v19/business/owning-entities/owning-entity/OE-generic",
197 "relationship-data": [{
198 "relationship-key": "owning-entity.owning-entity-id",
199 "relationship-value": "OE-generic"
202 "related-to": "generic-vnf",
203 "relationship-label": "org.onap.relationships.inventory.ComposedOf",
204 "related-link": "/aai/v19/network/generic-vnfs/generic-vnf/eeb66c6f-36bd-47ad-8294-48f46b1aa912",
205 "relationship-data": [{
206 "relationship-key": "generic-vnf.vnf-id",
207 "relationship-value": "eeb66c6f-36bd-47ad-8294-48f46b1aa912"
209 "related-to-property": [{
210 "property-key": "generic-vnf.vnf-name",
211 "property-value": "vfwuctest 0"
214 "related-to": "project",
215 "relationship-label": "org.onap.relationships.inventory.Uses",
216 "related-link": "/aai/v19/business/projects/project/Project-generic",
217 "relationship-data": [{
218 "relationship-key": "project.project-name",
219 "relationship-value": "Project-generic"
227 String mockQueryVnf() {
231 "vnf-id": "eeb66c6f-36bd-47ad-8294-48f46b1aa912",
232 "vnf-name": "vfwuctest 0",
233 "vnf-type": "vfwuctest/null",
234 "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
235 "prov-status": "PREPROV",
236 "orchestration-status": "ConfigAssigned",
238 "is-closed-loop-disabled": false,
239 "resource-version": "1599228155361",
240 "model-invariant-id": "1086e068-c932-4b61-ae3b-2d2eb0cbe3ec",
241 "model-version-id": "7fbb28cf-7dfc-447a-892c-4a3130b371d2",
242 "model-customization-id": "471b3188-e8f2-470b-9f4d-89e74d45445f",
243 "relationship-list": {
245 "related-to": "tenant",
246 "relationship-label": "org.onap.relationships.inventory.BelongsTo",
247 "related-link": "/aai/v19/cloud-infrastructure/cloud-regions/cloud-region/k8scloudowner/k8sregion/tenants/tenant/3d5819f1542e4ef9a4ccb0bcb278ca10",
248 "relationship-data": [{
249 "relationship-key": "cloud-region.cloud-owner",
250 "relationship-value": "k8scloudowner"
252 "relationship-key": "cloud-region.cloud-region-id",
253 "relationship-value": "k8sregion"
255 "relationship-key": "tenant.tenant-id",
256 "relationship-value": "3d5819f1542e4ef9a4ccb0bcb278ca10"
258 "related-to-property": [{
259 "property-key": "tenant.tenant-name",
260 "property-value": "onap-tm5g-dev"
263 "related-to": "cloud-region",
264 "relationship-label": "org.onap.relationships.inventory.LocatedIn",
265 "related-link": "/aai/v19/cloud-infrastructure/cloud-regions/cloud-region/k8scloudowner/k8sregion",
266 "relationship-data": [{
267 "relationship-key": "cloud-region.cloud-owner",
268 "relationship-value": "k8scloudowner"
270 "relationship-key": "cloud-region.cloud-region-id",
271 "relationship-value": "k8sregion"
273 "related-to-property": [{
274 "property-key": "cloud-region.owner-defined-type",
275 "property-value": "OwnerType"
278 "related-to": "service-instance",
279 "relationship-label": "org.onap.relationships.inventory.ComposedOf",
280 "related-link": "/aai/v19/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vfw-k8s/service-instances/service-instance/206535e7-77c9-4036-9387-3f1cf57b4379",
281 "relationship-data": [{
282 "relationship-key": "customer.global-customer-id",
283 "relationship-value": "Demonstration"
285 "relationship-key": "service-subscription.service-type",
286 "relationship-value": "vfw-k8s"
288 "relationship-key": "service-instance.service-instance-id",
289 "relationship-value": "206535e7-77c9-4036-9387-3f1cf57b4379"
291 "related-to-property": [{
292 "property-key": "service-instance.service-instance-name",
293 "property-value": "vfw-0201"
296 "related-to": "platform",
297 "relationship-label": "org.onap.relationships.inventory.Uses",
298 "related-link": "/aai/v19/business/platforms/platform/test",
299 "relationship-data": [{
300 "relationship-key": "platform.platform-name",
301 "relationship-value": "test"
304 "related-to": "line-of-business",
305 "relationship-label": "org.onap.relationships.inventory.Uses",
306 "related-link": "/aai/v19/business/lines-of-business/line-of-business/LOB-Demonstration",
307 "relationship-data": [{
308 "relationship-key": "line-of-business.line-of-business-name",
309 "relationship-value": "LOB-Demonstration"
317 String mockServiceProfile1() {
320 "service-instance-id": "0d3d3cce-46a8-486d-816a-954e71697c4e",
321 "service-instance-name": "DemoEmbb2",
322 "service-role": "e2esliceprofile-service",
323 "environment-context": "01-5C83F071",
324 "model-invariant-id": "040b1b40-3120-446b-b8e3-4f21d153d11e",
325 "model-version-id": "8b7dabb3-3f27-4555-a9fe-803e862b0292",
326 "service-instance-location-id": "39-00",
327 "resource-version": "1593511782269",
328 "orchestration-status": "activated",
329 "relationship-list": {
331 "related-to": "service-instance",
332 "relationship-label": "org.onap.relationships.inventory.ComposedOf",
333 "related-link": "/aai/v19/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/4b2bdbc0-cf7e-4c50-882a-f660e3ab8520",
334 "relationship-data": [{
335 "relationship-key": "customer.global-customer-id",
336 "relationship-value": "5GCustomer"
338 "relationship-key": "service-subscription.service-type",
339 "relationship-value": "5G"
341 "relationship-key": "service-instance.service-instance-id",
342 "relationship-value": "4b2bdbc0-cf7e-4c50-882a-f660e3ab8520"
344 "related-to-property": [{
345 "property-key": "service-instance.service-instance-name",
346 "property-value": "DemoEmbb"
350 "allotted-resources": {
351 "allotted-resource": [{
352 "id": "362e46c2-cd84-45e4-a6c1-77f4ef88328d",
353 "model-invariant-id": "e5941a50-ddb4-4f74-be03-25449ae02ddc",
354 "model-version-id": "ab171d60-c2cc-4903-ac1d-c451b647e461",
355 "resource-version": "1593511173712",
356 "type": "Allotted Resource",
357 "allotted-resource-name": "Allotted_DemoEmbb",
358 "relationship-list": {
360 "related-to": "service-instance",
361 "relationship-label": "org.onap.relationships.inventory.Uses",
362 "related-link": "/aai/v19/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/ea107578-9854-4718-8145-7c7febf0de6c",
363 "relationship-data": [{
364 "relationship-key": "customer.global-customer-id",
365 "relationship-value": "5GCustomer"
367 "relationship-key": "service-subscription.service-type",
368 "relationship-value": "5G"
370 "relationship-key": "service-instance.service-instance-id",
371 "relationship-value": "ea107578-9854-4718-8145-7c7febf0de6c"
373 "related-to-property": [{
374 "property-key": "service-instance.service-instance-name",
375 "property-value": "nsi_DemoEmbb"
383 "profile-id": "31a83df8-5bd0-4df7-a50f-7900476b81a2",
385 "max-number-of-UEs": 0,
386 "coverage-area-TA-list": "Beijing;Beijing;HaidianDistrict;WanshouluStreet",
387 "ue-mobility-level": "stationary",
388 "resource-sharing-level": "0",
389 "exp-data-rate-UL": 500,
390 "exp-data-rate-DL": 2000,
391 "activity-factor": 0,
397 "traffic-density": 0,
399 "s-nssai": "01-5C83F071",
400 "resource-version": "1593525640617"
408 String mockServiceProfile2() {
411 "service-instance-id": "1c7046f2-a5a3-4d7f-9da8-388ee641a795",
412 "service-instance-name": "DemoEmbb",
413 "service-role": "e2esliceprofile-service",
414 "environment-context": "01-5B179BD4",
415 "model-invariant-id": "040b1b40-3120-446b-b8e3-4f21d153d12e",
416 "model-version-id": "8b7dabb3-3f27-4555-a9fe-803e862b0282",
417 "service-instance-location-id": "39-00",
418 "resource-version": "1593511782169",
419 "orchestration-status": "activated",
420 "relationship-list": {
422 "related-to": "service-instance",
423 "relationship-label": "org.onap.relationships.inventory.ComposedOf",
424 "related-link": "/aai/v19/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/4b2bdbc0-cf7e-4c50-882a-f660e3ab8520",
425 "relationship-data": [{
426 "relationship-key": "customer.global-customer-id",
427 "relationship-value": "5GCustomer"
429 "relationship-key": "service-subscription.service-type",
430 "relationship-value": "5G"
432 "relationship-key": "service-instance.service-instance-id",
433 "relationship-value": "4b2bdbc0-cf7e-4c50-882a-f660e3ab8520"
435 "related-to-property": [{
436 "property-key": "service-instance.service-instance-name",
437 "property-value": "DemoEmbb"
441 "allotted-resources": {
442 "allotted-resource": [{
443 "id": "362e46c2-cd84-45e4-a6c1-77f4ef88328d",
444 "model-invariant-id": "e5941a50-ddb4-4f74-be03-25449ae02ddc",
445 "model-version-id": "ab171d60-c2cc-4903-ac1d-c451b647e461",
446 "resource-version": "1593511173712",
447 "type": "Allotted Resource",
448 "allotted-resource-name": "Allotted_DemoEmbb",
449 "relationship-list": {
451 "related-to": "service-instance",
452 "relationship-label": "org.onap.relationships.inventory.Uses",
453 "related-link": "/aai/v19/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/ea107578-9854-4718-8145-7c7febf0de6c",
454 "relationship-data": [{
455 "relationship-key": "customer.global-customer-id",
456 "relationship-value": "5GCustomer"
458 "relationship-key": "service-subscription.service-type",
459 "relationship-value": "5G"
461 "relationship-key": "service-instance.service-instance-id",
462 "relationship-value": "ea107578-9854-4718-8145-7c7febf0de6c"
464 "related-to-property": [{
465 "property-key": "service-instance.service-instance-name",
466 "property-value": "nsi_DemoEmbb"
474 "profile-id": "b86df550-9d70-452b-a5a9-eb8823417255",
476 "max-number-of-UEs": 0,
477 "coverage-area-TA-list": "Beijing;Beijing;HaidianDistrict;WanshouluStreet",
478 "ue-mobility-level": "stationary",
479 "resource-sharing-level": "0",
480 "exp-data-rate-UL": 500,
481 "exp-data-rate-DL": 1000,
482 "activity-factor": 0,
488 "traffic-density": 0,
490 "s-nssai": "01-5B179BD4",
491 "resource-version": "1593511356725"
498 String mockQuerySliceServiceReturn(){
501 "service-instance-id": "NSSI-C-7Q4-HDBNJ-NSSMF-01-A-ZX",
502 "service-instance-name": "nssi_DemoEmbb",
503 "service-role": "nssi",
504 "environment-context": "cn",
505 "model-invariant-id": "da575e8e-0863-4172-88b3-b3a9ead67895",
506 "model-version-id": "e398c92f-27da-44b9-a717-1dbfc1bdd82e",
507 "service-instance-location-id": "39-00",
508 "resource-version": "1593525640482",
509 "orchestration-status": "activated",
510 "relationship-list": {
512 "related-to": "service-instance",
513 "relationship-label": "org.onap.relationships.inventory.ComposedOf",
514 "related-link": "/aai/v19/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/206535e7-77c9-4036-9387-3f1cf57b4379",
515 "relationship-data": [{
516 "relationship-key": "customer.global-customer-id",
517 "relationship-value": "5GCustomer"
519 "relationship-key": "service-subscription.service-type",
520 "relationship-value": "5G"
522 "relationship-key": "service-instance.service-instance-id",
523 "relationship-value": "206535e7-77c9-4036-9387-3f1cf57b4379"
525 "related-to-property": [{
526 "property-key": "service-instance.service-instance-name",
527 "property-value": "nsi_DemoEmbb"
531 "related-to": "allotted-resource",
532 "relationship-label": "org.onap.relationships.inventory.Uses",
533 "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",
534 "relationship-data": [{
535 "relationship-key": "customer.global-customer-id",
536 "relationship-value": "5GCustomer"
538 "relationship-key": "service-subscription.service-type",
539 "relationship-value": "5G"
541 "relationship-key": "service-instance.service-instance-id",
542 "relationship-value": "0d3d3cce-46a8-486d-816a-954e71697c4e"
544 "relationship-key": "allotted-resource.id",
545 "relationship-value": "d63c241a-4c0b-4294-b4c3-5a57421a1769"
547 "related-to-property": [{
548 "property-key": "allotted-resource.description"
550 "property-key": "allotted-resource.allotted-resource-name",
551 "property-value": "Allotted_DemoEmbb_shared"
554 "related-to": "allotted-resource",
555 "relationship-label": "org.onap.relationships.inventory.Uses",
556 "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",
557 "relationship-data": [{
558 "relationship-key": "customer.global-customer-id",
559 "relationship-value": "5GCustomer"
561 "relationship-key": "service-subscription.service-type",
562 "relationship-value": "5G"
564 "relationship-key": "service-instance.service-instance-id",
565 "relationship-value": "1c7046f2-a5a3-4d7f-9da8-388ee641a795"
567 "relationship-key": "allotted-resource.id",
568 "relationship-value": "362e46c2-cd84-45e4-a6c1-77f4ef88328d"
570 "related-to-property": [{
571 "property-key": "allotted-resource.description"
573 "property-key": "allotted-resource.allotted-resource-name",
574 "property-value": "Allotted_DemoEmbb"
584 void setUpMockdataFromCommonActivateSliceSubnet() {
586 String bpmnRequest = """
588 "serviceInstanceID": "NSSI-C-7Q4-HDBNJ-NSSMF-01-A-ZX",
589 "networkType": "an/cn/tn",
590 "globalSubscriberId": "5GCustomer",
591 "subscriptionServiceType": "5G",
592 "additionalProperties": {
593 "nsiId": "NSI-M-001-HDBNJ-NSMF-01-A-ZX",
597 "sliceProfileId": "ab9af40f13f721b5f13539d87484098"
602 String sliceParams ="""{
603 "nsiId": "NSI-M-001-HDBNJ-NSMF-01-A-ZX",
607 "sliceProfileId": "ab9af40f13f721b5f13539d87484098"
610 when(mockExecution.getVariable("msoRequestId")).thenReturn("5ad89cf9-0569-4a93-4509-d8324321e2be")
611 when(mockExecution.getVariable("serviceInstanceID")).thenReturn("NSSI-C-7Q4-HDBNJ-NSSMF-01-A-ZX")
612 when(mockExecution.getVariable("nsiId")).thenReturn("NSI-M-001-HDBNJ-NSMF-01-A-ZX")
613 when(mockExecution.getVariable("globalSubscriberId")).thenReturn("5GCustomer")
614 when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("5G")
615 when(mockExecution.getVariable("operationType")).thenReturn("deactivateInstance")
616 when(mockExecution.getVariable("jobId")).thenReturn("5ad89cf9-0569-4a93-9999-d8324321e2be")
617 when(mockExecution.getVariable("bpmnRequest")).thenReturn(bpmnRequest)
618 when(mockExecution.getVariable("sliceParams")).thenReturn(sliceParams)