610930665cf2b5ed07b5ac53aeaf477fc47a6cb6
[so.git] / bpmn / mso-infrastructure-bpmn / src / test / java / org / onap / so / bpmn / vcpe / CreateVcpeResCustServiceIT.java
1 /*
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.onap.so.bpmn.vcpe;
22
23 import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
24 import static com.github.tomakehurst.wiremock.client.WireMock.get;
25 import static com.github.tomakehurst.wiremock.client.WireMock.post;
26 import static com.github.tomakehurst.wiremock.client.WireMock.put;
27 import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
28 import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
29 import static org.junit.Assert.assertEquals;
30 import static org.junit.Assert.assertNotNull;
31 import static org.junit.Assert.assertTrue;
32 import static org.onap.so.bpmn.mock.StubResponseAAI.MockDeleteAllottedResource;
33 import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetAllottedResource;
34 import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetCustomer;
35 import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithDepth;
36 import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetGenericVnfByIdWithPriority;
37 import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetNetworkPolicyfqdn;
38 import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetServiceInstance;
39 import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetServiceInstance_500;
40 import static org.onap.so.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceById;
41 import static org.onap.so.bpmn.mock.StubResponseAAI.MockNodeQueryServiceInstanceByName_404;
42 import static org.onap.so.bpmn.mock.StubResponseAAI.MockPatchAllottedResource;
43 import static org.onap.so.bpmn.mock.StubResponseAAI.MockPatchGenericVnf;
44 import static org.onap.so.bpmn.mock.StubResponseAAI.MockPutAllottedResource;
45 import static org.onap.so.bpmn.mock.StubResponseAAI.MockPutGenericVnf;
46 import static org.onap.so.bpmn.mock.StubResponseAAI.MockPutNetwork;
47 import static org.onap.so.bpmn.mock.StubResponseAAI.MockPutServiceInstance;
48 import static org.onap.so.bpmn.mock.StubResponseAAI.MockPutVfModuleIdNoResponse;
49 import static org.onap.so.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData;
50 import static org.onap.so.bpmn.mock.StubResponseDatabase.MockPostRequestDB;
51 import static org.onap.so.bpmn.mock.StubResponseDatabase.mockUpdateRequestDB;
52 import static org.onap.so.bpmn.mock.StubResponseSDNCAdapter.mockSDNCAdapter;
53 import static org.onap.so.bpmn.mock.StubResponseVNFAdapter.mockVNFPost;
54
55 import java.io.IOException;
56 import java.util.HashMap;
57 import java.util.Map;
58 import java.util.UUID;
59
60 import org.junit.Before;
61 import org.junit.Test;
62 import org.onap.so.bpmn.common.BPMNUtil;
63 import org.onap.so.bpmn.mock.FileUtil;
64 import org.onap.so.bpmn.mock.StubResponseOof;
65
66
67 public class CreateVcpeResCustServiceIT extends AbstractTestBase {
68
69         private static final String PROCNAME = "CreateVcpeResCustService";
70         private static final String Prefix = "CVRCS_";
71         
72         private final CallbackSet callbacks = new CallbackSet();
73         private final String request;
74         
75         @Before
76         public void init(){
77                 BPMNUtil.cleanHistory(processEngine);
78         }
79         
80         public CreateVcpeResCustServiceIT() throws IOException {
81
82         callbacks.put("oof", JSON, "oofResponse", FileUtil.readResourceFile("__files/VCPE/CreateVcpeResCustService/oofCallbackInfraVnf.json"));
83                 callbacks.put("assign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyAssignCallback.xml"));
84                 callbacks.put("create", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyCreateCallback.xml"));
85                 callbacks.put("activate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyActivateCallback.xml"));
86                 callbacks.put("queryTXC", FileUtil.readResourceFile("__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml"));
87                 callbacks.put("queryBRG", FileUtil.readResourceFile("__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryBRGCallback.xml"));
88                 callbacks.put("deactivate", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeactivateCallback.xml"));
89                 callbacks.put("delete", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyDeleteCallback.xml"));
90                 callbacks.put("unassign", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyUnassignCallback.xml"));
91
92                 callbacks.put("query", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyQueryCallback.xml"));
93                 callbacks.put("queryVnf", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyQueryCallbackVnf.xml"));
94                 callbacks.put("queryModuleNoVnf", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyQueryCallbackVfModuleNoVnf.xml"));
95                 callbacks.put("queryModule", FileUtil.readResourceFile("__files/VfModularity/SDNCTopologyQueryCallbackVfModule.xml"));
96                 callbacks.put("vnfCreate", FileUtil.readResourceFile("__files/VfModularity/VNFAdapterRestCreateCallback.xml"));
97
98                 request = FileUtil.readResourceFile("__files/VCPE/CreateVcpeResCustService/requestNoSIName.json");
99         }
100         
101         @Test
102         public void testCreateVcpeResCustService_Success() throws Exception {
103                 System.out.println("starting:  testCreateVcpeResCustService_Success\n");
104                 MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2","VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
105                 MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
106                 MockGetCustomer(CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml");
107                 StubResponseOof.mockOof();
108                 // TODO: the SI should NOT have to be URL-encoded yet again!
109                 MockPutServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
110                 MockGetServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
111                 
112                 MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");
113                 MockNodeQueryServiceInstanceById(PARENT_INST, "GenericFlows/getParentSIUrlById.xml");           
114                 MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
115                 MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
116                 MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
117                 MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
118         MockGetGenericVnfByIdWithDepth(".*", 1, "VCPE/CreateVcpeResCustService/GenericVnf.xml");
119
120                 MockPutGenericVnf(".*");
121         MockPatchGenericVnf(".*");
122
123         MockGetGenericVnfByIdWithPriority(".*", ".*", 200, "VfModularity/VfModule-new.xml", 5);
124         // MockGetGenericVnfByIdWithDepth("skask", 1, "VfModularity/GenericVnf.xml");
125         MockPutVfModuleIdNoResponse(".*", "PCRF", ".*");
126         MockPutNetwork(".*", "VfModularity/AddNetworkPolicy_AAIResponse_Success.xml", 200);
127
128                 MockGetNetworkPolicyfqdn(".*","CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml",200);
129                 MockNodeQueryServiceInstanceByName_404(".*");
130
131                 mockVNFPost("", 202, ".*");
132
133         stubFor(post(urlMatching("/services/rest/v1/vnfs" + ".*" + "/vf-modules" )).willReturn(aResponse().withStatus(202)));
134                 stubFor(get(urlMatching(".*/business/owning-entities?.*")).willReturn(aResponse().withStatus(404)));
135                 stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/.*")).willReturn(aResponse().withStatus(200)));
136                 stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/038d99af-0427-42c2-9d15-971b99b9b489/relationship-list/relationship")).willReturn(aResponse().withStatus(200)));
137                 stubFor(put(urlMatching(".*/query?.*")).willReturn(aResponse().withStatus(200)));
138                 MockPostRequestDB();    
139                 mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
140                 mockSDNCAdapter(200);
141                 
142                 Map<String, Object> variables = setupVariables();
143
144                 String businessKey = UUID.randomUUID().toString();
145                 invokeAsyncProcess(PROCNAME, "v1", businessKey, request, variables);
146
147         injectWorkflowMessages(callbacks, "oof");
148                 // for SI
149                 injectSDNCCallbacks(callbacks, "assign");
150                 // for TXC
151                 injectSDNCCallbacks(callbacks, "assign");
152                 injectSDNCCallbacks(callbacks, "create");
153                 injectSDNCCallbacks(callbacks, "activate");
154                 injectSDNCCallbacks(callbacks, "queryTXC");
155
156         // For VNF
157         injectSDNCCallbacks(callbacks, "assign");
158         injectSDNCCallbacks(callbacks, "assign");
159         injectSDNCCallbacks(callbacks, "queryModule");
160         injectSDNCCallbacks(callbacks, "activate");
161         //VF Module
162         injectSDNCCallbacks(callbacks, "queryModule");
163         injectSDNCCallbacks(callbacks, "assign");
164         injectSDNCCallbacks(callbacks, "queryModule");
165         injectSDNCCallbacks(callbacks, "queryModule");
166                 injectSDNCCallbacks(callbacks, "assign");
167                 injectSDNCCallbacks(callbacks, "queryModuleNoVnf");
168         injectVNFRestCallbacks(callbacks, "vnfCreate");
169         injectSDNCCallbacks(callbacks, "activate");
170
171         // for BRG
172         injectSDNCCallbacks(callbacks, "assign");
173         injectSDNCCallbacks(callbacks, "create");
174         injectSDNCCallbacks(callbacks, "activate");
175         injectSDNCCallbacks(callbacks, "queryBRG");
176
177                 waitForProcessEnd(businessKey, 10000);
178
179                 String workflowException = BPMNUtil.getVariable(processEngine, PROCNAME, VAR_WFEX);
180                 System.out.println("workflowException:\n" + workflowException);
181
182                 String completionReq = BPMNUtil.getVariable(processEngine, PROCNAME, Prefix+VAR_COMP_REQ);
183                 System.out.println("completionReq:\n" + completionReq);
184                 
185                 assertEquals("true", BPMNUtil.getVariable(processEngine, PROCNAME, PROCNAME+VAR_SUCCESS_IND));
186                 assertEquals("200", BPMNUtil.getVariable(processEngine, PROCNAME, VAR_RESP_CODE));
187                 assertEquals(null, workflowException);
188                 assertTrue(completionReq.indexOf("request-id>testRequestId<") >= 0);
189                 assertTrue(completionReq.indexOf("action>CREATE<") >= 0);
190                 assertTrue(completionReq.indexOf("source>VID<") >= 0);
191
192                 assertEquals("1", BPMNUtil.getVariable(processEngine, PROCNAME, Prefix+"VnfsCreatedCount"));
193         }
194
195         @Test
196         public void testCreateVcpeResCustService_NoParts() throws Exception {
197                 System.out.println("starting: testCreateVcpeResCustService_NoParts\n"  );
198                 MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesNoData.json");
199                 MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesNoData.json");
200                 MockGetCustomer(CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml");
201                 
202                 // TODO: the SI should NOT have to be URL-encoded yet again!
203                 MockPutServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
204                 MockGetServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
205                 
206                 MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");                
207                 MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
208                 MockNodeQueryServiceInstanceById(PARENT_INST, "GenericFlows/getParentSIUrlById.xml");
209                 MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
210                 
211                 // TODO: should these really be PARENT_INST, or should they be INST?
212                 MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
213                 MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
214
215                 mockSDNCAdapter(200);
216                 mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
217
218         StubResponseOof.mockOof();
219         stubFor(get(urlMatching(".*/business/owning-entities?.*")).willReturn(aResponse().withStatus(404)));
220         stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/.*")).willReturn(aResponse().withStatus(200)));
221         stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/038d99af-0427-42c2-9d15-971b99b9b489/relationship-list/relationship")).willReturn(aResponse().withStatus(200)));
222         stubFor(put(urlMatching(".*/query?.*")).willReturn(aResponse().withStatus(200)));
223         MockPostRequestDB();
224         mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
225                 
226                 Map<String, Object> variables = setupVariables();
227
228                 String businessKey = UUID.randomUUID().toString();
229                 invokeAsyncProcess(PROCNAME, "v1", businessKey, request, variables);
230
231         injectWorkflowMessages(callbacks, "oof");
232                 // for SI
233                 injectSDNCCallbacks(callbacks, "assign");
234                 
235                 waitForProcessEnd(businessKey, 10000);
236
237                 String workflowException = BPMNUtil.getVariable(processEngine, PROCNAME, VAR_WFEX);
238                 System.out.println("workflowException:\n" + workflowException);
239
240                 String completionReq = BPMNUtil.getVariable(processEngine, PROCNAME, Prefix+VAR_COMP_REQ);
241                 System.out.println("completionReq:\n" + completionReq);
242                 
243                 assertEquals("true", BPMNUtil.getVariable(processEngine, PROCNAME, PROCNAME+VAR_SUCCESS_IND));
244                 assertEquals("200", BPMNUtil.getVariable(processEngine, PROCNAME, VAR_RESP_CODE));
245                 assertEquals(null, workflowException);
246                 assertTrue(completionReq.indexOf("request-id>testRequestId<") >= 0);
247                 assertTrue(completionReq.indexOf("action>CREATE<") >= 0);
248                 assertTrue(completionReq.indexOf("source>VID<") >= 0);
249
250                 assertEquals("0", BPMNUtil.getVariable(processEngine, PROCNAME, Prefix+"VnfsCreatedCount"));
251         }
252         
253         @Test
254         public void testCreateVcpeResCustService_Fault_NoRollback() throws Exception {
255                 System.out.println("starting:  testCreateVcpeResCustService_Fault_NoRollback\n");
256                 MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
257                 MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
258                 MockGetCustomer(CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml");
259                 
260                 // TODO: the SI should NOT have to be URL-encoded yet again!
261                 MockPutServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
262                 MockGetServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
263                 
264                 MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");
265                 MockNodeQueryServiceInstanceById(PARENT_INST, "GenericFlows/getParentSIUrlById.xml");           
266                 MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
267                 MockGetServiceInstance_500(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
268                 MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
269                 MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
270
271                 mockSDNCAdapter(404);
272                 mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
273
274         StubResponseOof.mockOof();
275         stubFor(get(urlMatching(".*/business/owning-entities?.*")).willReturn(aResponse().withStatus(404)));
276         stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/.*")).willReturn(aResponse().withStatus(200)));
277         stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/038d99af-0427-42c2-9d15-971b99b9b489/relationship-list/relationship")).willReturn(aResponse().withStatus(200)));
278         stubFor(put(urlMatching(".*/query?.*")).willReturn(aResponse().withStatus(200)));
279         MockPostRequestDB();
280                 
281                 Map<String, Object> variables = setupVariables();
282
283                 String businessKey = UUID.randomUUID().toString();
284                 invokeAsyncProcess(PROCNAME, "v1", businessKey, request, variables);
285
286         injectWorkflowMessages(callbacks, "oof");
287                 
288                 waitForProcessEnd(businessKey, 100000);
289
290                 String workflowException = BPMNUtil.getVariable(processEngine, PROCNAME, VAR_WFEX);
291                 System.out.println("workflowException:\n" + workflowException);
292
293                 String completionReq = BPMNUtil.getVariable(processEngine, PROCNAME, Prefix+VAR_COMP_REQ);
294                 System.out.println("completionReq:\n" + completionReq);
295                 
296                 assertEquals(null, BPMNUtil.getVariable(processEngine, PROCNAME, PROCNAME+VAR_SUCCESS_IND));
297                 assertEquals(null, BPMNUtil.getVariable(processEngine, PROCNAME, VAR_RESP_CODE));
298                 assertNotNull(workflowException);
299                 
300                 BPMNUtil.assertNoProcessInstance(processEngine, "DoCreateAllottedResourceBRGRollback");
301                 BPMNUtil.assertNoProcessInstance(processEngine, "DoCreateVnfAndModulesRollback");
302                 BPMNUtil.assertNoProcessInstance(processEngine, "DoCreateAllottedResourceTXCRollback");
303         }
304         
305         @Test
306         public void testCreateVcpeResCustService_Fault_Rollback() throws Exception {
307                 System.out.println("starting:  testCreateVcpeResCustService_Fault_Rollback\n");
308                 MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "2", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
309                 MockGetServiceResourcesCatalogData("uuid-miu-svc-011-abcdef", "VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json");
310                 MockGetCustomer(CUST, "VCPE/CreateVcpeResCustService/getCustomer.xml");
311                 
312                 // TODO: the SI should NOT have to be URL-encoded yet again!
313                 MockPutServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
314                 MockGetServiceInstance(CUST, SVC, INST.replace("%", "%25"), "GenericFlows/getServiceInstance.xml");
315                 
316                 MockNodeQueryServiceInstanceById(INST, "GenericFlows/getSIUrlById.xml");
317                 MockNodeQueryServiceInstanceById(PARENT_INST, "GenericFlows/getParentSIUrlById.xml");           
318                 MockGetServiceInstance(CUST, SVC, INST, "GenericFlows/getServiceInstance.xml");
319                 MockGetServiceInstance(CUST, SVC, PARENT_INST, "GenericFlows/getParentServiceInstance.xml");
320                 MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/CreateVcpeResCustService/arGetById.xml");
321                 MockGetAllottedResource(CUST, SVC, PARENT_INST, ARID, "VCPE/CreateVcpeResCustService/arGetById.xml");
322                 MockPutAllottedResource(CUST, SVC, PARENT_INST, ARID);
323                 MockPatchAllottedResource(CUST, SVC, PARENT_INST, ARID);
324                 MockDeleteAllottedResource(CUST, SVC, PARENT_INST, ARID, ARVERS);
325
326                 mockSDNCAdapter(200);
327                 mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
328
329                 StubResponseOof.mockOof();
330                 stubFor(get(urlMatching(".*/business/owning-entities?.*")).willReturn(aResponse().withStatus(404)));
331                 stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/.*")).willReturn(aResponse().withStatus(200)));
332                 stubFor(put(urlMatching(".*/business/owning-entities/owning-entity/038d99af-0427-42c2-9d15-971b99b9b489/relationship-list/relationship")).willReturn(aResponse().withStatus(200)));
333                 stubFor(put(urlMatching(".*/query?.*")).willReturn(aResponse().withStatus(200)));
334                 MockPostRequestDB();
335                 String req = FileUtil.readResourceFile("__files/VCPE/CreateVcpeResCustService/requestRollback.json");
336
337                 Map<String, Object> variables = setupVariables();
338
339                 String businessKey = UUID.randomUUID().toString();
340                 invokeAsyncProcess(PROCNAME, "v1", businessKey, req, variables);
341
342                 injectWorkflowMessages(callbacks, "oof");
343                 // for SI
344                 injectSDNCCallbacks(callbacks, "assign");
345                 
346                 // for TXC
347                 injectSDNCCallbacks(callbacks, "assign");
348                 injectSDNCCallbacks(callbacks, "create");
349                 
350                 waitForProcessEnd(businessKey, 10000);
351
352                 String workflowException = BPMNUtil.getVariable(processEngine, PROCNAME, VAR_WFEX);
353                 System.out.println("workflowException:\n" + workflowException);
354
355                 String completionReq = BPMNUtil.getVariable(processEngine, PROCNAME, Prefix+VAR_COMP_REQ);
356                 System.out.println("completionReq:\n" + completionReq);
357                 
358                 assertEquals(null, BPMNUtil.getVariable(processEngine, PROCNAME, PROCNAME+VAR_SUCCESS_IND));
359                 assertEquals(null, BPMNUtil.getVariable(processEngine, PROCNAME, VAR_RESP_CODE));
360                 assertEquals(null, completionReq);
361                 assertNotNull(workflowException);
362                 
363                 BPMNUtil.assertAnyProcessInstanceFinished(processEngine, "DoCreateServiceInstanceRollback");
364         }
365         
366         // *****************
367         // Utility Section
368         // *****************
369
370         // Success Scenario
371         private Map<String, Object> setupVariables() {
372                 Map<String, Object> variables = new HashMap<>();
373                 variables.put("requestId", "testRequestId");
374                 variables.put("request-id", "testRequestId");
375                 variables.put("serviceInstanceId", DEC_INST);
376                 variables.put("allottedResourceId", ARID);
377                 variables.put("URN_mso_workflow_aai_distribution_delay", "PT5S");
378                 return variables;
379
380         }
381 }