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.get
40 import static com.github.tomakehurst.wiremock.client.WireMock.stubFor
41 import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching
42 import static org.junit.Assert.*;
43 import static org.mockito.Mockito.*
44 import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource
45 import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource
46 import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource
48 import org.openecomp.mso.bpmn.core.RollbackData
50 import com.github.tomakehurst.wiremock.junit.WireMockRule
52 class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase {
55 public WireMockRule wireMockRule = new WireMockRule(PORT)
57 String Prefix = "DCARBRGRB_"
58 String RbType = "DCARBRG_"
61 public static void setUpBeforeClass() {
68 MockitoAnnotations.initMocks(this)
71 public DoCreateAllottedResourceBRGRollbackTest() {
72 super("DoCreateAllottedResourceBRGRollback")
76 // ***** preProcessRequest *****
80 public void preProcessRequest() {
81 ExecutionEntity mex = setupMock()
84 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
85 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
87 verify(mex).getVariable(DBGFLAG)
88 verify(mex).setVariable("prefix", Prefix)
89 verify(mex).setVariable("serviceInstanceId", "sii")
90 verify(mex).setVariable("parentServiceInstanceId", "psii")
91 verify(mex).setVariable("allottedResourceId", "myid")
92 verify(mex).setVariable("rollbackAAI", true)
93 verify(mex).setVariable("aaiARPath", "mypath")
94 verify(mex).setVariable("rollbackSDNC", true)
95 verify(mex).setVariable("deactivateSdnc", "myactivate")
96 verify(mex).setVariable("deleteSdnc", "mycreate")
97 verify(mex).setVariable("unassignSdnc", "true")
98 verify(mex).setVariable("sdncDeactivateRequest", "activatereq")
99 verify(mex).setVariable("sdncDeleteRequest", "createreq")
100 verify(mex).setVariable("sdncUnassignRequest", "assignreq")
102 verify(mex, never()).setVariable("skipRollback", true)
107 public void preProcessRequest_RollbackDisabled() {
108 ExecutionEntity mex = setupMock()
111 when(mex.getVariable("disableRollback")).thenReturn("true")
113 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
114 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
116 verify(mex).getVariable(DBGFLAG)
117 verify(mex).setVariable("prefix", Prefix)
118 verify(mex).setVariable("serviceInstanceId", "sii")
119 verify(mex).setVariable("parentServiceInstanceId", "psii")
120 verify(mex).setVariable("allottedResourceId", "myid")
121 verify(mex).setVariable("rollbackAAI", true)
122 verify(mex).setVariable("aaiARPath", "mypath")
123 verify(mex).setVariable("rollbackSDNC", true)
124 verify(mex).setVariable("deactivateSdnc", "myactivate")
125 verify(mex).setVariable("deleteSdnc", "mycreate")
126 verify(mex).setVariable("unassignSdnc", "true")
127 verify(mex).setVariable("sdncDeactivateRequest", "activatereq")
128 verify(mex).setVariable("sdncDeleteRequest", "createreq")
129 verify(mex).setVariable("sdncUnassignRequest", "assignreq")
131 verify(mex).setVariable("skipRollback", true)
136 public void preProcessRequest_NoAAI() {
137 ExecutionEntity mex = setupMock()
138 def data = initPreProcess(mex)
140 when(mex.getVariable("rollbackAAI")).thenReturn(false)
141 data.put(RbType, "rollbackAAI", "false")
143 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
144 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
146 verify(mex).getVariable(DBGFLAG)
147 verify(mex).setVariable("prefix", Prefix)
148 verify(mex).setVariable("serviceInstanceId", "sii")
149 verify(mex).setVariable("parentServiceInstanceId", "psii")
150 verify(mex).setVariable("allottedResourceId", "myid")
151 verify(mex, never()).setVariable("rollbackAAI", true)
152 verify(mex, never()).setVariable("aaiARPath", "mypath")
153 verify(mex).setVariable("rollbackSDNC", true)
154 verify(mex).setVariable("deactivateSdnc", "myactivate")
155 verify(mex).setVariable("deleteSdnc", "mycreate")
156 verify(mex).setVariable("unassignSdnc", "true")
157 verify(mex).setVariable("sdncDeactivateRequest", "activatereq")
158 verify(mex).setVariable("sdncDeleteRequest", "createreq")
159 verify(mex).setVariable("sdncUnassignRequest", "assignreq")
161 verify(mex, never()).setVariable("skipRollback", true)
166 public void preProcessRequest_NoAssign() {
167 ExecutionEntity mex = setupMock()
168 def data = initPreProcess(mex)
170 when(mex.getVariable("rollbackSDNC")).thenReturn(false)
171 data.put(RbType, "rollbackSDNCassign", "false")
173 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
174 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
176 verify(mex).getVariable(DBGFLAG)
177 verify(mex).setVariable("prefix", Prefix)
178 verify(mex).setVariable("serviceInstanceId", "sii")
179 verify(mex).setVariable("parentServiceInstanceId", "psii")
180 verify(mex).setVariable("allottedResourceId", "myid")
181 verify(mex).setVariable("rollbackAAI", true)
182 verify(mex).setVariable("aaiARPath", "mypath")
183 verify(mex, never()).setVariable("rollbackSDNC", true)
184 verify(mex, never()).setVariable("deactivateSdnc", "myactivate")
185 verify(mex, never()).setVariable("deleteSdnc", "mycreate")
186 verify(mex, never()).setVariable("unassignSdnc", "true")
187 verify(mex, never()).setVariable("sdncDeactivateRequest", "activatereq")
188 verify(mex, never()).setVariable("sdncDeleteRequest", "createreq")
189 verify(mex, never()).setVariable("sdncUnassignRequest", "assignreq")
191 verify(mex, never()).setVariable("skipRollback", true)
196 public void preProcessRequest_NoAAI_NoAssign() {
197 ExecutionEntity mex = setupMock()
200 when(mex.getVariable("rollbackAAI")).thenReturn(false)
201 when(mex.getVariable("rollbackSDNC")).thenReturn(false)
203 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
204 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
206 verify(mex).setVariable("skipRollback", true)
211 public void preProcessRequest_NoRbStructure() {
212 ExecutionEntity mex = setupMock()
215 when(mex.getVariable("rollbackData")).thenReturn(new RollbackData())
217 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
218 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
220 verify(mex).setVariable("skipRollback", true)
225 public void preProcessRequest_NullRb() {
226 ExecutionEntity mex = setupMock()
229 when(mex.getVariable("rollbackData")).thenReturn(null)
231 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
232 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
234 verify(mex).setVariable("skipRollback", true)
239 public void preProcessRequest_BpmnError() {
240 ExecutionEntity mex = setupMock()
243 when(mex.getVariable("rollbackData")).thenThrow(new BpmnError("expected exception"))
245 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
247 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.preProcessRequest(mex) }))
252 public void preProcessRequest_Ex() {
253 ExecutionEntity mex = setupMock()
256 when(mex.getVariable("rollbackData")).thenThrow(new RuntimeException("expected exception"))
258 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
260 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.preProcessRequest(mex) }))
265 public void updateAaiAROrchStatus() {
266 ExecutionEntity mex = setupMock()
267 initUpdateAaiAROrchStatus(mex)
269 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
270 MockPatchAllottedResource(CUST, SVC, INST, ARID)
272 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
273 DoCreateAllottedResourceBRGRollback.updateAaiAROrchStatus(mex, "success")
278 public void updateAaiAROrchStatus_EmptyResponse() {
279 ExecutionEntity mex = setupMock()
280 initUpdateAaiAROrchStatus(mex)
283 .stubFor(get(urlMatching("/aai/v[0-9]+/.*"))
284 .willReturn(aResponse()
287 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
289 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.updateAaiAROrchStatus(mex, "success") }))
294 public void updateAaiAROrchStatus_NoArPath() {
295 ExecutionEntity mex = setupMock()
296 initUpdateAaiAROrchStatus(mex)
298 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
299 MockPatchAllottedResource(CUST, SVC, INST, ARID)
301 when(mex.getVariable("aaiARPath")).thenReturn(null)
303 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
305 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.updateAaiAROrchStatus(mex, "success") }))
309 // ***** validateSDNCResp *****
313 public void validateSDNCResp() {
314 ExecutionEntity mex = setupMock()
315 initValidateSDNCResp(mex)
316 def resp = initValidateSDNCResp_Resp()
318 when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true)
320 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
322 DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create")
324 verify(mex).getVariable("WorkflowException")
325 verify(mex).getVariable("SDNCA_SuccessIndicator")
330 public void validateSDNCResp_Unsuccessful() {
331 ExecutionEntity mex = setupMock()
332 initValidateSDNCResp(mex)
333 def resp = initValidateSDNCResp_Resp()
335 when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(false)
337 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
339 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create") }))
344 public void validateSDNCResp_BpmnError404() {
345 ExecutionEntity mex = setupMock()
346 initValidateSDNCResp(mex)
347 def resp = initValidateSDNCResp_Resp()
348 when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true)
350 when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("404", "expected exception"))
352 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
354 DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create")
359 public void validateSDNCResp_BpmnError() {
360 ExecutionEntity mex = setupMock()
361 initValidateSDNCResp(mex)
362 def resp = initValidateSDNCResp_Resp()
363 when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true)
365 when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("expected exception"))
367 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
369 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create") }))
374 public void validateSDNCResp_Ex() {
375 ExecutionEntity mex = setupMock()
376 initValidateSDNCResp(mex)
377 def resp = initValidateSDNCResp_Resp()
378 when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true)
380 when(mex.getVariable("WorkflowException")).thenThrow(new RuntimeException("expected exception"))
382 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
384 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create") }))
389 public void deleteAaiAR() {
390 ExecutionEntity mex = setupMock()
393 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
394 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
396 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
397 DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex)
402 public void deleteAaiAR_NoArPath() {
403 ExecutionEntity mex = setupMock()
406 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
407 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
409 when(mex.getVariable("aaiARPath")).thenReturn("")
411 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
413 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex) }))
418 public void deleteAaiAR_BpmnError() {
419 ExecutionEntity mex = setupMock()
422 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
423 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
425 when(mex.getVariable("aaiARPath")).thenThrow(new BpmnError("expected exception"))
427 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
429 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex) }))
434 public void deleteAaiAR_Ex() {
435 ExecutionEntity mex = setupMock()
438 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
439 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
441 when(mex.getVariable("aaiARPath")).thenThrow(new RuntimeException("expected exception"))
443 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
445 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex) }))
450 public void postProcessRequest() {
451 ExecutionEntity mex = setupMock()
452 initPostProcessRequest(mex)
454 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
455 DoCreateAllottedResourceBRGRollback.postProcessRequest(mex)
457 verify(mex).getVariable(DBGFLAG)
458 verify(mex).setVariable("rollbackData", null)
459 verify(mex).setVariable("rolledBack", true)
464 public void postProcessRequest_RolledBack() {
465 ExecutionEntity mex = setupMock()
466 initPostProcessRequest(mex)
468 when(mex.getVariable("skipRollback")).thenReturn(true)
470 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
471 DoCreateAllottedResourceBRGRollback.postProcessRequest(mex)
473 verify(mex).getVariable(DBGFLAG)
474 verify(mex).setVariable("rollbackData", null)
475 verify(mex, never()).setVariable("rolledBack", true)
480 public void postProcessRequest_BpmnError() {
481 ExecutionEntity mex = setupMock()
482 initPostProcessRequest(mex)
484 when(mex.getVariable("skipRollback")).thenThrow(new BpmnError("expected exception"))
486 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
487 DoCreateAllottedResourceBRGRollback.postProcessRequest(mex)
489 verify(mex).getVariable(DBGFLAG)
490 verify(mex).setVariable("rollbackData", null)
491 verify(mex, never()).setVariable("rolledBack", true)
496 public void postProcessRequest_Ex() {
497 ExecutionEntity mex = setupMock()
498 initPostProcessRequest(mex)
500 when(mex.getVariable("skipRollback")).thenThrow(new RuntimeException("expected exception"))
502 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
503 DoCreateAllottedResourceBRGRollback.postProcessRequest(mex)
505 verify(mex).getVariable(DBGFLAG)
506 verify(mex).setVariable("rollbackData", null)
507 verify(mex, never()).setVariable("rolledBack", true)
512 public void processRollbackException() {
513 ExecutionEntity mex = setupMock()
514 initProcessRollbackException(mex)
516 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
517 DoCreateAllottedResourceBRGRollback.processRollbackException(mex)
519 verify(mex).getVariable(DBGFLAG)
520 verify(mex).setVariable("rollbackData", null)
521 verify(mex).setVariable("rolledBack", false)
522 verify(mex).setVariable("rollbackError", "Caught exception in AllottedResource Create Rollback")
523 verify(mex).setVariable("WorkflowException", null)
528 public void processRollbackException_BpmnError() {
529 ExecutionEntity mex = setupMock()
530 initProcessRollbackException(mex)
532 doThrow(new BpmnError("expected exception")).when(mex).setVariable("rollbackData", null)
534 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
535 DoCreateAllottedResourceBRGRollback.processRollbackException(mex)
540 public void processRollbackException_Ex() {
541 ExecutionEntity mex = setupMock()
542 initProcessRollbackException(mex)
544 doThrow(new RuntimeException("expected exception")).when(mex).setVariable("rollbackData", null)
546 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
547 DoCreateAllottedResourceBRGRollback.processRollbackException(mex)
552 public void processRollbackJavaException() {
553 ExecutionEntity mex = setupMock()
554 initProcessRollbackException(mex)
556 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
557 DoCreateAllottedResourceBRGRollback.processRollbackJavaException(mex)
559 verify(mex).getVariable(DBGFLAG)
560 verify(mex).setVariable("rollbackData", null)
561 verify(mex).setVariable("rolledBack", false)
562 verify(mex).setVariable("rollbackError", "Caught Java exception in AllottedResource Create Rollback")
563 verify(mex, never()).setVariable("WorkflowException", null)
568 public void processRollbackJavaException_BpmnError() {
569 ExecutionEntity mex = setupMock()
570 initProcessRollbackException(mex)
572 doThrow(new BpmnError("expected exception")).when(mex).setVariable("rollbackData", null)
574 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
575 DoCreateAllottedResourceBRGRollback.processRollbackJavaException(mex)
580 public void processRollbackJavaException_Ex() {
581 ExecutionEntity mex = setupMock()
582 initProcessRollbackException(mex)
584 doThrow(new RuntimeException("expected exception")).when(mex).setVariable("rollbackData", null)
586 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
587 DoCreateAllottedResourceBRGRollback.processRollbackJavaException(mex)
590 private RollbackData initPreProcess(ExecutionEntity mex) {
591 def data = new RollbackData()
593 when(mex.getVariable(DBGFLAG)).thenReturn("true")
594 when(mex.getVariable("rollbackData")).thenReturn(data)
595 when(mex.getVariable("rollbackAAI")).thenReturn(true)
596 when(mex.getVariable("rollbackSDNC")).thenReturn(true)
597 when(mex.getVariable("disableRollback")).thenReturn("false")
599 data.put("SERVICEINSTANCE", "allottedResourceId", "myid")
601 data.put(RbType, "serviceInstanceId", "sii")
602 data.put(RbType, "parentServiceInstanceId", "psii")
604 data.put(RbType, "rollbackAAI", "true")
605 data.put(RbType, "aaiARPath", "mypath")
607 data.put(RbType, "rollbackSDNCassign", "true")
608 data.put(RbType, "rollbackSDNCactivate", "myactivate")
609 data.put(RbType, "rollbackSDNCcreate", "mycreate")
610 data.put(RbType, "sdncActivateRollbackReq", "activatereq")
611 data.put(RbType, "sdncCreateRollbackReq", "createreq")
612 data.put(RbType, "sdncAssignRollbackReq", "assignreq")
617 private initUpdateAaiAROrchStatus(ExecutionEntity mex) {
618 when(mex.getVariable(DBGFLAG)).thenReturn("true")
619 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)
620 when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx)
623 private initValidateSDNCResp(ExecutionEntity mex) {
624 when(mex.getVariable(DBGFLAG)).thenReturn("true")
625 when(mex.getVariable("prefix")).thenReturn(Prefix)
626 when(mex.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
629 private String initValidateSDNCResp_Resp() {
630 return "<response-data><response-code>200</response-code></response-data>"
633 private initDeleteAaiAR(ExecutionEntity mex) {
634 when(mex.getVariable(DBGFLAG)).thenReturn("true")
635 when(mex.getVariable("aaiARResourceVersion")).thenReturn(VERS)
636 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)
637 when(mex.getVariable("URN_aai_endpoint")).thenReturn(aaiUriPfx)
640 private initPostProcessRequest(ExecutionEntity mex) {
641 when(mex.getVariable(DBGFLAG)).thenReturn("true")
642 when(mex.getVariable("skipRollback")).thenReturn(false)
645 private initProcessRollbackException(ExecutionEntity mex) {
646 when(mex.getVariable(DBGFLAG)).thenReturn("true")
649 private initProcessRollbackJavaException(ExecutionEntity mex) {
650 when(mex.getVariable(DBGFLAG)).thenReturn("true")