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.WorkflowException
37 import org.onap.so.bpmn.mock.FileUtil
39 import static com.github.tomakehurst.wiremock.client.WireMock.aResponse
40 import static com.github.tomakehurst.wiremock.client.WireMock.get
41 import static com.github.tomakehurst.wiremock.client.WireMock.stubFor
42 import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching
43 import static org.junit.Assert.*;
44 import static org.mockito.Mockito.*
45 import static org.onap.so.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource
46 import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetAllottedResource
47 import static org.onap.so.bpmn.mock.StubResponseAAI.MockPatchAllottedResource
49 import org.onap.so.bpmn.core.RollbackData
51 import com.github.tomakehurst.wiremock.junit.WireMockRule
53 class DoCreateAllottedResourceBRGRollbackTest extends GroovyTestBase {
56 public WireMockRule wireMockRule = new WireMockRule(PORT)
58 String Prefix = "DCARBRGRB_"
59 String RbType = "DCARBRG_"
62 public static void setUpBeforeClass() {
63 super.setUpBeforeClass()
69 MockitoAnnotations.initMocks(this)
72 public DoCreateAllottedResourceBRGRollbackTest() {
73 super("DoCreateAllottedResourceBRGRollback")
77 // ***** preProcessRequest *****
81 public void preProcessRequest() {
82 ExecutionEntity mex = setupMock()
85 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
86 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
88 ////verify(mex).getVariable(DBGFLAG)
89 verify(mex).setVariable("prefix", Prefix)
90 verify(mex).setVariable("serviceInstanceId", "sii")
91 verify(mex).setVariable("parentServiceInstanceId", "psii")
92 verify(mex).setVariable("allottedResourceId", "myid")
93 verify(mex).setVariable("rollbackAAI", true)
94 verify(mex).setVariable("aaiARPath", "mypath")
95 verify(mex).setVariable("rollbackSDNC", true)
96 verify(mex).setVariable("deactivateSdnc", "myactivate")
97 verify(mex).setVariable("deleteSdnc", "mycreate")
98 verify(mex).setVariable("unassignSdnc", "true")
99 verify(mex).setVariable("sdncDeactivateRequest", "activatereq")
100 verify(mex).setVariable("sdncDeleteRequest", "createreq")
101 verify(mex).setVariable("sdncUnassignRequest", "assignreq")
103 verify(mex, never()).setVariable("skipRollback", true)
108 public void preProcessRequest_RollbackDisabled() {
109 ExecutionEntity mex = setupMock()
112 when(mex.getVariable("disableRollback")).thenReturn("true")
114 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
115 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
117 ////verify(mex).getVariable(DBGFLAG)
118 verify(mex).setVariable("prefix", Prefix)
119 verify(mex).setVariable("serviceInstanceId", "sii")
120 verify(mex).setVariable("parentServiceInstanceId", "psii")
121 verify(mex).setVariable("allottedResourceId", "myid")
122 verify(mex).setVariable("rollbackAAI", true)
123 verify(mex).setVariable("aaiARPath", "mypath")
124 verify(mex).setVariable("rollbackSDNC", true)
125 verify(mex).setVariable("deactivateSdnc", "myactivate")
126 verify(mex).setVariable("deleteSdnc", "mycreate")
127 verify(mex).setVariable("unassignSdnc", "true")
128 verify(mex).setVariable("sdncDeactivateRequest", "activatereq")
129 verify(mex).setVariable("sdncDeleteRequest", "createreq")
130 verify(mex).setVariable("sdncUnassignRequest", "assignreq")
132 verify(mex).setVariable("skipRollback", true)
137 public void preProcessRequest_NoAAI() {
138 ExecutionEntity mex = setupMock()
139 def data = initPreProcess(mex)
141 when(mex.getVariable("rollbackAAI")).thenReturn(false)
142 data.put(RbType, "rollbackAAI", "false")
144 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
145 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
147 //verify(mex).getVariable(DBGFLAG)
148 verify(mex).setVariable("prefix", Prefix)
149 verify(mex).setVariable("serviceInstanceId", "sii")
150 verify(mex).setVariable("parentServiceInstanceId", "psii")
151 verify(mex).setVariable("allottedResourceId", "myid")
152 verify(mex, never()).setVariable("rollbackAAI", true)
153 verify(mex, never()).setVariable("aaiARPath", "mypath")
154 verify(mex).setVariable("rollbackSDNC", true)
155 verify(mex).setVariable("deactivateSdnc", "myactivate")
156 verify(mex).setVariable("deleteSdnc", "mycreate")
157 verify(mex).setVariable("unassignSdnc", "true")
158 verify(mex).setVariable("sdncDeactivateRequest", "activatereq")
159 verify(mex).setVariable("sdncDeleteRequest", "createreq")
160 verify(mex).setVariable("sdncUnassignRequest", "assignreq")
162 verify(mex, never()).setVariable("skipRollback", true)
167 public void preProcessRequest_NoAssign() {
168 ExecutionEntity mex = setupMock()
169 def data = initPreProcess(mex)
171 when(mex.getVariable("rollbackSDNC")).thenReturn(false)
172 data.put(RbType, "rollbackSDNCassign", "false")
174 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
175 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
177 //verify(mex).getVariable(DBGFLAG)
178 verify(mex).setVariable("prefix", Prefix)
179 verify(mex).setVariable("serviceInstanceId", "sii")
180 verify(mex).setVariable("parentServiceInstanceId", "psii")
181 verify(mex).setVariable("allottedResourceId", "myid")
182 verify(mex).setVariable("rollbackAAI", true)
183 verify(mex).setVariable("aaiARPath", "mypath")
184 verify(mex, never()).setVariable("rollbackSDNC", true)
185 verify(mex, never()).setVariable("deactivateSdnc", "myactivate")
186 verify(mex, never()).setVariable("deleteSdnc", "mycreate")
187 verify(mex, never()).setVariable("unassignSdnc", "true")
188 verify(mex, never()).setVariable("sdncDeactivateRequest", "activatereq")
189 verify(mex, never()).setVariable("sdncDeleteRequest", "createreq")
190 verify(mex, never()).setVariable("sdncUnassignRequest", "assignreq")
192 verify(mex, never()).setVariable("skipRollback", true)
197 public void preProcessRequest_NoAAI_NoAssign() {
198 ExecutionEntity mex = setupMock()
201 when(mex.getVariable("rollbackAAI")).thenReturn(false)
202 when(mex.getVariable("rollbackSDNC")).thenReturn(false)
204 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
205 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
207 verify(mex).setVariable("skipRollback", true)
212 public void preProcessRequest_NoRbStructure() {
213 ExecutionEntity mex = setupMock()
216 when(mex.getVariable("rollbackData")).thenReturn(new RollbackData())
218 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
219 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
221 verify(mex).setVariable("skipRollback", true)
226 public void preProcessRequest_NullRb() {
227 ExecutionEntity mex = setupMock()
230 when(mex.getVariable("rollbackData")).thenReturn(null)
232 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
233 DoCreateAllottedResourceBRGRollback.preProcessRequest(mex)
235 verify(mex).setVariable("skipRollback", true)
240 public void preProcessRequest_BpmnError() {
241 ExecutionEntity mex = setupMock()
244 when(mex.getVariable("rollbackData")).thenThrow(new BpmnError("expected exception"))
246 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
248 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.preProcessRequest(mex) }))
253 public void preProcessRequest_Ex() {
254 ExecutionEntity mex = setupMock()
257 when(mex.getVariable("rollbackData")).thenThrow(new RuntimeException("expected exception"))
259 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
261 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.preProcessRequest(mex) }))
266 public void updateAaiAROrchStatus() {
267 ExecutionEntity mex = setupMock()
268 initUpdateAaiAROrchStatus(mex)
270 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
271 MockPatchAllottedResource(CUST, SVC, INST, ARID)
273 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
274 DoCreateAllottedResourceBRGRollback.updateAaiAROrchStatus(mex, "success")
279 public void updateAaiAROrchStatus_EmptyResponse() {
280 ExecutionEntity mex = setupMock()
281 initUpdateAaiAROrchStatus(mex)
284 .stubFor(get(urlMatching("/aai/v[0-9]+/.*"))
285 .willReturn(aResponse()
288 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
290 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.updateAaiAROrchStatus(mex, "success") }))
295 public void updateAaiAROrchStatus_NoArPath() {
296 ExecutionEntity mex = setupMock()
297 initUpdateAaiAROrchStatus(mex)
299 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
300 MockPatchAllottedResource(CUST, SVC, INST, ARID)
302 when(mex.getVariable("aaiARPath")).thenReturn(null)
304 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
306 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.updateAaiAROrchStatus(mex, "success") }))
310 // ***** validateSDNCResp *****
314 public void validateSDNCResp() {
315 ExecutionEntity mex = setupMock()
316 initValidateSDNCResp(mex)
317 def resp = initValidateSDNCResp_Resp()
319 when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true)
321 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
323 DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create")
325 verify(mex).getVariable("WorkflowException")
326 verify(mex).getVariable("SDNCA_SuccessIndicator")
331 public void validateSDNCResp_Unsuccessful() {
332 ExecutionEntity mex = setupMock()
333 initValidateSDNCResp(mex)
334 def resp = initValidateSDNCResp_Resp()
336 when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(false)
338 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
340 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create") }))
345 public void validateSDNCResp_BpmnError404() {
346 ExecutionEntity mex = setupMock()
347 initValidateSDNCResp(mex)
348 def resp = initValidateSDNCResp_Resp()
349 when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true)
351 when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("404", "expected exception"))
353 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
355 DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create")
360 public void validateSDNCResp_BpmnError() {
361 ExecutionEntity mex = setupMock()
362 initValidateSDNCResp(mex)
363 def resp = initValidateSDNCResp_Resp()
364 when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true)
366 when(mex.getVariable("WorkflowException")).thenThrow(new BpmnError("expected exception"))
368 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
370 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create") }))
375 public void validateSDNCResp_Ex() {
376 ExecutionEntity mex = setupMock()
377 initValidateSDNCResp(mex)
378 def resp = initValidateSDNCResp_Resp()
379 when(mex.getVariable(Prefix+"sdncResponseSuccess")).thenReturn(true)
381 when(mex.getVariable("WorkflowException")).thenThrow(new RuntimeException("expected exception"))
383 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
385 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.validateSDNCResp(mex, resp, "create") }))
390 public void deleteAaiAR() {
391 ExecutionEntity mex = setupMock()
394 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
395 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
397 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
398 DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex)
403 public void deleteAaiAR_NoArPath() {
404 ExecutionEntity mex = setupMock()
407 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
408 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
410 when(mex.getVariable("aaiARPath")).thenReturn("")
412 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
414 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex) }))
419 public void deleteAaiAR_BpmnError() {
420 ExecutionEntity mex = setupMock()
423 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
424 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
426 when(mex.getVariable("aaiARPath")).thenThrow(new BpmnError("expected exception"))
428 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
430 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex) }))
435 public void deleteAaiAR_Ex() {
436 ExecutionEntity mex = setupMock()
439 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml")
440 MockDeleteAllottedResource(CUST, SVC, INST, ARID, VERS)
442 when(mex.getVariable("aaiARPath")).thenThrow(new RuntimeException("expected exception"))
444 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
446 assertTrue(doBpmnError( { _ -> DoCreateAllottedResourceBRGRollback.deleteAaiAR(mex) }))
451 public void postProcessRequest() {
452 ExecutionEntity mex = setupMock()
453 initPostProcessRequest(mex)
455 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
456 DoCreateAllottedResourceBRGRollback.postProcessRequest(mex)
458 //verify(mex).getVariable(DBGFLAG)
459 verify(mex).setVariable("rollbackData", null)
460 verify(mex).setVariable("rolledBack", true)
465 public void postProcessRequest_RolledBack() {
466 ExecutionEntity mex = setupMock()
467 initPostProcessRequest(mex)
469 when(mex.getVariable("skipRollback")).thenReturn(true)
471 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
472 DoCreateAllottedResourceBRGRollback.postProcessRequest(mex)
474 //verify(mex).getVariable(DBGFLAG)
475 verify(mex).setVariable("rollbackData", null)
476 verify(mex, never()).setVariable("rolledBack", true)
481 public void postProcessRequest_BpmnError() {
482 ExecutionEntity mex = setupMock()
483 initPostProcessRequest(mex)
485 when(mex.getVariable("skipRollback")).thenThrow(new BpmnError("expected exception"))
487 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
488 DoCreateAllottedResourceBRGRollback.postProcessRequest(mex)
490 //verify(mex).getVariable(DBGFLAG)
491 verify(mex).setVariable("rollbackData", null)
492 verify(mex, never()).setVariable("rolledBack", true)
497 public void postProcessRequest_Ex() {
498 ExecutionEntity mex = setupMock()
499 initPostProcessRequest(mex)
501 when(mex.getVariable("skipRollback")).thenThrow(new RuntimeException("expected exception"))
503 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
504 DoCreateAllottedResourceBRGRollback.postProcessRequest(mex)
506 //verify(mex).getVariable(DBGFLAG)
507 verify(mex).setVariable("rollbackData", null)
508 verify(mex, never()).setVariable("rolledBack", true)
513 public void processRollbackException() {
514 ExecutionEntity mex = setupMock()
515 initProcessRollbackException(mex)
517 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
518 DoCreateAllottedResourceBRGRollback.processRollbackException(mex)
520 //verify(mex).getVariable(DBGFLAG)
521 verify(mex).setVariable("rollbackData", null)
522 verify(mex).setVariable("rolledBack", false)
523 verify(mex).setVariable("rollbackError", "Caught exception in AllottedResource Create Rollback")
524 verify(mex).setVariable("WorkflowException", null)
529 public void processRollbackException_BpmnError() {
530 ExecutionEntity mex = setupMock()
531 initProcessRollbackException(mex)
533 doThrow(new BpmnError("expected exception")).when(mex).setVariable("rollbackData", null)
535 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
536 DoCreateAllottedResourceBRGRollback.processRollbackException(mex)
541 public void processRollbackException_Ex() {
542 ExecutionEntity mex = setupMock()
543 initProcessRollbackException(mex)
545 doThrow(new RuntimeException("expected exception")).when(mex).setVariable("rollbackData", null)
547 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
548 DoCreateAllottedResourceBRGRollback.processRollbackException(mex)
553 public void processRollbackJavaException() {
554 ExecutionEntity mex = setupMock()
555 initProcessRollbackException(mex)
557 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
558 DoCreateAllottedResourceBRGRollback.processRollbackJavaException(mex)
560 //verify(mex).getVariable(DBGFLAG)
561 verify(mex).setVariable("rollbackData", null)
562 verify(mex).setVariable("rolledBack", false)
563 verify(mex).setVariable("rollbackError", "Caught Java exception in AllottedResource Create Rollback")
564 verify(mex, never()).setVariable("WorkflowException", null)
569 public void processRollbackJavaException_BpmnError() {
570 ExecutionEntity mex = setupMock()
571 initProcessRollbackException(mex)
573 doThrow(new BpmnError("expected exception")).when(mex).setVariable("rollbackData", null)
575 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
576 DoCreateAllottedResourceBRGRollback.processRollbackJavaException(mex)
581 public void processRollbackJavaException_Ex() {
582 ExecutionEntity mex = setupMock()
583 initProcessRollbackException(mex)
585 doThrow(new RuntimeException("expected exception")).when(mex).setVariable("rollbackData", null)
587 DoCreateAllottedResourceBRGRollback DoCreateAllottedResourceBRGRollback = new DoCreateAllottedResourceBRGRollback()
588 DoCreateAllottedResourceBRGRollback.processRollbackJavaException(mex)
591 private RollbackData initPreProcess(ExecutionEntity mex) {
592 def data = new RollbackData()
594 when(mex.getVariable(DBGFLAG)).thenReturn("true")
595 when(mex.getVariable("rollbackData")).thenReturn(data)
596 when(mex.getVariable("rollbackAAI")).thenReturn(true)
597 when(mex.getVariable("rollbackSDNC")).thenReturn(true)
598 when(mex.getVariable("disableRollback")).thenReturn("false")
600 data.put("SERVICEINSTANCE", "allottedResourceId", "myid")
602 data.put(RbType, "serviceInstanceId", "sii")
603 data.put(RbType, "parentServiceInstanceId", "psii")
605 data.put(RbType, "rollbackAAI", "true")
606 data.put(RbType, "aaiARPath", "mypath")
608 data.put(RbType, "rollbackSDNCassign", "true")
609 data.put(RbType, "rollbackSDNCactivate", "myactivate")
610 data.put(RbType, "rollbackSDNCcreate", "mycreate")
611 data.put(RbType, "sdncActivateRollbackReq", "activatereq")
612 data.put(RbType, "sdncCreateRollbackReq", "createreq")
613 data.put(RbType, "sdncAssignRollbackReq", "assignreq")
618 private initUpdateAaiAROrchStatus(ExecutionEntity mex) {
619 when(mex.getVariable(DBGFLAG)).thenReturn("true")
620 when(mex.getVariable("aaiARPath")).thenReturn("/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID)
621 when(mex.getVariable("aai.endpoint")).thenReturn(aaiUriPfx)
624 private initValidateSDNCResp(ExecutionEntity mex) {
625 when(mex.getVariable(DBGFLAG)).thenReturn("true")
626 when(mex.getVariable("prefix")).thenReturn(Prefix)
627 when(mex.getVariable("SDNCA_SuccessIndicator")).thenReturn(true)
630 private String initValidateSDNCResp_Resp() {
631 return "<response-data><response-code>200</response-code></response-data>"
634 private initDeleteAaiAR(ExecutionEntity mex) {
635 when(mex.getVariable(DBGFLAG)).thenReturn("true")
636 when(mex.getVariable("aaiARResourceVersion")).thenReturn(VERS)
637 when(mex.getVariable("aaiARPath")).thenReturn("/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID)
638 when(mex.getVariable("aai.endpoint")).thenReturn(aaiUriPfx)
641 private initPostProcessRequest(ExecutionEntity mex) {
642 when(mex.getVariable(DBGFLAG)).thenReturn("true")
643 when(mex.getVariable("skipRollback")).thenReturn(false)
646 private initProcessRollbackException(ExecutionEntity mex) {
647 when(mex.getVariable(DBGFLAG)).thenReturn("true")
650 private initProcessRollbackJavaException(ExecutionEntity mex) {
651 when(mex.getVariable(DBGFLAG)).thenReturn("true")