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.openecomp.mso.bpmn.infrastructure;
23 import java.io.IOException;
24 import java.util.HashMap;
26 import java.util.UUID;
28 import org.camunda.bpm.engine.test.Deployment;
29 import org.junit.Assert;
30 import org.junit.Ignore;
31 import org.junit.Test;
32 import org.openecomp.mso.bpmn.common.WorkflowTest;
33 import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition;
34 import org.openecomp.mso.bpmn.core.json.JsonDecomposingException;
37 * Unit test cases for DoCreateServiceInstanceV3.bpmn
39 public class DoCreateServiceInstanceV3Test extends WorkflowTest {
41 public DoCreateServiceInstanceV3Test() throws IOException {
46 @Deployment(resources = { "subprocess/DoCreateServiceInstanceV3.bpmn",
47 "subprocess/DoCreateServiceInstanceV3Rollback.bpmn"
50 public void sunnyDay() throws Exception {
52 String businessKey = UUID.randomUUID().toString();
53 Map<String, Object> variables = new HashMap<String, Object>();
54 setupVariables(variables);
55 invokeSubProcess("DoCreateServiceInstanceV3", businessKey, variables);
56 waitForProcessEnd(businessKey, 10000);
57 Assert.assertTrue(isProcessEnded(businessKey));
62 private void setupVariables(Map<String, Object> variables) throws JsonDecomposingException {
63 variables.put("abc", "thevalueisabc");
64 variables.put("mso-request-id", "213");
65 ServiceDecomposition serviceDecomp = new ServiceDecomposition("{\"serviceResources\":{}}", "123");
66 serviceDecomp.setServiceType("PORT-MIRRO");
67 serviceDecomp.setSdncVersion("1610");
68 variables.put("serviceDecomposition", serviceDecomp);