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.common;
23 import static org.junit.Assert.assertNotNull;
24 import static org.onap.so.bpmn.mock.StubResponseAAI.MockGetGenericVnfById;
25 import java.util.HashMap;
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;
34 * Unit test for GenerateVfModuleName.bpmn.
37 public class GenerateVfModuleNameIT extends BaseIntegrationTest {
38 private static final String EOL = "\n";
41 public void TestGenerateVfModuleNameSuvvess() {
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;
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");
66 runtimeService.startProcessInstanceByKey("GenerateVfModuleName", variables);
67 String response = BPMNUtil.getVariable(processEngine, "GenerateVfModuleName", "vfModuleName");
69 assertNotNull(response);