Replaced all tabs with spaces in java and pom.xml
[so.git] / bpmn / mso-infrastructure-bpmn / src / test / java / org / onap / so / bpmn / common / GenerateVfModuleNameIT.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.common;
22
23 import static org.junit.Assert.assertNotNull;
24 import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetGenericVnfById;
25 import java.util.HashMap;
26 import java.util.Map;
27 import org.camunda.bpm.engine.RuntimeService;
28 import org.camunda.bpm.engine.test.Deployment;
29 import org.junit.Ignore;
30 import org.junit.Test;
31 import org.onap.so.BaseIntegrationTest;
32
33 /**
34  * Unit test for GenerateVfModuleName.bpmn.
35  */
36
37 public class GenerateVfModuleNameIT extends BaseIntegrationTest {
38     private static final String EOL = "\n";
39
40     @Test
41     public void TestGenerateVfModuleNameSuvvess() {
42         //
43         String request =
44                 "<vnf-request xmlns=\"http://ecomp.att.com/mso/infra/vnf-request/v1\">" + EOL + "  <request-info>" + EOL
45                         + "    <action>CREATE_VF_MODULE</action>" + EOL + "    <source>PORTAL</source>" + EOL
46                         + "  </request-info>" + EOL + "  <vnf-inputs>" + EOL + "    <vnf-name>STMTN5MMSC22</vnf-name>"
47                         + EOL + "    <vf-module-name>STMTN5MMSC22-MMSC::module-0-0</vf-module-name>" + EOL
48                         + "    <vf-module-model-name>MMSC::module-0</vf-module-model-name>" + EOL
49                         + "    <persona-model-id>973ed047-d251-4fb9-bf1a-65b8949e0a73</persona-model-id>" + EOL
50                         + "    <persona-model-version>1.0</persona-model-version>" + EOL
51                         + "    <service-id>00000000-0000-0000-0000-000000000000</service-id>" + EOL
52                         + "    <aic-node-clli>MDTWNJ21</aic-node-clli>" + EOL
53                         + "    <tenant-id>fba1bd1e195a404cacb9ce17a9b2b421</tenant-id>" + EOL + "  </vnf-inputs>" + EOL
54                         + "  <vnf-params xmlns:tns=\"http://ecomp.att.com/mso/infra/vnf-request/v1\"/>" + EOL
55                         + "</vnf-request>" + EOL;
56
57         MockGetGenericVnfById(wireMockServer, ".*", "GenericFlows/getGenericVnfByNameResponse.xml");
58         RuntimeService runtimeService = processEngine.getRuntimeService();
59         Map<String, Object> variables = new HashMap<String, Object>();
60         variables.put("isDebugLogEnabled", "true");
61         variables.put("vnfName", "STMTN5MMSC20");
62         variables.put("vfModuleLabel", "ModuleLabel1");
63         variables.put("personaModelId", "extrovert");
64         variables.put("vnfId", "12345678-f41f-4822-9323-b75962763d74");
65
66         runtimeService.startProcessInstanceByKey("GenerateVfModuleName", variables);
67         String response = BPMNUtil.getVariable(processEngine, "GenerateVfModuleName", "vfModuleName");
68
69         assertNotNull(response);
70     }
71 }