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=========================================================
20 package org.openecomp.mso.bpmn.vcpe.scripts
23 import org.camunda.bpm.engine.ProcessEngineServices
24 import org.camunda.bpm.engine.RepositoryService
25 import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
26 import org.camunda.bpm.engine.repository.ProcessDefinition
27 import org.camunda.bpm.engine.runtime.Execution
28 import org.junit.Before
29 import org.junit.BeforeClass
32 import org.junit.Ignore
33 import org.mockito.MockitoAnnotations
34 import org.camunda.bpm.engine.delegate.BpmnError
35 import org.openecomp.mso.bpmn.core.WorkflowException
36 import org.openecomp.mso.bpmn.mock.FileUtil
38 import static com.github.tomakehurst.wiremock.client.WireMock.aResponse
39 import static com.github.tomakehurst.wiremock.client.WireMock.delete
40 import static com.github.tomakehurst.wiremock.client.WireMock.get
41 import static com.github.tomakehurst.wiremock.client.WireMock.patch
42 import static com.github.tomakehurst.wiremock.client.WireMock.put
43 import static com.github.tomakehurst.wiremock.client.WireMock.stubFor
44 import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching
45 import static org.junit.Assert.*;
46 import static org.mockito.Mockito.*
47 import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource
48 import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource
49 import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource
50 import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockQueryAllottedResourceById
54 import org.openecomp.mso.bpmn.core.RollbackData
55 import org.openecomp.mso.bpmn.vcpe.scripts.MapSetter
57 import com.github.tomakehurst.wiremock.junit.WireMockRule
59 class DoDeleteAllottedResourceBRGTest extends GroovyTestBase {
62 public WireMockRule wireMockRule = new WireMockRule(PORT)
64 String Prefix = "DDARBRG_"
67 public static void setUpBeforeClass() {
74 MockitoAnnotations.initMocks(this)
77 public DoDeleteAllottedResourceBRGTest() {
78 super("DoDeleteAllottedResourceBRG")
82 // ***** preProcessRequest *****
86 public void preProcessRequest() {
87 ExecutionEntity mex = setupMock()
90 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
91 DoDeleteAllottedResourceBRG.preProcessRequest(mex)
93 verify(mex).getVariable(DBGFLAG)
94 verify(mex).setVariable("prefix", Prefix)
95 verify(mex).setVariable("sdncCallbackUrl", "sdncurn")
97 assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdncadapter_callback"))
98 assertTrue(checkMissingPreProcessRequest("serviceInstanceId"))
99 assertTrue(checkMissingPreProcessRequest("allottedResourceId"))
104 public void preProcessRequest_BpmnError() {
105 ExecutionEntity mex = setupMock()
108 when(mex.getVariable("serviceInstanceId")).thenThrow(new BpmnError("expected exception"))
110 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
112 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.preProcessRequest(mex) }))
117 public void preProcessRequest_Ex() {
118 ExecutionEntity mex = setupMock()
121 when(mex.getVariable("serviceInstanceId")).thenThrow(new RuntimeException("expected exception"))
123 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
125 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.preProcessRequest(mex) }))
129 // ***** getAaiAR *****
133 public void getAaiAR() {
134 MockQueryAllottedResourceById(ARID, "GenericFlows/getARUrlById.xml")
135 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
137 ExecutionEntity mex = setupMock()
140 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
141 DoDeleteAllottedResourceBRG.getAaiAR(mex)
143 verify(mex).setVariable("parentServiceInstanceId", INST)
148 public void getAaiAR_EmptyResponse() {
150 // note: empty result-link
152 .stubFor(get(urlMatching("/aai/.*/search/.*"))
153 .willReturn(aResponse()
155 .withHeader("Content-Type", "text/xml")
156 .withBody("<result-data></result-data>")))
158 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
160 ExecutionEntity mex = setupMock()
163 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
165 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.getAaiAR(mex) }))
169 // ***** updateAaiAROrchStatus *****
173 public void updateAaiAROrchStatus() {
174 ExecutionEntity mex = setupMock()
175 initUpdateAaiAROrchStatus(mex)
177 MockPatchAllottedResource(CUST, SVC, INST, ARID)
179 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
180 DoDeleteAllottedResourceBRG.updateAaiAROrchStatus(mex, "success")
184 // ***** buildSDNCRequest *****
188 public void buildSDNCRequest() {
189 ExecutionEntity mex = setupMock()
190 initBuildSDNCRequest(mex)
192 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
194 String result = DoDeleteAllottedResourceBRG.buildSDNCRequest(mex, "myact", "myreq")
196 assertTrue(result.indexOf("<sdncadapter:RequestId>myreq</") >= 0)
197 assertTrue(result.indexOf("<sdncadapter:SvcAction>myact</") >= 0)
198 assertTrue(result.indexOf("<allotted-resource-id>ari</") >= 0)
199 assertTrue(result.indexOf("<sdncadapter:SvcInstanceId>sii</") >= 0)
200 assertTrue(result.indexOf("<service-instance-id>sii</") >= 0)
201 assertTrue(result.indexOf("<parent-service-instance-id>psii</") >= 0)
202 assertTrue(result.indexOf("<subscription-service-type>sst</") >= 0)
203 assertTrue(result.indexOf("<global-customer-id>gci</") >= 0)
204 assertTrue(result.indexOf("<sdncadapter:CallbackUrl>scu</") >= 0)
205 assertTrue(result.indexOf("<request-id>mri</") >= 0)
206 assertTrue(result.indexOf("<model-invariant-uuid/>") >= 0)
207 assertTrue(result.indexOf("<model-uuid/>") >= 0)
208 assertTrue(result.indexOf("<model-customization-uuid/>") >= 0)
209 assertTrue(result.indexOf("<model-version/>") >= 0)
210 assertTrue(result.indexOf("<model-name/>") >= 0)
215 public void buildSDNCRequest_Ex() {
216 ExecutionEntity mex = setupMock()
217 initBuildSDNCRequest(mex)
219 when(mex.getVariable("allottedResourceId")).thenThrow(new RuntimeException("expected exception"))
221 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
223 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.buildSDNCRequest(mex, "myact", "myreq") }))
227 // ***** preProcessSDNCUnassign *****
231 public void preProcessSDNCUnassign() {
232 ExecutionEntity mex = setupMock()
233 def map = setupMap(mex)
234 initPreProcessSDNC(mex)
236 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
237 DoDeleteAllottedResourceBRG.preProcessSDNCUnassign(mex)
239 def req = map.get("sdncUnassignRequest")
241 assertTrue(req.indexOf("<sdncadapter:SvcAction>unassign</") >= 0)
242 assertTrue(req.indexOf("<request-action>DeleteBRGInstance</") >= 0)
243 assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0)
248 public void preProcessSDNCUnassign_BpmnError() {
249 ExecutionEntity mex = setupMock()
250 initPreProcessSDNC(mex)
252 when(mex.getVariable("allottedResourceId")).thenThrow(new BpmnError("expected exception"))
254 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
256 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCUnassign(mex) }))
261 public void preProcessSDNCUnassign_Ex() {
262 ExecutionEntity mex = setupMock()
263 initPreProcessSDNC(mex)
265 when(mex.getVariable("allottedResourceId")).thenThrow(new RuntimeException("expected exception"))
267 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
269 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCUnassign(mex) }))
273 // ***** preProcessSDNCDelete *****
277 public void preProcessSDNCDelete() {
278 ExecutionEntity mex = setupMock()
279 def map = setupMap(mex)
280 initPreProcessSDNC(mex)
282 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
283 DoDeleteAllottedResourceBRG.preProcessSDNCDelete(mex)
285 def req = map.get("sdncDeleteRequest")
287 assertTrue(req.indexOf("<sdncadapter:SvcAction>delete</") >= 0)
288 assertTrue(req.indexOf("<request-action>DeleteBRGInstance</") >= 0)
289 assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0)
294 public void preProcessSDNCDelete_BpmnError() {
295 ExecutionEntity mex = setupMock()
296 initPreProcessSDNC(mex)
298 when(mex.getVariable("allottedResourceId")).thenThrow(new BpmnError("expected exception"))
300 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
302 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCDelete(mex) }))
307 public void preProcessSDNCDelete_Ex() {
308 ExecutionEntity mex = setupMock()
309 initPreProcessSDNC(mex)
311 when(mex.getVariable("allottedResourceId")).thenThrow(new RuntimeException("expected exception"))
313 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
315 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCDelete(mex) }))
319 // ***** preProcessSDNCDeactivate *****
323 public void preProcessSDNCDeactivate() {
324 ExecutionEntity mex = setupMock()
325 def map = setupMap(mex)
326 initPreProcessSDNC(mex)
328 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
329 DoDeleteAllottedResourceBRG.preProcessSDNCDeactivate(mex)
331 def req = map.get("sdncDeactivateRequest")
333 assertTrue(req.indexOf("<sdncadapter:SvcAction>deactivate</") >= 0)
334 assertTrue(req.indexOf("<request-action>DeleteBRGInstance</") >= 0)
335 assertTrue(req.indexOf("<sdncadapter:RequestId>") >= 0)
340 public void preProcessSDNCDeactivate_BpmnError() {
341 ExecutionEntity mex = setupMock()
342 initPreProcessSDNC(mex)
344 when(mex.getVariable("allottedResourceId")).thenThrow(new BpmnError("expected exception"))
346 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
348 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCDeactivate(mex) }))
353 public void preProcessSDNCDeactivate_Ex() {
354 ExecutionEntity mex = setupMock()
355 initPreProcessSDNC(mex)
357 when(mex.getVariable("allottedResourceId")).thenThrow(new RuntimeException("expected exception"))
359 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
361 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.preProcessSDNCDeactivate(mex) }))
365 // ***** validateSDNCResp *****
369 public void validateSDNCResp() {
370 ExecutionEntity mex = setupMock()
371 def data = initValidateSDNCResp(mex)
372 def resp = initValidateSDNCResp_Resp(200)
374 when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true)
376 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
378 DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "create")
380 verify(mex).getVariable("WorkflowException")
381 verify(mex).getVariable("SDNCA_SuccessIndicator")
382 verify(mex).getVariable(Prefix+"sdncResponseSuccess")
384 verify(mex, never()).getVariable(Prefix + "sdncRequestDataResponseCode")
385 verify(mex, never()).setVariable("wasDeleted", false)
390 public void validateSDNCResp_Fail404_Deactivate_FailNotFound() {
391 ExecutionEntity mex = setupMock()
392 def data = initValidateSDNCResp(mex)
394 def resp = initValidateSDNCResp_Resp(404)
395 when(mex.getVariable(Prefix+"sdncRequestDataResponseCode")).thenReturn("404")
396 when(mex.getVariable("failNotFound")).thenReturn("true")
398 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
400 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "deactivate")}))
405 public void validateSDNCResp_Fail404_Deactivate() {
406 ExecutionEntity mex = setupMock()
407 def data = initValidateSDNCResp(mex)
409 def resp = initValidateSDNCResp_Resp(404)
410 when(mex.getVariable(Prefix+"sdncRequestDataResponseCode")).thenReturn("404")
412 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
414 DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "deactivate")
416 verify(mex).setVariable("ARNotFoundInSDNC", true)
417 verify(mex).setVariable("wasDeleted", false)
422 public void validateSDNCResp_Fail404() {
423 ExecutionEntity mex = setupMock()
424 def data = initValidateSDNCResp(mex)
426 def resp = initValidateSDNCResp_Resp(404)
427 when(mex.getVariable(Prefix+"sdncRequestDataResponseCode")).thenReturn("404")
429 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
431 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "create")}))
436 public void validateSDNCResp_Deactivate() {
437 ExecutionEntity mex = setupMock()
438 def data = initValidateSDNCResp(mex)
439 def resp = initValidateSDNCResp_Resp(200)
441 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
443 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "deactivate")}))
448 public void validateSDNCResp_BpmnError() {
449 ExecutionEntity mex = setupMock()
450 initValidateSDNCResp(mex)
451 def resp = initValidateSDNCResp_Resp(200)
453 when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("expected exception"))
455 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
457 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "create") }))
462 public void validateSDNCResp_Ex() {
463 ExecutionEntity mex = setupMock()
464 initValidateSDNCResp(mex)
465 def resp = initValidateSDNCResp_Resp(200)
467 when(mex.getVariable("WorkflowException")).thenThrow(new RuntimeException("expected exception"))
469 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
471 assertTrue(doBpmnError({ _ -> DoDeleteAllottedResourceBRG.validateSDNCResp(mex, resp, "create") }))
476 public void deleteAaiAR() {
477 ExecutionEntity mex = setupMock()
480 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
481 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
483 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
484 DoDeleteAllottedResourceBRG.deleteAaiAR(mex)
489 public void deleteAaiAR_NoArPath() {
490 ExecutionEntity mex = setupMock()
493 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
494 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
496 when(mex.getVariable("aaiARPath")).thenReturn("")
498 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
500 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.deleteAaiAR(mex) }))
505 public void deleteAaiAR_BpmnError() {
506 ExecutionEntity mex = setupMock()
509 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
510 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
512 when(mex.getVariable("aaiARPath")).thenThrow(new BpmnError("expected exception"))
514 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
516 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.deleteAaiAR(mex) }))
521 public void deleteAaiAR_Ex() {
522 ExecutionEntity mex = setupMock()
525 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoDeleteAllottedResourceBRG/arGetById.xml")
526 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
528 when(mex.getVariable("aaiARPath")).thenThrow(new RuntimeException("expected exception"))
530 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
532 assertTrue(doBpmnError( { _ -> DoDeleteAllottedResourceBRG.deleteAaiAR(mex) }))
535 private boolean checkMissingPreProcessRequest(String fieldnm) {
536 ExecutionEntity mex = setupMock()
539 DoDeleteAllottedResourceBRG DoDeleteAllottedResourceBRG = new DoDeleteAllottedResourceBRG()
541 when(mex.getVariable(fieldnm)).thenReturn("")
543 return doBpmnError( { _ -> DoDeleteAllottedResourceBRG.preProcessRequest(mex) })
546 private void initPreProcess(ExecutionEntity mex) {
547 when(mex.getVariable(DBGFLAG)).thenReturn("true")
548 when(mex.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("sdncurn")
549 when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
550 when(mex.getVariable("allottedResourceId")).thenReturn("ari")
553 private void initGetAaiAR(ExecutionEntity mex) {
554 when(mex.getVariable(DBGFLAG)).thenReturn("true")
555 when(mex.getVariable("allottedResourceType")).thenReturn("BRG")
556 when(mex.getVariable("allottedResourceRole")).thenReturn("BRG")
557 when(mex.getVariable("allottedResourceId")).thenReturn(ARID)
558 when(mex.getVariable("CSI_service")).thenReturn(FileUtil.readResourceFile("__files/VCPE/DoDeleteAllottedResourceBRG/getAR.xml"))
559 when(mex.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn(urnProps.get("mso.workflow.global.default.aai.namespace"))
560 when(mex.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn(urnProps.get("mso.workflow.global.default.aai.version"))
561 when(mex.getVariable("URN_mso_workflow_default_aai_v8_nodes_query_uri")).thenReturn(urnProps.get("mso.workflow.default.aai.v8.nodes-query.uri"))
562 when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx)
563 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)
564 when(mex.getVariable("aaiAROrchStatus")).thenReturn("Active")
567 private initUpdateAaiAROrchStatus(ExecutionEntity mex) {
568 when(mex.getVariable(DBGFLAG)).thenReturn("true")
569 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)
572 private initBuildSDNCRequest(ExecutionEntity mex) {
573 when(mex.getVariable(DBGFLAG)).thenReturn("true")
574 when(mex.getVariable("allottedResourceId")).thenReturn("ari")
575 when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
576 when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii")
577 when(mex.getVariable("subscriptionServiceType")).thenReturn("sst")
578 when(mex.getVariable("globalCustomerId")).thenReturn("gci")
579 when(mex.getVariable("sdncCallbackUrl")).thenReturn("scu")
580 when(mex.getVariable("msoRequestId")).thenReturn("mri")
583 private initPreProcessSDNC(ExecutionEntity mex) {
584 when(mex.getVariable(DBGFLAG)).thenReturn("true")
587 private initValidateSDNCResp(ExecutionEntity mex) {
588 when(mex.getVariable(DBGFLAG)).thenReturn("true")
589 when(mex.getVariable("prefix")).thenReturn(Prefix)
590 when(mex.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
593 private String initValidateSDNCResp_Resp(int code) {
594 return "<response-data><response-code>${code}</response-code></response-data>"
597 private initDeleteAaiAR(ExecutionEntity mex) {
598 when(mex.getVariable(DBGFLAG)).thenReturn("true")
599 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)
600 when(mex.getVariable("aaiARResourceVersion")).thenReturn("myvers")
601 when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx)