2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
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.vcpe.scripts
24 import org.camunda.bpm.engine.ProcessEngineServices
25 import org.camunda.bpm.engine.RepositoryService
26 import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
27 import org.camunda.bpm.engine.repository.ProcessDefinition
28 import org.camunda.bpm.engine.delegate.DelegateExecution
29 import org.junit.Before
30 import org.junit.BeforeClass
33 import org.junit.Ignore
34 import org.mockito.MockitoAnnotations
35 import org.camunda.bpm.engine.delegate.BpmnError
36 import org.onap.so.bpmn.core.UrnPropertiesReader
37 import org.onap.so.bpmn.core.WorkflowException
38 import org.onap.so.bpmn.mock.FileUtil
40 import static com.github.tomakehurst.wiremock.client.WireMock.aResponse
41 import static com.github.tomakehurst.wiremock.client.WireMock.delete
42 import static com.github.tomakehurst.wiremock.client.WireMock.get
43 import static com.github.tomakehurst.wiremock.client.WireMock.patch
44 import static com.github.tomakehurst.wiremock.client.WireMock.put
45 import static com.github.tomakehurst.wiremock.client.WireMock.stubFor
46 import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching
47 import static org.junit.Assert.*;
48 import static org.mockito.Mockito.*
49 import static org.onap.so.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource
50 import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetAllottedResource
51 import static org.onap.so.bpmn.mock.StubResponseAAI.MockPatchAllottedResource
52 import static org.onap.so.bpmn.mock.StubResponseAAI.MockQueryAllottedResourceById
56 import org.onap.so.bpmn.core.RollbackData
57 import org.onap.so.bpmn.vcpe.scripts.MapSetter
59 import com.github.tomakehurst.wiremock.junit.WireMockRule
61 class DoDeleteAllottedResourceBRGTest extends GroovyTestBase {
64 public WireMockRule wireMockRule = new WireMockRule(PORT)
66 String Prefix = "DDARBRG_"
69 public static void setUpBeforeClass() {
70 super.setUpBeforeClass()
76 MockitoAnnotations.initMocks(this)
79 public DoDeleteAllottedResourceBRGTest() {
80 super("DoDeleteAllottedResourceBRG")
84 // ***** preProcessRequest *****
88 public void preProcessRequest() {
89 ExecutionEntity mex = setupMock()
92 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
93 DoDeleteAllottedResourceBRG.preProcessRequest(mex)
95 //verify(mex).getVariable(DBGFLAG)
96 verify(mex).setVariable("prefix", Prefix)
97 verify(mex).setVariable("sdncCallbackUrl", "sdncurn")
99 assertTrue(checkMissingPreProcessRequest("mso.workflow.sdncadapter.callback"))
100 assertTrue(checkMissingPreProcessRequest("serviceInstanceId"))
101 assertTrue(checkMissingPreProcessRequest("allottedResourceId"))
106 public void preProcessRequest_BpmnError() {
107 ExecutionEntity mex = setupMock()
110 when(mex.getVariable("serviceInstanceId")).thenThrow(new BpmnError("expected exception"))
112 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
114 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.preProcessRequest(mex) }))
119 public void preProcessRequest_Ex() {
120 ExecutionEntity mex = setupMock()
123 when(mex.getVariable("serviceInstanceId")).thenThrow(new RuntimeException("expected exception"))
125 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
127 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.preProcessRequest(mex) }))
131 // ***** getAaiAR *****
135 public void getAaiAR() {
136 MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml")
137 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
139 ExecutionEntity mex = setupMock()
142 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
143 DoDeleteAllottedResourceBRG.getAaiAR(mex)
145 verify(mex).setVariable("parentServiceInstanceId", INST)
150 public void getAaiAR_EmptyResponse() {
152 // note: empty result-link
154 .stubFor(get(urlMatching("/aai/.*/search/.*"))
155 .willReturn(aResponse()
157 .withHeader("Content-Type", "text/xml")
158 .withBody("<result-data></result-data>")))
160 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
162 ExecutionEntity mex = setupMock()
165 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
167 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.getAaiAR(mex) }))
171 // ***** updateAaiAROrchStatus *****
175 public void updateAaiAROrchStatus() {
176 ExecutionEntity mex = setupMock()
177 initUpdateAaiAROrchStatus(mex)
179 MockPatchAllottedResource(CUST, SVC, INST, ARID)
181 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
182 DoDeleteAllottedResourceBRG.updateAaiAROrchStatus(mex, "success")
186 // ***** buildSDNCRequest *****
190 public void buildSDNCRequest() {
191 ExecutionEntity mex = setupMock()
192 initBuildSDNCRequest(mex)
194 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
196 String result = DoDeleteAllottedResourceBRG.buildSDNCRequest(mex, "myact", "myreq")
198 assertTrue(result.indexOf("<sdncadapter:RequestId>myreq</") >= 0)
199 assertTrue(result.indexOf("<sdncadapter:SvcAction>myact</") >= 0)
200 assertTrue(result.indexOf("<allotted-resource-id>ari</") >= 0)
201 assertTrue(result.indexOf("<sdncadapter:SvcInstanceId>sii</") >= 0)
202 assertTrue(result.indexOf("<service-instance-id>sii</") >= 0)
203 assertTrue(result.indexOf("<parent-service-instance-id>psii</") >= 0)
204 assertTrue(result.indexOf("<subscription-service-type>sst</") >= 0)
205 assertTrue(result.indexOf("<global-customer-id>gci</") >= 0)
206 assertTrue(result.indexOf("<sdncadapter:CallbackUrl>scu</") >= 0)
207 assertTrue(result.indexOf("<request-id>mri</") >= 0)
208 assertTrue(result.indexOf("<model-invariant-uuid/>") >= 0)
209 assertTrue(result.indexOf("<model-uuid/>") >= 0)
210 assertTrue(result.indexOf("<model-customization-uuid/>") >= 0)
211 assertTrue(result.indexOf("<model-version/>") >= 0)
212 assertTrue(result.indexOf("<model-name/>") >= 0)
217 public void buildSDNCRequest_Ex() {
218 ExecutionEntity mex = setupMock()
219 initBuildSDNCRequest(mex)
221 when(mex.getVariable("allottedResourceId")).thenThrow(new RuntimeException("expected exception"))
223 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
225 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.buildSDNCRequest(mex, "myact", "myreq") }))
229 // ***** preProcessSDNCUnassign *****
233 public void preProcessSDNCUnassign() {
234 ExecutionEntity mex = setupMock()
235 def map = setupMap(mex)
236 initPreProcessSDNC(mex)
238 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
239 DoDeleteAllottedResourceBRG.preProcessSDNCUnassign(mex)
241 def req = map.get("sdncUnassignRequest")
243 assertTrue(req.indexOf("<sdncadapter:SvcAction>unassign</") >= 0)
244 assertTrue(req.indexOf("<request-action>DeleteBRGInstance</") >= 0)
245 assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0)
250 public void preProcessSDNCUnassign_BpmnError() {
251 ExecutionEntity mex = setupMock()
252 initPreProcessSDNC(mex)
254 when(mex.getVariable("allottedResourceId")).thenThrow(new BpmnError("expected exception"))
256 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
258 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCUnassign(mex) }))
263 public void preProcessSDNCUnassign_Ex() {
264 ExecutionEntity mex = setupMock()
265 initPreProcessSDNC(mex)
267 when(mex.getVariable("allottedResourceId")).thenThrow(new RuntimeException("expected exception"))
269 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
271 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCUnassign(mex) }))
275 // ***** preProcessSDNCDelete *****
279 public void preProcessSDNCDelete() {
280 ExecutionEntity mex = setupMock()
281 def map = setupMap(mex)
282 initPreProcessSDNC(mex)
284 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
285 DoDeleteAllottedResourceBRG.preProcessSDNCDelete(mex)
287 def req = map.get("sdncDeleteRequest")
289 assertTrue(req.indexOf("<sdncadapter:SvcAction>delete</") >= 0)
290 assertTrue(req.indexOf("<request-action>DeleteBRGInstance</") >= 0)
291 assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0)
296 public void preProcessSDNCDelete_BpmnError() {
297 ExecutionEntity mex = setupMock()
298 initPreProcessSDNC(mex)
300 when(mex.getVariable("allottedResourceId")).thenThrow(new BpmnError("expected exception"))
302 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
304 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCDelete(mex) }))
309 public void preProcessSDNCDelete_Ex() {
310 ExecutionEntity mex = setupMock()
311 initPreProcessSDNC(mex)
313 when(mex.getVariable("allottedResourceId")).thenThrow(new RuntimeException("expected exception"))
315 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
317 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCDelete(mex) }))
321 // ***** preProcessSDNCDeactivate *****
325 public void preProcessSDNCDeactivate() {
326 ExecutionEntity mex = setupMock()
327 def map = setupMap(mex)
328 initPreProcessSDNC(mex)
330 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
331 DoDeleteAllottedResourceBRG.preProcessSDNCDeactivate(mex)
333 def req = map.get("sdncDeactivateRequest")
335 assertTrue(req.indexOf("<sdncadapter:SvcAction>deactivate</") >= 0)
336 assertTrue(req.indexOf("<request-action>DeleteBRGInstance</") >= 0)
337 assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0)
342 public void preProcessSDNCDeactivate_BpmnError() {
343 ExecutionEntity mex = setupMock()
344 initPreProcessSDNC(mex)
346 when(mex.getVariable("allottedResourceId")).thenThrow(new BpmnError("expected exception"))
348 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
350 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCDeactivate(mex) }))
355 public void preProcessSDNCDeactivate_Ex() {
356 ExecutionEntity mex = setupMock()
357 initPreProcessSDNC(mex)
359 when(mex.getVariable("allottedResourceId")).thenThrow(new RuntimeException("expected exception"))
361 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
363 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCDeactivate(mex) }))
367 // ***** validateSDNCResp *****
371 public void validateSDNCResp() {
372 ExecutionEntity mex = setupMock()
373 def data = initValidateSDNCResp(mex)
374 def resp = initValidateSDNCResp_Resp(200)
376 when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true)
378 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
380 DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "create")
382 verify(mex).getVariable("WorkflowException")
383 verify(mex).getVariable("SDNCA_SuccessIndicator")
384 verify(mex).getVariable(Prefix+"sdncResponseSuccess")
386 verify(mex, never()).getVariable(Prefix + "sdncRequestDataResponseCode")
387 verify(mex, never()).setVariable("wasDeleted", false)
392 public void validateSDNCResp_Fail404_Deactivate_FailNotFound() {
393 ExecutionEntity mex = setupMock()
394 def data = initValidateSDNCResp(mex)
396 def resp = initValidateSDNCResp_Resp(404)
397 when(mex.getVariable(Prefix+"sdncRequestDataResponseCode")).thenReturn("404")
398 when(mex.getVariable("failNotFound")).thenReturn("true")
400 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
402 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "deactivate")}))
407 public void validateSDNCResp_Fail404_Deactivate() {
408 ExecutionEntity mex = setupMock()
409 def data = initValidateSDNCResp(mex)
411 def resp = initValidateSDNCResp_Resp(404)
412 when(mex.getVariable(Prefix+"sdncRequestDataResponseCode")).thenReturn("404")
414 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
416 DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "deactivate")
418 verify(mex).setVariable("ARNotFoundInSDNC", true)
419 verify(mex).setVariable("wasDeleted", false)
424 public void validateSDNCResp_Fail404() {
425 ExecutionEntity mex = setupMock()
426 def data = initValidateSDNCResp(mex)
428 def resp = initValidateSDNCResp_Resp(404)
429 when(mex.getVariable(Prefix+"sdncRequestDataResponseCode")).thenReturn("404")
431 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
433 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "create")}))
438 public void validateSDNCResp_Deactivate() {
439 ExecutionEntity mex = setupMock()
440 def data = initValidateSDNCResp(mex)
441 def resp = initValidateSDNCResp_Resp(200)
443 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
445 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "deactivate")}))
450 public void validateSDNCResp_BpmnError() {
451 ExecutionEntity mex = setupMock()
452 initValidateSDNCResp(mex)
453 def resp = initValidateSDNCResp_Resp(200)
455 when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("expected exception"))
457 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
459 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "create") }))
464 public void validateSDNCResp_Ex() {
465 ExecutionEntity mex = setupMock()
466 initValidateSDNCResp(mex)
467 def resp = initValidateSDNCResp_Resp(200)
469 when(mex.getVariable("WorkflowException")).thenThrow(new RuntimeException("expected exception"))
471 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
473 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "create") }))
478 public void deleteAaiAR() {
479 ExecutionEntity mex = setupMock()
482 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
483 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
485 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
486 DoDeleteAllottedResourceBRG.deleteAaiAR(mex)
491 public void deleteAaiAR_NoArPath() {
492 ExecutionEntity mex = setupMock()
495 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
496 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
498 when(mex.getVariable("aaiARPath")).thenReturn("")
500 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
502 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.deleteAaiAR(mex) }))
507 public void deleteAaiAR_BpmnError() {
508 ExecutionEntity mex = setupMock()
511 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
512 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
514 when(mex.getVariable("aaiARPath")).thenThrow(new BpmnError("expected exception"))
516 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
518 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.deleteAaiAR(mex) }))
523 public void deleteAaiAR_Ex() {
524 ExecutionEntity mex = setupMock()
527 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
528 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
530 when(mex.getVariable("aaiARPath")).thenThrow(new RuntimeException("expected exception"))
532 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
534 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.deleteAaiAR(mex) }))
537 private boolean checkMissingPreProcessRequest(String fieldnm) {
538 ExecutionEntity mex = setupMock()
541 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
543 when(mex.getVariable(fieldnm)).thenReturn("")
545 return doBpmnError( { _ -> DoDeleteAllottedResourceBRG.preProcessRequest(mex) })
548 private void initPreProcess(ExecutionEntity mex) {
549 when(mex.getVariable(DBGFLAG)).thenReturn("true")
550 when(mex.getVariable("mso.workflow.sdncadapter.callback")).thenReturn("sdncurn")
551 when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
552 when(mex.getVariable("allottedResourceId")).thenReturn("ari")
555 private void initGetAaiAR(ExecutionEntity mex) {
556 when(mex.getVariable(DBGFLAG)).thenReturn("true")
557 when(mex.getVariable("allottedResourceType")).thenReturn("BRG")
558 when(mex.getVariable("allottedResourceRole")).thenReturn("BRG")
559 when(mex.getVariable("allottedResourceId")).thenReturn(ARID)
560 when(mex.getVariable("CSI_service")).thenReturn(FileUtil.readResourceFile("__files/VCPE/DoDeleteAllottedResourceBRG/getAR.xml"))
561 when(mex.getVariable("mso.workflow.global.default.aai.namespace")).thenReturn(UrnPropertiesReader.getVariable("mso.workflow.global.default.aai.namespace"))
562 when(mex.getVariable("mso.workflow.global.default.aai.version")).thenReturn(UrnPropertiesReader.getVariable("mso.workflow.global.default.aai.version"))
563 when(mex.getVariable("mso.workflow.default.aai.v8.nodes.query.uri")).thenReturn(UrnPropertiesReader.getVariable("mso.workflow.default.aai.v8.nodes-query.uri"))
564 when(mex.getVariable("aai.endpoint")).thenReturn(aaiUriPfx)
565 when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID)
566 when(mex.getVariable("aaiAROrchStatus")).thenReturn("Active")
569 private initUpdateAaiAROrchStatus(ExecutionEntity mex) {
570 when(mex.getVariable(DBGFLAG)).thenReturn("true")
571 when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID)
574 private initBuildSDNCRequest(ExecutionEntity mex) {
575 when(mex.getVariable(DBGFLAG)).thenReturn("true")
576 when(mex.getVariable("allottedResourceId")).thenReturn("ari")
577 when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
578 when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii")
579 when(mex.getVariable("subscriptionServiceType")).thenReturn("sst")
580 when(mex.getVariable("globalCustomerId")).thenReturn("gci")
581 when(mex.getVariable("sdncCallbackUrl")).thenReturn("scu")
582 when(mex.getVariable("msoRequestId")).thenReturn("mri")
585 private initPreProcessSDNC(ExecutionEntity mex) {
586 when(mex.getVariable(DBGFLAG)).thenReturn("true")
589 private initValidateSDNCResp(ExecutionEntity mex) {
590 when(mex.getVariable(DBGFLAG)).thenReturn("true")
591 when(mex.getVariable("prefix")).thenReturn(Prefix)
592 when(mex.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
595 private String initValidateSDNCResp_Resp(int code) {
596 return "<response-data><response-code>${code}</response-code></response-data>"
599 private initDeleteAaiAR(ExecutionEntity mex) {
600 when(mex.getVariable(DBGFLAG)).thenReturn("true")
601 when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID)
602 when(mex.getVariable("aaiARResourceVersion")).thenReturn("myvers")
603 when(mex.getVariable("aai.endpoint")).thenReturn(aaiUriPfx)