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.junit.Before
28 import org.junit.BeforeClass
31 import org.junit.Ignore
32 import org.mockito.MockitoAnnotations
33 import org.camunda.bpm.engine.delegate.BpmnError
34 import org.openecomp.mso.bpmn.core.WorkflowException
35 import org.openecomp.mso.bpmn.mock.FileUtil
37 import static com.github.tomakehurst.wiremock.client.WireMock.aResponse
38 import static com.github.tomakehurst.wiremock.client.WireMock.get
39 import static com.github.tomakehurst.wiremock.client.WireMock.stubFor
40 import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching
41 import static org.junit.Assert.*;
42 import static org.mockito.Mockito.*
43 import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource
44 import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource
45 import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource
47 import org.openecomp.mso.bpmn.core.RollbackData
49 import com.github.tomakehurst.wiremock.junit.WireMockRule
51 class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase {
54 public WireMockRule wireMockRule = new WireMockRule(PORT)
56 String Prefix = "DCARBRGRB_"
57 String RbType = "DCARBRG_"
60 public static void setUpBeforeClass() {
67 MockitoAnnotations.initMocks(this)
70 public DoCreateAllottedResourceBRGRollbackTest() {
71 super("DoCreateAllottedResourceBRGRollback")
75 // ***** preProcessRequest *****
79 public void preProcessRequest() {
80 ExecutionEntity mex = setupMock()
83 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
84 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
86 verify(mex).getVariable(DBGFLAG)
87 verify(mex).setVariable("prefix", Prefix)
88 verify(mex).setVariable("serviceInstanceId", "sii")
89 verify(mex).setVariable("parentServiceInstanceId", "psii")
90 verify(mex).setVariable("allottedResourceId", "myid")
91 verify(mex).setVariable("rollbackAAI", true)
92 verify(mex).setVariable("aaiARPath", "mypath")
93 verify(mex).setVariable("rollbackSDNC", true)
94 verify(mex).setVariable("deactivateSdnc", "myactivate")
95 verify(mex).setVariable("deleteSdnc", "mycreate")
96 verify(mex).setVariable("unassignSdnc", "true")
97 verify(mex).setVariable("sdncDeactivateRequest", "activatereq")
98 verify(mex).setVariable("sdncDeleteRequest", "createreq")
99 verify(mex).setVariable("sdncUnassignRequest", "assignreq")
101 verify(mex, never()).setVariable("skipRollback", true)
106 public void preProcessRequest_RollbackDisabled() {
107 ExecutionEntity mex = setupMock()
110 when(mex.getVariable("disableRollback")).thenReturn("true")
112 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
113 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
115 verify(mex).getVariable(DBGFLAG)
116 verify(mex).setVariable("prefix", Prefix)
117 verify(mex).setVariable("serviceInstanceId", "sii")
118 verify(mex).setVariable("parentServiceInstanceId", "psii")
119 verify(mex).setVariable("allottedResourceId", "myid")
120 verify(mex).setVariable("rollbackAAI", true)
121 verify(mex).setVariable("aaiARPath", "mypath")
122 verify(mex).setVariable("rollbackSDNC", true)
123 verify(mex).setVariable("deactivateSdnc", "myactivate")
124 verify(mex).setVariable("deleteSdnc", "mycreate")
125 verify(mex).setVariable("unassignSdnc", "true")
126 verify(mex).setVariable("sdncDeactivateRequest", "activatereq")
127 verify(mex).setVariable("sdncDeleteRequest", "createreq")
128 verify(mex).setVariable("sdncUnassignRequest", "assignreq")
130 verify(mex).setVariable("skipRollback", true)
135 public void preProcessRequest_NoAAI() {
136 ExecutionEntity mex = setupMock()
137 def data = initPreProcess(mex)
139 when(mex.getVariable("rollbackAAI")).thenReturn(false)
140 data.put(RbType, "rollbackAAI", "false")
142 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
143 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
145 verify(mex).getVariable(DBGFLAG)
146 verify(mex).setVariable("prefix", Prefix)
147 verify(mex).setVariable("serviceInstanceId", "sii")
148 verify(mex).setVariable("parentServiceInstanceId", "psii")
149 verify(mex).setVariable("allottedResourceId", "myid")
150 verify(mex, never()).setVariable("rollbackAAI", true)
151 verify(mex, never()).setVariable("aaiARPath", "mypath")
152 verify(mex).setVariable("rollbackSDNC", true)
153 verify(mex).setVariable("deactivateSdnc", "myactivate")
154 verify(mex).setVariable("deleteSdnc", "mycreate")
155 verify(mex).setVariable("unassignSdnc", "true")
156 verify(mex).setVariable("sdncDeactivateRequest", "activatereq")
157 verify(mex).setVariable("sdncDeleteRequest", "createreq")
158 verify(mex).setVariable("sdncUnassignRequest", "assignreq")
160 verify(mex, never()).setVariable("skipRollback", true)
165 public void preProcessRequest_NoAssign() {
166 ExecutionEntity mex = setupMock()
167 def data = initPreProcess(mex)
169 when(mex.getVariable("rollbackSDNC")).thenReturn(false)
170 data.put(RbType, "rollbackSDNCassign", "false")
172 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
173 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
175 verify(mex).getVariable(DBGFLAG)
176 verify(mex).setVariable("prefix", Prefix)
177 verify(mex).setVariable("serviceInstanceId", "sii")
178 verify(mex).setVariable("parentServiceInstanceId", "psii")
179 verify(mex).setVariable("allottedResourceId", "myid")
180 verify(mex).setVariable("rollbackAAI", true)
181 verify(mex).setVariable("aaiARPath", "mypath")
182 verify(mex, never()).setVariable("rollbackSDNC", true)
183 verify(mex, never()).setVariable("deactivateSdnc", "myactivate")
184 verify(mex, never()).setVariable("deleteSdnc", "mycreate")
185 verify(mex, never()).setVariable("unassignSdnc", "true")
186 verify(mex, never()).setVariable("sdncDeactivateRequest", "activatereq")
187 verify(mex, never()).setVariable("sdncDeleteRequest", "createreq")
188 verify(mex, never()).setVariable("sdncUnassignRequest", "assignreq")
190 verify(mex, never()).setVariable("skipRollback", true)
195 public void preProcessRequest_NoAAI_NoAssign() {
196 ExecutionEntity mex = setupMock()
199 when(mex.getVariable("rollbackAAI")).thenReturn(false)
200 when(mex.getVariable("rollbackSDNC")).thenReturn(false)
202 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
203 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
205 verify(mex).setVariable("skipRollback", true)
210 public void preProcessRequest_NoRbStructure() {
211 ExecutionEntity mex = setupMock()
214 when(mex.getVariable("rollbackData")).thenReturn(new RollbackData())
216 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
217 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
219 verify(mex).setVariable("skipRollback", true)
224 public void preProcessRequest_NullRb() {
225 ExecutionEntity mex = setupMock()
228 when(mex.getVariable("rollbackData")).thenReturn(null)
230 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
231 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
233 verify(mex).setVariable("skipRollback", true)
238 public void preProcessRequest_BpmnError() {
239 ExecutionEntity mex = setupMock()
242 when(mex.getVariable("rollbackData")).thenThrow(new BpmnError("expected exception"))
244 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
246 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.preProcessRequest(mex) }))
251 public void preProcessRequest_Ex() {
252 ExecutionEntity mex = setupMock()
255 when(mex.getVariable("rollbackData")).thenThrow(new RuntimeException("expected exception"))
257 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
259 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.preProcessRequest(mex) }))
264 public void updateAaiAROrchStatus() {
265 ExecutionEntity mex = setupMock()
266 initUpdateAaiAROrchStatus(mex)
268 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
269 MockPatchAllottedResource(CUST, SVC, INST, ARID)
271 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
272 DoCreateAllottedResourceBRGRollback.updateAaiAROrchStatus(mex, "success")
277 public void updateAaiAROrchStatus_EmptyResponse() {
278 ExecutionEntity mex = setupMock()
279 initUpdateAaiAROrchStatus(mex)
282 .stubFor(get(urlMatching("/aai/v[0-9]+/.*"))
283 .willReturn(aResponse()
286 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
288 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.updateAaiAROrchStatus(mex, "success") }))
293 public void updateAaiAROrchStatus_NoArPath() {
294 ExecutionEntity mex = setupMock()
295 initUpdateAaiAROrchStatus(mex)
297 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
298 MockPatchAllottedResource(CUST, SVC, INST, ARID)
300 when(mex.getVariable("aaiARPath")).thenReturn(null)
302 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
304 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.updateAaiAROrchStatus(mex, "success") }))
308 // ***** validateSDNCResp *****
312 public void validateSDNCResp() {
313 ExecutionEntity mex = setupMock()
314 initValidateSDNCResp(mex)
315 def resp = initValidateSDNCResp_Resp()
317 when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true)
319 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
321 DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create")
323 verify(mex).getVariable("WorkflowException")
324 verify(mex).getVariable("SDNCA_SuccessIndicator")
329 public void validateSDNCResp_Unsuccessful() {
330 ExecutionEntity mex = setupMock()
331 initValidateSDNCResp(mex)
332 def resp = initValidateSDNCResp_Resp()
334 when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(false)
336 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
338 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create") }))
343 public void validateSDNCResp_BpmnError404() {
344 ExecutionEntity mex = setupMock()
345 initValidateSDNCResp(mex)
346 def resp = initValidateSDNCResp_Resp()
347 when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true)
349 when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("404", "expected exception"))
351 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
353 DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create")
358 public void validateSDNCResp_BpmnError() {
359 ExecutionEntity mex = setupMock()
360 initValidateSDNCResp(mex)
361 def resp = initValidateSDNCResp_Resp()
362 when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true)
364 when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("expected exception"))
366 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
368 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create") }))
373 public void validateSDNCResp_Ex() {
374 ExecutionEntity mex = setupMock()
375 initValidateSDNCResp(mex)
376 def resp = initValidateSDNCResp_Resp()
377 when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true)
379 when(mex.getVariable("WorkflowException")).thenThrow(new RuntimeException("expected exception"))
381 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
383 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create") }))
388 public void deleteAaiAR() {
389 ExecutionEntity mex = setupMock()
392 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
393 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
395 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
396 DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex)
401 public void deleteAaiAR_NoArPath() {
402 ExecutionEntity mex = setupMock()
405 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
406 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
408 when(mex.getVariable("aaiARPath")).thenReturn("")
410 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
412 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex) }))
417 public void deleteAaiAR_BpmnError() {
418 ExecutionEntity mex = setupMock()
421 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
422 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
424 when(mex.getVariable("aaiARPath")).thenThrow(new BpmnError("expected exception"))
426 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
428 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex) }))
433 public void deleteAaiAR_Ex() {
434 ExecutionEntity mex = setupMock()
437 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
438 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
440 when(mex.getVariable("aaiARPath")).thenThrow(new RuntimeException("expected exception"))
442 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
444 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex) }))
449 public void postProcessRequest() {
450 ExecutionEntity mex = setupMock()
451 initPostProcessRequest(mex)
453 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
454 DoCreateAllottedResourceBRGRollback.postProcessRequest(mex)
456 verify(mex).getVariable(DBGFLAG)
457 verify(mex).setVariable("rollbackData", null)
458 verify(mex).setVariable("rolledBack", true)
463 public void postProcessRequest_RolledBack() {
464 ExecutionEntity mex = setupMock()
465 initPostProcessRequest(mex)
467 when(mex.getVariable("skipRollback")).thenReturn(true)
469 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
470 DoCreateAllottedResourceBRGRollback.postProcessRequest(mex)
472 verify(mex).getVariable(DBGFLAG)
473 verify(mex).setVariable("rollbackData", null)
474 verify(mex, never()).setVariable("rolledBack", true)
479 public void postProcessRequest_BpmnError() {
480 ExecutionEntity mex = setupMock()
481 initPostProcessRequest(mex)
483 when(mex.getVariable("skipRollback")).thenThrow(new BpmnError("expected exception"))
485 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
486 DoCreateAllottedResourceBRGRollback.postProcessRequest(mex)
488 verify(mex).getVariable(DBGFLAG)
489 verify(mex).setVariable("rollbackData", null)
490 verify(mex, never()).setVariable("rolledBack", true)
495 public void postProcessRequest_Ex() {
496 ExecutionEntity mex = setupMock()
497 initPostProcessRequest(mex)
499 when(mex.getVariable("skipRollback")).thenThrow(new RuntimeException("expected exception"))
501 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
502 DoCreateAllottedResourceBRGRollback.postProcessRequest(mex)
504 verify(mex).getVariable(DBGFLAG)
505 verify(mex).setVariable("rollbackData", null)
506 verify(mex, never()).setVariable("rolledBack", true)
511 public void processRollbackException() {
512 ExecutionEntity mex = setupMock()
513 initProcessRollbackException(mex)
515 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
516 DoCreateAllottedResourceBRGRollback.processRollbackException(mex)
518 verify(mex).getVariable(DBGFLAG)
519 verify(mex).setVariable("rollbackData", null)
520 verify(mex).setVariable("rolledBack", false)
521 verify(mex).setVariable("rollbackError", "Caught exception in AllottedResource Create Rollback")
522 verify(mex).setVariable("WorkflowException", null)
527 public void processRollbackException_BpmnError() {
528 ExecutionEntity mex = setupMock()
529 initProcessRollbackException(mex)
531 doThrow(new BpmnError("expected exception")).when(mex).setVariable("rollbackData", null)
533 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
534 DoCreateAllottedResourceBRGRollback.processRollbackException(mex)
539 public void processRollbackException_Ex() {
540 ExecutionEntity mex = setupMock()
541 initProcessRollbackException(mex)
543 doThrow(new RuntimeException("expected exception")).when(mex).setVariable("rollbackData", null)
545 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
546 DoCreateAllottedResourceBRGRollback.processRollbackException(mex)
551 public void processRollbackJavaException() {
552 ExecutionEntity mex = setupMock()
553 initProcessRollbackException(mex)
555 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
556 DoCreateAllottedResourceBRGRollback.processRollbackJavaException(mex)
558 verify(mex).getVariable(DBGFLAG)
559 verify(mex).setVariable("rollbackData", null)
560 verify(mex).setVariable("rolledBack", false)
561 verify(mex).setVariable("rollbackError", "Caught Java exception in AllottedResource Create Rollback")
562 verify(mex, never()).setVariable("WorkflowException", null)
567 public void processRollbackJavaException_BpmnError() {
568 ExecutionEntity mex = setupMock()
569 initProcessRollbackException(mex)
571 doThrow(new BpmnError("expected exception")).when(mex).setVariable("rollbackData", null)
573 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
574 DoCreateAllottedResourceBRGRollback.processRollbackJavaException(mex)
579 public void processRollbackJavaException_Ex() {
580 ExecutionEntity mex = setupMock()
581 initProcessRollbackException(mex)
583 doThrow(new RuntimeException("expected exception")).when(mex).setVariable("rollbackData", null)
585 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
586 DoCreateAllottedResourceBRGRollback.processRollbackJavaException(mex)
589 private RollbackData initPreProcess(ExecutionEntity mex) {
590 def data = new RollbackData()
592 when(mex.getVariable(DBGFLAG)).thenReturn("true")
593 when(mex.getVariable("rollbackData")).thenReturn(data)
594 when(mex.getVariable("rollbackAAI")).thenReturn(true)
595 when(mex.getVariable("rollbackSDNC")).thenReturn(true)
596 when(mex.getVariable("disableRollback")).thenReturn("false")
598 data.put("SERVICEINSTANCE", "allottedResourceId", "myid")
600 data.put(RbType, "serviceInstanceId", "sii")
601 data.put(RbType, "parentServiceInstanceId", "psii")
603 data.put(RbType, "rollbackAAI", "true")
604 data.put(RbType, "aaiARPath", "mypath")
606 data.put(RbType, "rollbackSDNCassign", "true")
607 data.put(RbType, "rollbackSDNCactivate", "myactivate")
608 data.put(RbType, "rollbackSDNCcreate", "mycreate")
609 data.put(RbType, "sdncActivateRollbackReq", "activatereq")
610 data.put(RbType, "sdncCreateRollbackReq", "createreq")
611 data.put(RbType, "sdncAssignRollbackReq", "assignreq")
616 private initUpdateAaiAROrchStatus(ExecutionEntity mex) {
617 when(mex.getVariable(DBGFLAG)).thenReturn("true")
618 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)
619 when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx)
622 private initValidateSDNCResp(ExecutionEntity mex) {
623 when(mex.getVariable(DBGFLAG)).thenReturn("true")
624 when(mex.getVariable("prefix")).thenReturn(Prefix)
625 when(mex.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
628 private String initValidateSDNCResp_Resp() {
629 return "<response-data><response-code>200</response-code></response-data>"
632 private initDeleteAaiAR(ExecutionEntity mex) {
633 when(mex.getVariable(DBGFLAG)).thenReturn("true")
634 when(mex.getVariable("aaiARResourceVersion")).thenReturn(VERS)
635 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)
636 when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx)
639 private initPostProcessRequest(ExecutionEntity mex) {
640 when(mex.getVariable(DBGFLAG)).thenReturn("true")
641 when(mex.getVariable("skipRollback")).thenReturn(false)
644 private initProcessRollbackException(ExecutionEntity mex) {
645 when(mex.getVariable(DBGFLAG)).thenReturn("true")
648 private initProcessRollbackJavaException(ExecutionEntity mex) {
649 when(mex.getVariable(DBGFLAG)).thenReturn("true")