b370e6c48f38d175101e4471f1d61ea1bbb3a94f
[so.git] / bpmn / mso-infrastructure-bpmn / src / test / java / org / onap / so / bpmn / common / OofHomingTestIT.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Modifications Copyright (c) 2019 Samsung
8  * ================================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * ============LICENSE_END=========================================================
21  */
22
23 package org.onap.so.bpmn.common;
24
25
26 import org.junit.Ignore;
27 import org.junit.Test;
28 import org.onap.so.BaseIntegrationTest;
29 import org.onap.so.bpmn.core.WorkflowException;
30 import org.onap.so.bpmn.core.domain.AllottedResource;
31 import org.onap.so.bpmn.core.domain.HomingSolution;
32 import org.onap.so.bpmn.core.domain.ModelInfo;
33 import org.onap.so.bpmn.core.domain.NetworkResource;
34 import org.onap.so.bpmn.core.domain.Resource;
35 import org.onap.so.bpmn.core.domain.ServiceDecomposition;
36 import org.onap.so.bpmn.core.domain.ServiceInstance;
37 import org.onap.so.bpmn.core.domain.VnfResource;
38 import org.onap.so.bpmn.mock.FileUtil;
39 import org.slf4j.Logger;
40 import org.slf4j.LoggerFactory;
41
42 import java.io.IOException;
43 import java.util.ArrayList;
44 import java.util.HashMap;
45 import java.util.List;
46 import java.util.Map;
47 import java.util.UUID;
48
49 import static org.junit.Assert.assertEquals;
50 import static org.junit.Assert.assertNull;
51 import static org.onap.so.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogDataByModelUuid;
52 import static org.onap.so.bpmn.mock.StubResponseOof.mockOof;
53 import static org.onap.so.bpmn.mock.StubResponseOof.mockOof_500;
54
55
56 /**
57  * Test the OOF Homing subflow building block.
58  */
59 @Ignore
60 public class OofHomingTestIT extends BaseIntegrationTest {
61
62         Logger logger = LoggerFactory.getLogger(CreateAAIVfModuleIT.class);
63
64     ServiceDecomposition serviceDecomposition = new ServiceDecomposition();
65     String subscriber = "";
66     String subscriber2 = "";
67
68     private final CallbackSet callbacks = new CallbackSet();
69
70     public OofHomingTestIT() throws IOException {
71         String oofCallback = FileUtil.readResourceFile("__files/BuildingBlocks/oofCallbackInfraVnf");
72         String oofCallback2 = FileUtil.readResourceFile("__files/BuildingBlocks/oofCallback2AR1Vnf");
73         String oofCallback3 = FileUtil.readResourceFile("__files/BuildingBlocks/oofCallback2AR1Vnf2Net");
74
75         String oofCallbackNoSolution = FileUtil.
76                 readResourceFile("__files/BuildingBlocks/oofCallbackNoSolutionFound");
77         String oofCallbackPolicyException = FileUtil.
78                 readResourceFile("__files/BuildingBlocks/oofCallbackPolicyException");
79         String oofCallbackServiceException = FileUtil.
80                 readResourceFile("__files/BuildingBlocks/oofCallbackServiceException");
81
82         callbacks.put("oof", JSON, "oofResponse", oofCallback);
83         callbacks.put("oof2", JSON, "oofResponse", oofCallback2);
84         callbacks.put("oof3", JSON, "oofResponse", oofCallback3);
85         callbacks.put("oofNoSol", JSON, "oofResponse", oofCallbackNoSolution);
86         callbacks.put("oofPolicyEx", JSON, "oofResponse", oofCallbackPolicyException);
87         callbacks.put("oofServiceEx", JSON, "oofResponse", oofCallbackServiceException);
88
89         // Service Model
90         ModelInfo sModel = new ModelInfo();
91         sModel.setModelCustomizationName("testModelCustomizationName");
92         sModel.setModelInstanceName("testModelInstanceName");
93         sModel.setModelInvariantUuid("testModelInvariantId");
94         sModel.setModelName("testModelName");
95         sModel.setModelUuid("testModelUuid");
96         sModel.setModelVersion("testModelVersion");
97         // Service Instance
98         ServiceInstance si = new ServiceInstance();
99         si.setInstanceId("testServiceInstanceId123");
100         // Allotted Resources
101         List<AllottedResource> arList = new ArrayList<AllottedResource>();
102         AllottedResource ar = new AllottedResource();
103         ar.setResourceId("testResourceIdAR");
104         ar.setResourceInstanceName("testARInstanceName");
105         ModelInfo arModel = new ModelInfo();
106         arModel.setModelCustomizationUuid("testModelCustomizationUuidAR");
107         arModel.setModelInvariantUuid("testModelInvariantIdAR");
108         arModel.setModelName("testModelNameAR");
109         arModel.setModelVersion("testModelVersionAR");
110         arModel.setModelUuid("testARModelUuid");
111         arModel.setModelType("testModelTypeAR");
112         ar.setModelInfo(arModel);
113         AllottedResource ar2 = new AllottedResource();
114         ar2.setResourceId("testResourceIdAR2");
115         ar2.setResourceInstanceName("testAR2InstanceName");
116         ModelInfo arModel2 = new ModelInfo();
117         arModel2.setModelCustomizationUuid("testModelCustomizationUuidAR2");
118         arModel2.setModelInvariantUuid("testModelInvariantIdAR2");
119         arModel2.setModelName("testModelNameAR2");
120         arModel2.setModelVersion("testModelVersionAR2");
121         arModel2.setModelUuid("testAr2ModelUuid");
122         arModel2.setModelType("testModelTypeAR2");
123         ar2.setModelInfo(arModel2);
124         arList.add(ar);
125         arList.add(ar2);
126         // Vnfs
127         List<VnfResource> vnfList = new ArrayList<VnfResource>();
128         VnfResource vnf = new VnfResource();
129         vnf.setResourceId("testResourceIdVNF");
130         vnf.setResourceInstanceName("testVnfInstanceName");
131         vnf.getHomingSolution().setOofDirectives(
132                 "{ \n" +
133                         "      \"directives\":[ \n" +
134                         "         { \n" +
135                         "            \"vnfc_directives\":[ \n" +
136                         "               { \n" +
137                         "                  \"vnfc_id\":\"<ID of VNFC>\",\n" +
138                         "                  \"directives\":[ \n" +
139                         "                     { \n" +
140                         "                        \"directive_name\":\"<Name of directive,example flavor_directive>\",\n" +
141                         "                        \"attributes\":[ \n" +
142                         "                           { \n" +
143                         "                              \"attribute_name\":\"<name of attribute, such as flavor label>\",\n" +
144                         "                              \"attribute_value\":\"<value such as cloud specific flavor>\"\n" +
145                         "                           }\n" +
146                         "                        ]\n" +
147                         "                     },\n" +
148                         "                     { \n" +
149                         "                        \"directive_name\":\"<Name of directive,example vnic-info>\",\n" +
150                         "                        \"attributes\":[ \n" +
151                         "                           { \n" +
152                         "                              \"attribute_name\":\"<name of attribute, such as vnic-type>\",\n" +
153                         "                              \"attribute_value\":\"<value such as direct/normal>\"\n" +
154                         "                           },\n" +
155                         "                           { \n" +
156                         "                              \"attribute_name\":\"<name of attribute, such as provider netweork>\",\n" +
157                         "                              \"attribute_value\":\"<value such as physnet>\"\n" +
158                         "                           }\n" +
159                         "                        ]\n" +
160                         "                     }\n" +
161                         "                  ]\n" +
162                         "               }\n" +
163                         "            ]\n" +
164                         "         },\n" +
165                         "         { \n" +
166                         "            \"vnf_directives\":{ \n" +
167                         "               \"directives\":[ \n" +
168                         "                  { \n" +
169                         "                     \"directive_name\":\"<Name of directive>\",\n" +
170                         "                     \"attributes\":[ \n" +
171                         "                        { \n" +
172                         "                           \"attribute_name\":\"<name of attribute>\",\n" +
173                         "                           \"attribute_value\":\"<value>\"\n" +
174                         "                        }\n" +
175                         "                     ]\n" +
176                         "                  },\n" +
177                         "                  { \n" +
178                         "                     \"directive_name\":\"<Name of directive>\",\n" +
179                         "                     \"attributes\":[ \n" +
180                         "                        { \n" +
181                         "                           \"attribute_name\":\"<name of attribute>\",\n" +
182                         "                           \"attribute_value\":\"<value >\"\n" +
183                         "                        },\n" +
184                         "                        { \n" +
185                         "                           \"attribute_name\":\"<name of attribute>\",\n" +
186                         "                           \"attribute_value\":\"<value >\"\n" +
187                         "                        }\n" +
188                         "                     ]\n" +
189                         "                  }\n" +
190                         "               ]\n" +
191                         "            }\n" +
192                         "         }\n" +
193                         "      ]\n" +
194                         "   },\n" +
195                         "   \"sdnc_directives\":{ \n" +
196                         "      \"directives\":[ \n" +
197                         "         { \n" +
198                         "            \"vnfc_directives\":[ \n" +
199                         "               { \n" +
200                         "                  \"vnfc_id\":\"<ID of VNFC>\",\n" +
201                         "                  \"directives\":[ \n" +
202                         "                     { \n" +
203                         "                        \"directive_name\":\"<Name of directive,example flavor_directive>\",\n" +
204                         "                        \"attributes\":[ \n" +
205                         "                           { \n" +
206                         "                              \"attribute_name\":\"<name of attribute, such as flavor label>\",\n" +
207                         "                              \"attribute_value\":\"<value such as cloud specific flavor>\"\n" +
208                         "                           }\n" +
209                         "                        ]\n" +
210                         "                     },\n" +
211                         "                     { \n" +
212                         "                        \"directive_name\":\"<Name of directive,example vnic-info>\",\n" +
213                         "                        \"attributes\":[ \n" +
214                         "                           { \n" +
215                         "                              \"attribute_name\":\"<name of attribute, such as vnic-type>\",\n" +
216                         "                              \"attribute_value\":\"<value such as direct/normal>\"\n" +
217                         "                           },\n" +
218                         "                           { \n" +
219                         "                              \"attribute_name\":\"<name of attribute, such as provider netweork>\",\n" +
220                         "                              \"attribute_value\":\"<value such as physnet>\"\n" +
221                         "                           }\n" +
222                         "                        ]\n" +
223                         "                     }\n" +
224                         "                  ]\n" +
225                         "               }\n" +
226                         "            ]\n" +
227                         "         },\n" +
228                         "         { \n" +
229                         "            \"vnf_directives\":{ \n" +
230                         "               \"directives\":[ \n" +
231                         "                  { \n" +
232                         "                     \"directive_name\":\"<Name of directive>\",\n" +
233                         "                     \"attributes\":[ \n" +
234                         "                        { \n" +
235                         "                           \"attribute_name\":\"<name of attribute>\",\n" +
236                         "                           \"attribute_value\":\"<value>\"\n" +
237                         "                        }\n" +
238                         "                     ]\n" +
239                         "                  },\n" +
240                         "                  { \n" +
241                         "                     \"directive_name\":\"<Name of directive>\",\n" +
242                         "                     \"attributes\":[ \n" +
243                         "                        { \n" +
244                         "                           \"attribute_name\":\"<name of attribute>\",\n" +
245                         "                           \"attribute_value\":\"<value >\"\n" +
246                         "                        },\n" +
247                         "                        { \n" +
248                         "                           \"attribute_name\":\"<name of attribute>\",\n" +
249                         "                           \"attribute_value\":\"<value >\"\n" +
250                         "                        }\n" +
251                         "                     ]\n" +
252                         "                  }\n" +
253                         "               ]\n" +
254                         "            }\n" +
255                         "         }\n" +
256                         "      ]\n" +
257                         "   }");
258         ModelInfo vnfModel = new ModelInfo();
259         vnfModel.setModelCustomizationUuid("testModelCustomizationUuidVNF");
260         vnfModel.setModelInvariantUuid("testModelInvariantIdVNF");
261         vnfModel.setModelName("testModelNameVNF");
262         vnfModel.setModelVersion("testModelVersionVNF");
263         vnfModel.setModelUuid("testVnfModelUuid");
264         vnfModel.setModelType("testModelTypeVNF");
265         vnf.setModelInfo(vnfModel);
266         vnfList.add(vnf);
267         logger.debug("SERVICE DECOMP: {}", serviceDecomposition.getServiceResourcesJsonString());
268         serviceDecomposition.setModelInfo(sModel);
269         serviceDecomposition.setAllottedResources(arList);
270         serviceDecomposition.setVnfResources(vnfList);
271         serviceDecomposition.setServiceInstance(si);
272
273         // Subscriber
274         subscriber = "{\"globalSubscriberId\": \"SUB12_0322_DS_1201\",\"subscriberCommonSiteId\": \"DALTX0101\",\"subscriberName\": \"SUB_12_0322_DS_1201\"}";
275         subscriber2 = "{\"globalSubscriberId\": \"SUB12_0322_DS_1201\",\"subscriberName\": \"SUB_12_0322_DS_1201\"}";
276     }
277
278     @Test
279
280     public void testHoming_success_2AR1Vnf() throws Exception {
281
282         mockOof();
283
284         String businessKey = UUID.randomUUID().toString();
285         Map<String, Object> variables = new HashMap<>();
286         setVariables(variables);
287
288        invokeSubProcess("Homing", businessKey, variables);
289
290         injectWorkflowMessages(callbacks, "oof2");
291
292         waitForProcessEnd(businessKey, 10000);
293
294         //Get Variables
295         WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey,
296                 "WorkflowException");
297         ServiceDecomposition serviceDecompositionExp = (ServiceDecomposition) getVariableFromHistory(businessKey,
298                 "serviceDecomposition");
299         String expectedOofRequest = (String) getVariableFromHistory(businessKey, "oofRequest");
300
301         Resource resourceAR = serviceDecompositionExp.getServiceResource("testResourceIdAR");
302         HomingSolution resourceARHoming = resourceAR.getHomingSolution();
303         Resource resourceAR2 = serviceDecompositionExp.getServiceResource("testResourceIdAR2");
304         HomingSolution resourceARHoming2 = resourceAR2.getHomingSolution();
305         Resource resourceVNF = serviceDecompositionExp.getServiceResource("testResourceIdVNF");
306         HomingSolution resourceVNFHoming = resourceVNF.getHomingSolution();
307         String resourceARHomingString = resourceARHoming.toString();
308         resourceARHomingString = resourceARHomingString.replaceAll("\\s+", " ");
309         String resourceARHoming2String = resourceARHoming2.toString();
310         resourceARHoming2String = resourceARHoming2String.replaceAll("\\s+", " ");
311         String resourceVNFHomingString = resourceVNFHoming.toString();
312         resourceVNFHomingString = resourceVNFHomingString.replaceAll("\\s+", " ");
313         expectedOofRequest = expectedOofRequest.replaceAll("\\s+", "");
314
315         assertNull(workflowException);
316         assertEquals(homingSolutionService("service", "testSIID1", "MDTNJ01",
317                 resourceARHoming.getVnf().getResourceId(),"aic", "dfwtx",
318                 "\"f1d563e8-e714-4393-8f99-cc480144a05e\", \"j1d563e8-e714-4393-8f99-cc480144a05e\"",
319                 "\"s1d563e8-e714-4393-8f99-cc480144a05e\", \"b1d563e8-e714-4393-8f99-cc480144a05e\""),
320                 resourceARHomingString);
321         assertEquals(homingSolutionService("service", "testSIID2", "testVnfHostname2",
322                 resourceARHoming2.getVnf().getResourceId(),"aic", "testCloudRegionId2",
323                 null, null), resourceARHoming2String);
324         assertEquals(homingSolutionCloud("cloud","aic", "testCloudRegionId3",
325                 true, "\"91d563e8-e714-4393-8f99-cc480144a05e\", \"21d563e8-e714-4393-8f99-cc480144a05e\"",
326                 "\"31d563e8-e714-4393-8f99-cc480144a05e\", \"71d563e8-e714-4393-8f99-cc480144a05e\""),
327                 resourceVNFHomingString);
328         assertEquals(verifyOofRequest(), expectedOofRequest);
329     }
330
331     @Test
332
333     public void testHoming_success_2AR1Vnf2Net() throws Exception {
334
335         mockOof();
336
337         String businessKey = UUID.randomUUID().toString();
338         Map<String, Object> variables = new HashMap<>();
339         setVariables2(variables);
340
341        invokeSubProcess("Homing", businessKey, variables);
342
343         injectWorkflowMessages(callbacks, "oof3");
344
345         waitForProcessEnd(businessKey, 10000);
346
347         //Get Variables
348         WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey,
349                 "WorkflowException");
350         ServiceDecomposition serviceDecompositionExp = (ServiceDecomposition) getVariableFromHistory(businessKey,
351                 "serviceDecomposition");
352         String expectedOofRequest = (String) getVariableFromHistory(businessKey, "oofRequest");
353
354         Resource resourceAR = serviceDecompositionExp.getServiceResource("testResourceIdAR");
355         HomingSolution resourceARHoming = resourceAR.getHomingSolution();
356         Resource resourceAR2 = serviceDecompositionExp.getServiceResource("testResourceIdAR2");
357         HomingSolution resourceARHoming2 = resourceAR2.getHomingSolution();
358         Resource resourceVNF = serviceDecompositionExp.getServiceResource("testResourceIdVNF");
359         HomingSolution resourceVNFHoming = resourceVNF.getHomingSolution();
360         Resource resourceNet = serviceDecompositionExp.getServiceResource("testResourceIdNet");
361         HomingSolution resourceNetHoming = resourceNet.getHomingSolution();
362         Resource resourceNet2 = serviceDecompositionExp.getServiceResource("testResourceIdNet2");
363         HomingSolution resourceNetHoming2 = resourceNet2.getHomingSolution();
364
365         String resourceARHomingString = resourceARHoming.toString();
366         resourceARHomingString = resourceARHomingString.replaceAll("\\s+", " ");
367         String resourceARHoming2String = resourceARHoming2.toString();
368         resourceARHoming2String = resourceARHoming2String.replaceAll("\\s+", " ");
369         String resourceVNFHomingString = resourceVNFHoming.toString();
370         resourceVNFHomingString = resourceVNFHomingString.replaceAll("\\s+", " ");
371         String resourceNetHomingString = resourceNetHoming.toString();
372         resourceNetHomingString = resourceNetHomingString.replaceAll("\\s+", " ");
373         String resourceNetHoming2String = resourceNetHoming2.toString();
374         resourceNetHoming2String = resourceNetHoming2String.replaceAll("\\s+", " ");
375         expectedOofRequest = expectedOofRequest.replaceAll("\\s+", "");
376
377
378         assertNull(workflowException);
379         assertEquals(homingSolutionService("service", "testSIID1", "MDTNJ01",
380                 resourceARHoming.getVnf().getResourceId(),"aic", "dfwtx",
381                 "\"f1d563e8-e714-4393-8f99-cc480144a05e\", \"j1d563e8-e714-4393-8f99-cc480144a05e\"",
382                 "\"s1d563e8-e714-4393-8f99-cc480144a05e\", \"b1d563e8-e714-4393-8f99-cc480144a05e\""),
383                 resourceARHomingString);
384         assertEquals(homingSolutionService("service", "testSIID2", "testVnfHostname2",
385                 resourceARHoming2.getVnf().getResourceId(),
386                 "aic", "testCloudRegionId2",
387                 null, null), resourceARHoming2String);
388         assertEquals(homingSolutionCloud("cloud","aic",
389                 "testCloudRegionId3",
390                 true, "\"91d563e8-e714-4393-8f99-cc480144a05e\", \"21d563e8-e714-4393-8f99-cc480144a05e\"",
391                 "\"31d563e8-e714-4393-8f99-cc480144a05e\", \"71d563e8-e714-4393-8f99-cc480144a05e\""),
392                 resourceVNFHomingString);
393         assertEquals(homingSolutionService("service", "testServiceInstanceIdNet",
394                 "testVnfHostNameNet", resourceNetHoming.getVnf().getResourceId(),"aic",
395                 "testCloudRegionIdNet",
396                 null, null), resourceNetHomingString);
397         assertEquals(homingSolutionCloud("cloud", "aic",
398                 "testCloudRegionIdNet2",
399                 false, "\"f1d563e8-e714-4393-8f99-cc480144a05n\", \"j1d563e8-e714-4393-8f99-cc480144a05n\"",
400                 "\"s1d563e8-e714-4393-8f99-cc480144a05n\", \"b1d563e8-e714-4393-8f99-cc480144a05n\""),
401                 resourceNetHoming2String);
402         assertEquals(verifyOofRequest(), expectedOofRequest);
403
404     }
405
406     @Test
407
408
409     public void testHoming_success_vnfResourceList() throws Exception {
410
411         // Create a Service Decomposition
412         MockGetServiceResourcesCatalogDataByModelUuid("2f7f309d-c842-4644-a2e4-34167be5eeb4",
413                 "/BuildingBlocks/oofCatalogResp.json");
414         String busKey = UUID.randomUUID().toString();
415         Map<String, Object> vars = new HashMap<>();
416         setVariablesForServiceDecomposition(vars, "testRequestId123",
417                 "ff5256d2-5a33-55df-13ab-12abad84e7ff");
418         invokeSubProcess("DecomposeService", busKey, vars);
419
420         ServiceDecomposition sd = (ServiceDecomposition) getVariableFromHistory(busKey,
421                 "serviceDecomposition");
422         logger.debug("In testHoming_success_vnfResourceList, ServiceDecomposition = {}", sd);
423         List<VnfResource> vnfResourceList = sd.getVnfResources();
424         vnfResourceList.get(0).setResourceId("test-resource-id-000");
425
426         // Invoke Homing
427
428         mockOof();
429
430         String businessKey = UUID.randomUUID().toString();
431         Map<String, Object> variables = new HashMap<>();
432         variables.put("homingService", "oof");
433         variables.put("isDebugLogEnabled", "true");
434         variables.put("msoRequestId", "testRequestId");
435         variables.put("serviceInstanceId", "testServiceInstanceId");
436         variables.put("serviceDecomposition", sd);
437         variables.put("subscriberInfo", subscriber2);
438         HashMap customerLocation = new HashMap<String, Object>();
439         customerLocation.put("customerLatitude", "32.89748");
440         customerLocation.put("customerLongitude", "-97.040443");
441         customerLocation.put("customerName", "xyz");
442         variables.put("customerLatitude", "32.89748");
443         variables.put("customerLongitude", "-97.040443");
444         variables.put("customerName", "xyz");
445         variables.put("customerLocation", customerLocation);
446         variables.put("cloudOwner", "amazon");
447         variables.put("cloudRegionId", "TNZED");
448
449         invokeSubProcess("Homing", businessKey, variables);
450         injectWorkflowMessages(callbacks, "oof3");
451         waitForProcessEnd(businessKey, 10000);
452
453         //Get Variables
454
455         WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey,
456                 "WorkflowException");
457         ServiceDecomposition serviceDecompositionExp = (ServiceDecomposition) getVariableFromHistory(businessKey,
458                 "serviceDecomposition");
459         logger.debug("serviceDecompositionExp is: {}", serviceDecompositionExp);
460
461         Resource resourceVnf = serviceDecompositionExp.getServiceResource("test-resource-id-000");
462         logger.debug("resourceVnf is: {}", resourceVnf);
463         HomingSolution resourceVnfHoming = resourceVnf.getHomingSolution();
464
465         String resourceVnfHomingString = resourceVnfHoming.toString();
466         logger.debug("resourceVnfHomingString is: {}", resourceVnfHomingString);
467         resourceVnfHomingString = resourceVnfHomingString.replaceAll("\\s+", " ");
468         logger.debug("Now resourceVnfHomingString is: {}", resourceVnfHomingString);
469
470         assertNull(workflowException);
471
472         //Verify request
473         String oofRequest = (String) getVariableFromHistory(businessKey, "oofRequest");
474         logger.debug("oofRequest is: {}", oofRequest);
475         assertEquals(FileUtil.readResourceFile("__files/BuildingBlocks/oofRequest_infravnf").
476                 replaceAll("\n", "").replaceAll("\r", "").
477                 replaceAll("\t", ""), oofRequest.replaceAll("\n", "").
478                 replaceAll("\r", "").replaceAll("\t", ""));
479
480         assertEquals(homingSolutionService("service", "service-instance-01234",
481                 "MDTNJ01", "test-resource-id-000","CloudOwner",
482                 "mtmnj1a",
483                 "\"f1d563e8-e714-4393-8f99-cc480144a05e\"," +
484                         " \"j1d563e8-e714-4393-8f99-cc480144a05e\"",
485                 "\"s1d563e8-e714-4393-8f99-cc480144a05e\"," +
486                         " \"b1d563e8-e714-4393-8f99-cc480144a05e\""), resourceVnfHomingString);
487     }
488
489     @Test
490     public void testHoming_success_existingLicense() throws Exception {
491
492         mockOof();
493
494         String businessKey = UUID.randomUUID().toString();
495         Map<String, Object> variables = new HashMap<String, Object>();
496         setVariablesExistingLicense(variables);
497
498         invokeSubProcess("Homing", businessKey, variables);
499
500         injectWorkflowMessages(callbacks, "sniro");
501
502         waitForProcessEnd(businessKey, 10000);
503
504         //Get Variables
505         WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey, "WorkflowException");
506         ServiceDecomposition serviceDecompositionExp = (ServiceDecomposition) getVariableFromHistory(businessKey, "serviceDecomposition");
507         String oofRequest = (String) getVariableFromHistory(businessKey, "sniroRequest");
508
509         Resource resourceAR = serviceDecompositionExp.getServiceResource("testResourceIdAR");
510         HomingSolution resourceARHoming = (HomingSolution) resourceAR.getHomingSolution();
511         Resource resourceAR2 = serviceDecompositionExp.getServiceResource("testResourceIdAR2");
512         HomingSolution resourceARHoming2 = (HomingSolution) resourceAR2.getHomingSolution();
513         Resource resourceVNF = serviceDecompositionExp.getServiceResource("testResourceIdVNF");
514         HomingSolution resourceVNFHoming = (HomingSolution) resourceVNF.getHomingSolution();
515         String resourceARHomingString = resourceARHoming.toString();
516         resourceARHomingString = resourceARHomingString.replaceAll("\\s+", " ");
517         String resourceARHoming2String = resourceARHoming2.toString();
518         resourceARHoming2String = resourceARHoming2String.replaceAll("\\s+", " ");
519         String resourceVNFHomingString = resourceVNFHoming.toString();
520         resourceVNFHomingString = resourceVNFHomingString.replaceAll("\\s+", " ");
521         oofRequest = oofRequest.replaceAll("\\s+", "");
522
523         assertNull(workflowException);
524         assertEquals(homingSolutionService("service", "testSIID1", "MDTNJ01",
525                 "aic", "dfwtx", "KDTNJ01",
526                 "\"f1d563e8-e714-4393-8f99-cc480144a05e\", \"j1d563e8-e714-4393-8f99-cc480144a05e\"",
527                 "\"s1d563e8-e714-4393-8f99-cc480144a05e\", \"b1d563e8-e714-4393-8f99-cc480144a05e\""),
528                 resourceARHomingString);
529         assertEquals(homingSolutionService("service", "testSIID2", "testVnfHostname2",
530                 resourceARHoming2.getVnf().getResourceId(),"aic", "testCloudRegionId2",
531                 null, null), resourceARHoming2String);
532         assertEquals(homingSolutionCloud("cloud", "aic",
533                 "testCloudRegionId3",
534                 false, "\"91d563e8-e714-4393-8f99-cc480144a05e\", \"21d563e8-e714-4393-8f99-cc480144a05e\"",
535                 "\"31d563e8-e714-4393-8f99-cc480144a05e\", \"71d563e8-e714-4393-8f99-cc480144a05e\""),
536                 resourceVNFHomingString);
537         assertEquals(verifyOofRequestExistingLicense(), oofRequest);
538
539     }
540
541     @Test
542     public void testHoming_error_inputVariable() throws Exception {
543
544         String businessKey = UUID.randomUUID().toString();
545         Map<String, Object> variables = new HashMap<>();
546         setVariables3(variables);
547
548         invokeSubProcess("Homing", businessKey, variables);
549
550         waitForProcessEnd(businessKey, 10000);
551
552         //Get Variables
553         WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey,
554                 "WorkflowException");
555
556         assertEquals("WorkflowException[processKey=Homing,errorCode=4000,errorMessage=A required " +
557                 "input variable is missing or null]", workflowException.toString());
558     }
559
560     @Test
561
562     public void testHoming_error_badResponse() throws Exception {
563         mockOof_500();
564
565         String businessKey = UUID.randomUUID().toString();
566         Map<String, Object> variables = new HashMap<>();
567         setVariables(variables);
568
569         invokeSubProcess("Homing", businessKey, variables);
570
571         waitForProcessEnd(businessKey, 10000);
572
573         //Get Variables
574         WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey,
575                 "WorkflowException");
576
577         assertEquals("WorkflowException[processKey=Homing,errorCode=500,errorMessage=Received a " +
578                 "Bad Sync Response from Sniro/OOF.]", workflowException.toString());
579     }
580
581     @Test
582
583     public void testHoming_error_oofNoSolution() throws Exception {
584         mockOof();
585
586         String businessKey = UUID.randomUUID().toString();
587         Map<String, Object> variables = new HashMap<>();
588         setVariables(variables);
589
590         invokeSubProcess("Homing", businessKey, variables);
591
592         injectWorkflowMessages(callbacks, "oofNoSol");
593
594         waitForProcessEnd(businessKey, 10000);
595
596         //Get Variables
597         WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey,
598                 "WorkflowException");
599
600         assertEquals("WorkflowException[processKey=Homing,errorCode=400,errorMessage=No solution found " +
601                 "for plan 08e1b8cf-144a-4bac-b293-d5e2eedc97e8]", workflowException.toString());
602     }
603
604     @Test
605
606     public void testHoming_error_oofPolicyException() throws Exception {
607         mockOof();
608
609         String businessKey = UUID.randomUUID().toString();
610         Map<String, Object> variables = new HashMap<>();
611         setVariables(variables);
612
613         invokeSubProcess("Homing", businessKey, variables);
614
615         injectWorkflowMessages(callbacks, "oofPolicyEx");
616
617         waitForProcessEnd(businessKey, 10000);
618
619         //Get Variables
620         WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey,
621                 "WorkflowException");
622
623         assertEquals("WorkflowException[processKey=Homing,errorCode=400,errorMessage=OOF Async Callback " +
624                 "Response contains a Request Error Policy Exception: Message content size exceeds the allowable " +
625                 "limit]", workflowException.toString());
626     }
627
628     @Test
629
630     public void testHoming_error_oofServiceException() throws Exception {
631         mockOof();
632
633         String businessKey = UUID.randomUUID().toString();
634         Map<String, Object> variables = new HashMap<>();
635         setVariables(variables);
636
637         invokeSubProcess("Homing", businessKey, variables);
638
639         injectWorkflowMessages(callbacks, "oofServiceEx");
640
641         waitForProcessEnd(businessKey, 10000);
642
643         //Get Variables
644         WorkflowException workflowException = (WorkflowException) getVariableFromHistory(businessKey,
645                 "WorkflowException");
646
647         assertEquals("WorkflowException[processKey=Homing,errorCode=400,errorMessage=OOF Async Callback " +
648                         "Response contains a Request Error Service Exception: OOF PlacementError: " +
649                         "requests.exceptions.HTTPError: 404 Client Error: Not Found for " +
650                         "url: http://192.168.171.200:8091/v1/plans/97b4e303-5f75-492c-8fb2-21098281c8b8]",
651                 workflowException.toString());
652     }
653
654
655     private void setVariables(Map<String, Object> variables) {
656         variables.put("homingService", "oof");
657         HashMap customerLocation = new HashMap<String, Object>();
658         customerLocation.put("customerLatitude", "32.89748");
659         customerLocation.put("customerLongitude", "-97.040443");
660         customerLocation.put("customerName", "xyz");
661         variables.put("customerLatitude", "32.89748");
662         variables.put("customerLongitude", "-97.040443");
663         variables.put("customerName", "xyz");
664         variables.put("customerLocation", customerLocation);
665         variables.put("cloudOwner", "amazon");
666         variables.put("cloudRegionId", "TNZED");
667         variables.put("isDebugLogEnabled", "true");
668         //      variables.put("mso-request-id", "testRequestId");
669         variables.put("msoRequestId", "testRequestId");
670         variables.put("serviceInstanceId", "testServiceInstanceId");
671         variables.put("serviceDecomposition", serviceDecomposition);
672         variables.put("subscriberInfo", subscriber2);
673     }
674
675     private void setVariables2(Map<String, Object> variables) {
676         List<NetworkResource> netList = new ArrayList<NetworkResource>();
677         NetworkResource net = new NetworkResource();
678         net.setResourceId("testResourceIdNet");
679         ModelInfo netModel = new ModelInfo();
680         netModel.setModelCustomizationUuid("testModelCustomizationUuidNet");
681         netModel.setModelInvariantUuid("testModelInvariantIdNet");
682         netModel.setModelName("testModelNameNet");
683         netModel.setModelVersion("testModelVersionNet");
684         net.setModelInfo(netModel);
685         netList.add(net);
686         NetworkResource net2 = new NetworkResource();
687         net2.setResourceId("testResourceIdNet2");
688         ModelInfo netModel2 = new ModelInfo();
689         netModel2.setModelCustomizationUuid("testModelCustomizationUuidNet2");
690         netModel2.setModelCustomizationName("testModelCustomizationNameNet2");
691         netModel2.setModelInvariantUuid("testModelInvariantIdNet2");
692         netModel2.setModelName("testModelNameNet2");
693         netModel2.setModelVersion("testModelVersionNet2");
694         net2.setModelInfo(netModel2);
695         netList.add(net2);
696         serviceDecomposition.setNetworkResources(netList);
697
698         variables.put("homingService", "oof");
699         HashMap customerLocation = new HashMap<String, Object>();
700         customerLocation.put("customerLatitude", "32.89748");
701         customerLocation.put("customerLongitude", "-97.040443");
702         customerLocation.put("customerName", "xyz");
703         variables.put("customerLatitude", "32.89748");
704         variables.put("customerLongitude", "-97.040443");
705         variables.put("customerName", "xyz");
706         variables.put("customerLocation", customerLocation);
707         variables.put("cloudOwner", "amazon");
708         variables.put("cloudRegionId", "TNZED");
709         variables.put("isDebugLogEnabled", "true");
710         variables.put("msoRequestId", "testRequestId");
711         variables.put("serviceInstanceId", "testServiceInstanceId");
712         variables.put("serviceDecomposition", serviceDecomposition);
713         variables.put("subscriberInfo", subscriber2);
714     }
715
716     private void setVariables3(Map<String, Object> variables) {
717         variables.put("homingService", "oof");
718         HashMap customerLocation = new HashMap<String, Object>();
719         customerLocation.put("customerLatitude", "32.89748");
720         customerLocation.put("customerLongitude", "-97.040443");
721         customerLocation.put("customerName", "xyz");
722         variables.put("customerLatitude", "32.89748");
723         variables.put("customerLongitude", "-97.040443");
724         variables.put("customerName", "xyz");
725         variables.put("customerLocation", customerLocation);
726         variables.put("cloudOwner", "amazon");
727         variables.put("cloudRegionId", "TNZED");
728         variables.put("isDebugLogEnabled", "true");
729         //      variables.put("mso-request-id", "testRequestId");
730         variables.put("msoRequestId", "testRequestId");
731         variables.put("serviceInstanceId", "testServiceInstanceId");
732         variables.put("serviceDecomposition", null);
733         variables.put("subscriberInfo", subscriber2);
734     }
735
736     private void setVariablesExistingLicense(Map<String, Object> variables) {
737         HomingSolution currentHomingSolution = new HomingSolution();
738         serviceDecomposition.getVnfResources().get(0).setCurrentHomingSolution(currentHomingSolution);
739         serviceDecomposition.getVnfResources().get(0).getCurrentHomingSolution().getLicense().addEntitlementPool("testEntitlementPoolId1");
740         serviceDecomposition.getVnfResources().get(0).getCurrentHomingSolution().getLicense().addEntitlementPool("testEntitlementPoolId2");
741
742         serviceDecomposition.getVnfResources().get(0).getCurrentHomingSolution().getLicense().addLicenseKeyGroup("testLicenseKeyGroupId1");
743         serviceDecomposition.getVnfResources().get(0).getCurrentHomingSolution().getLicense().addLicenseKeyGroup("testLicenseKeyGroupId2");
744
745         variables.put("isDebugLogEnabled", "true");
746         variables.put("msoRequestId", "testRequestId");
747         variables.put("serviceInstanceId", "testServiceInstanceId");
748         variables.put("serviceDecomposition", serviceDecomposition);
749         variables.put("subscriberInfo", subscriber2);
750
751     }
752
753     private String homingSolutionService(String type, String serviceInstanceId, String vnfHostname,
754                                          String vnfResourceId, String cloudOwner,
755                                          String cloudRegionId, String enList,
756                                          String licenseList){
757
758         String solution = "";
759         if(enList == null){
760             solution = "{ \"homingSolution\" : { \"inventoryType\" : \"" + type + "\", \"serviceInstanceId\" : \"" +
761                     serviceInstanceId + "\", \"cloudOwner\" : \"" + cloudOwner + "\", \"cloudRegionId\" : \"" +
762                     cloudRegionId + "\", " + "\"vnf\" : { \"resourceId\" : \"" + vnfResourceId +
763                     "\", \"resourceType\" : \"VNF\", \"resourceInstance\" : { }, \"homingSolution\" : { \"license\" :" +
764                     " { }, \"rehome\" : false }, \"vnfHostname\" : \"" + vnfHostname + "\" }, \"license\" : { }," +
765                     " \"rehome\" : false } }";
766         }else{
767             //language=JSON
768             solution = "{ \"homingSolution\" : { \"inventoryType\" : \"" + type + "\", \"serviceInstanceId\" : \"" +
769                     serviceInstanceId + "\", \"cloudOwner\" : \"" + cloudOwner + "\", \"cloudRegionId\" : \"" +
770                     cloudRegionId + "\", \"vnf\" : { \"resourceId\" : \"" + vnfResourceId + "\", \"resourceType\" :" +
771                     " \"VNF\", \"resourceInstance\" : { }, \"homingSolution\" : { \"license\" : { }, \"rehome\" :" +
772                     " false }, \"vnfHostname\" : \"" + vnfHostname + "\" }, \"license\" : { \"entitlementPoolList\" :" +
773                     " [ " + enList + " ], \"licenseKeyGroupList\" : [ " + licenseList + " ] }, \"rehome\" : false } }";
774         }
775         return solution;
776     }
777
778     private String homingSolutionCloud(String type, String cloudOwner,
779                                        String cloudRegionId, Boolean flavors, String enList,
780                                        String licenseList){
781         String solution = "";
782         if(enList == null){
783             solution = "{ \"homingSolution\" : { \"inventoryType\" : \"" + type + "\", \"cloudOwner\" : \"" +
784                     cloudOwner + "\", \"cloudRegionId\" : \"" + cloudRegionId +
785                     "\", \"license\" : { }, \"rehome\" : false } }";
786         } else if (flavors && enList == null){
787             solution = "{ \"homingSolution\" : { \"inventoryType\" : \"" + type + "\", \"cloudOwner\" : \"" +
788                     cloudOwner + "\", \"cloudRegionId\" : \"" + cloudRegionId +
789                     "\", \"flavors\" :  [ { \"flavorLabel\" : \"flavorLabel2xxx\", \"flavor\" : \"vimFlavorxxx\" }, " +
790                     "{ \"flavorLabel\" : \"flavorLabel1xxx\", \"flavor\" : \"vimFlavorxxx\" } ], " +
791                     "\"license\" : { }, \"rehome\" : false } }";
792         } else if (flavors) {
793             solution = "{ \"homingSolution\" : { \"inventoryType\" : \"" + type + "\", \"cloudOwner\" : \"" +
794                     cloudOwner + "\", \"cloudRegionId\" : \"" + cloudRegionId +
795                     "\", \"flavors\" : [ { \"flavorLabel\" : \"flavorLabel2xxx\", \"flavor\" : \"vimFlavorxxx\" }, " +
796                     "{ \"flavorLabel\" : \"flavorLabel1xxx\", \"flavor\" : \"vimFlavorxxx\" } ], " +
797                     "\"license\" : { \"entitlementPoolList\" : [ " + enList +  " ], \"licenseKeyGroupList\" : [ " +
798                     licenseList +  " ] }, \"rehome\" : false } }";
799         } else {
800             solution = "{ \"homingSolution\" : { \"inventoryType\" : \"" + type + "\", \"cloudOwner\" : \"" +
801                     cloudOwner + "\", \"cloudRegionId\" : \"" + cloudRegionId +
802                     "\", \"license\" : { \"entitlementPoolList\" : [ " + enList +  " ], \"licenseKeyGroupList\" : [ " +
803                     licenseList +  " ] }, \"rehome\" : false } }";
804         }
805         return solution;
806     }
807
808     private void setVariablesForServiceDecomposition(Map<String, Object> variables, String requestId, String siId) {
809         variables.put("homingService", "oof");
810         variables.put("isDebugLogEnabled", "true");
811         variables.put("mso-request-id", requestId);
812         variables.put("msoRequestId", requestId);
813         variables.put("serviceInstanceId", siId);
814         HashMap customerLocation = new HashMap<String, Object>();
815         customerLocation.put("customerLatitude", "32.89748");
816         customerLocation.put("customerLongitude", "-97.040443");
817         customerLocation.put("customerName", "xyz");
818         variables.put("customerLatitude", "32.89748");
819         variables.put("customerLongitude", "-97.040443");
820         variables.put("customerName", "xyz");
821         variables.put("customerLocation", customerLocation);
822         variables.put("cloudOwner", "amazon");
823         variables.put("cloudRegionId", "TNZED");
824
825
826         String serviceModelInfo = "{\"modelInvariantId\":\"1cc4e2e4-eb6e-404d-a66f-c8733cedcce8\",\"modelUuid\":" +
827                 "\"2f7f309d-c842-4644-a2e4-34167be5eeb4\",\"modelName\":\"vCPE Service\",\"modelVersion\":\"2.0\",}";
828         variables.put("serviceModelInfo", serviceModelInfo);
829     }
830
831     private String verifyOofRequest() {
832         String request = "{\"requestInfo\":{\"transactionId\":\"testRequestId\",\"requestId\":\"testRequestId\"," +
833                 "\"callbackUrl\":\"http://localhost:28090/workflows/messages/message/oofResponse/testRequestId\"," +
834                 "\"sourceId\":\"so\",\"requestType\":\"create\",\"numSolutions\":1,\"optimizers\":[\"placement\"]," +
835                 "\"timeout\":600},\"placementInfo\":{\"requestParameters\":{\"customerLatitude\":" +
836                 "\"32.89748\",\"customerLongitude\":\"-97.040443\",\"customerName\":\"xyz\"},\"subscriberInfo\":" +
837                 "{\"globalSubscriberId\":\"SUB12_0322_DS_1201\",\"subscriberName\":\"SUB_12_0322_DS_1201\"," +
838                 "\"subscriberCommonSiteId\":\"\"},\"placementDemands\":[{\"resourceModuleName\":\"ALLOTTED_RESOURCE\"" +
839                 ",\"serviceResourceId\":\"testResourceIdAR\",\"tenantId\":" +
840                 "\"null\",\"resourceModelInfo\":{\"modelInvariantId\":\"testModelInvariantIdAR\"," +
841                 "\"modelVersionId\":\"testARModelUuid\",\"modelName\":\"testModelNameAR\",\"modelType\":" +
842                 "\"testModelTypeAR\",\"modelVersion\":\"testModelVersionAR\",\"modelCustomizationName\":\"\"}}," +
843                 "{\"resourceModuleName\":\"ALLOTTED_RESOURCE\",\"serviceResourceId\":\"testResourceIdAR2\"," +
844                 "\"tenantId\":\"null\",\"resourceModelInfo\":{\"modelInvariantId\":\"testModelInvariantIdAR2\"," +
845                 "\"modelVersionId\":\"testAr2ModelUuid\",\"modelName\":\"testModelNameAR2\"," +
846                 "\"modelType\":\"testModelTypeAR2\",\"modelVersion\":\"testModelVersionAR2\"," +
847                 "\"modelCustomizationName\":\"\"}}]},\"serviceInfo\":" +
848                 "{\"serviceInstanceId\":\"testServiceInstanceId123\"," +
849                 "\"serviceName\":\"null\",\"modelInfo\":{\"modelType\":\"\",\"modelInvariantId\":" +
850                 "\"testModelInvariantId\",\"modelVersionId\":\"testModelUuid\",\"modelName\":\"testModelName\"," +
851                 "\"modelVersion\":\"testModelVersion\",\"modelCustomizationName\":\"" +
852                 "\"}},\"licenseInfo\":{\"licenseDemands\":[{\"resourceModuleName\":\"VNF\",\"serviceResourceId\":" +
853                 "\"testResourceIdVNF\",\"resourceInstanceType\":\"VNF\",\"resourceModelInfo\":{\"modelInvariantId\":" +
854                 "\"testModelInvariantIdVNF\",\"modelVersionId\":\"testVnfModelUuid\",\"modelName\":" +
855                 "\"testModelNameVNF\",\"modelType\":\"testModelTypeVNF\",\"modelVersion\":\"testModelVersionVNF\"," +
856                 "\"modelCustomizationName\":\"\"}}]}}";
857         return request;
858     }
859
860     private String verifyOofRequestExistingLicense(){
861         String request = "{\"requestInfo\":{\"transactionId\":\"testRequestId\",\"requestId\":\"testRequestId\"," +
862                 "\"callbackUrl\":\"http://localhost:28090/workflows/messages/message/SNIROResponse/testRequestId\"," +
863                 "\"sourceId\":\"mso\",\"requestType\":\"speedchanged\",\"optimizer\":[\"placement\",\"license\"]," +
864                 "\"numSolutions\":1,\"timeout\":1800},\"placementInfo\":{\"serviceModelInfo\":{\"modelType\":\"\"," +
865                 "\"modelInvariantId\":\"testModelInvariantId\",\"modelVersionId\":\"testModelUuid\",\"modelName\":" +
866                 "\"testModelName\",\"modelVersion\":\"testModelVersion\"},\"subscriberInfo\":" +
867                 "{\"globalSubscriberId\":\"SUB12_0322_DS_1201\",\"subscriberName\":\"SUB_12_0322_DS_1201\"," +
868                 "\"subscriberCommonSiteId\":\"\"},\"demandInfo\":{\"placementDemand\":[{\"resourceInstanceType\":" +
869                 "\"ALLOTTED_RESOURCE\",\"serviceResourceId\":\"testResourceIdAR\",\"resourceModuleName\":\"\"," +
870                 "\"resourceModelInfo\":{\"modelCustomizationId\":\"testModelCustomizationUuidAR\"," +
871                 "\"modelInvariantId\":\"testModelInvariantIdAR\",\"modelName\":\"testModelNameAR\"," +
872                 "\"modelVersion\":\"testModelVersionAR\",\"modelVersionId\":\"testARModelUuid\",\"modelType\":" +
873                 "\"testModelTypeAR\"},\"tenantId\":\"\",\"tenantName\":\"\"},{\"resourceInstanceType\":" +
874                 "\"ALLOTTED_RESOURCE\",\"serviceResourceId\":\"testResourceIdAR2\",\"resourceModuleName\":" +
875                 "\"\",\"resourceModelInfo\":{\"modelCustomizationId\":\"testModelCustomizationUuidAR2\"," +
876                 "\"modelInvariantId\":\"testModelInvariantIdAR2\",\"modelName\":\"testModelNameAR2\"," +
877                 "\"modelVersion\":\"testModelVersionAR2\",\"modelVersionId\":\"testAr2ModelUuid\"," +
878                 "\"modelType\":\"testModelTypeAR2\"},\"tenantId\":\"\",\"tenantName\":\"\"}],\"licenseDemand\":" +
879                 "[{\"resourceInstanceType\":\"VNF\",\"serviceResourceId\":\"testResourceIdVNF\"," +
880                 "\"resourceModuleName\":\"\",\"resourceModelInfo\":{\"modelCustomizationId\":" +
881                 "\"testModelCustomizationUuidVNF\",\"modelInvariantId\":\"testModelInvariantIdVNF\"," +
882                 "\"modelName\":\"testModelNameVNF\",\"modelVersion\":\"testModelVersionVNF\"," +
883                 "\"modelVersionId\":\"testVnfModelUuid\",\"modelType\":\"testModelTypeVNF\"}," +
884                 "\"existingLicense\":[{\"entitlementPoolUUID\":[\"testEntitlementPoolId1\"," +
885                 "\"testEntitlementPoolId2\"],\"licenseKeyGroupUUID\":[\"testLicenseKeyGroupId1\"," +
886                 "\"testLicenseKeyGroupId2\"]}]}]},\"policyId\":[],\"serviceInstanceId\":" +
887                 "\"testServiceInstanceId123\",\"orderInfo\":\"{\\\"requestParameters\\\":null}\"}}";
888         return request;
889     }
890 }