2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 - 2018 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.infrastructure.workflow.serviceTask.client.builder;
23 import java.util.Collection;
27 import org.camunda.bpm.engine.ProcessEngine;
28 import org.camunda.bpm.engine.ProcessEngineServices;
29 import org.camunda.bpm.engine.delegate.DelegateExecution;
30 import org.camunda.bpm.engine.runtime.Incident;
31 import org.camunda.bpm.engine.variable.VariableMap;
32 import org.camunda.bpm.engine.variable.value.TypedValue;
33 import org.camunda.bpm.model.bpmn.BpmnModelInstance;
34 import org.camunda.bpm.model.bpmn.instance.FlowElement;
35 import org.junit.Test;
37 public class ServiceRpcInputEntityBuilderTest {
38 ServiceRpcInputEntityBuilder serviceRpcInputEntityBuilder = new ServiceRpcInputEntityBuilder();
40 DelegateExecution delegateExecution = new DelegateExecution() {
41 private String operType;
42 private String resourceType;
43 private String requestId;
46 public String getProcessInstanceId() {
51 public String getProcessBusinessKey() {
56 public String getProcessDefinitionId() {
61 public String getParentId() {
66 public String getCurrentActivityId() {
71 public String getCurrentActivityName() {
76 public String getActivityInstanceId() {
81 public String getParentActivityInstanceId() {
86 public String getCurrentTransitionId() {
91 public DelegateExecution getProcessInstance() {
96 public DelegateExecution getSuperExecution() {
101 public boolean isCanceled() {
106 public String getTenantId() {
111 public void setVariable(String s, Object o, String s1) {
116 public Incident createIncident(String s, String s1) {
121 public Incident createIncident(String s, String s1, String s2) {
126 public void resolveIncident(String s) {
131 public String getId() {
136 public String getEventName() {
141 public String getBusinessKey() {
146 public BpmnModelInstance getBpmnModelInstance() {
151 public FlowElement getBpmnModelElementInstance() {
156 public ProcessEngineServices getProcessEngineServices() {
161 public String getVariableScopeKey() {
166 public Map<String, Object> getVariables() {
171 public VariableMap getVariablesTyped() {
176 public VariableMap getVariablesTyped(boolean b) {
181 public Map<String, Object> getVariablesLocal() {
186 public VariableMap getVariablesLocalTyped() {
191 public VariableMap getVariablesLocalTyped(boolean b) {
196 public Object getVariable(String s) {
197 if (AbstractBuilder.OPERATION_TYPE.equals(s)) {
199 } else if (AbstractBuilder.RESOURCE_TYPE.equals(s)) {
201 } else if ("msoRequestId".equals(s)) {
208 public Object getVariableLocal(String s) {
213 public <T extends TypedValue> T getVariableTyped(String s) {
218 public <T extends TypedValue> T getVariableTyped(String s, boolean b) {
223 public <T extends TypedValue> T getVariableLocalTyped(String s) {
228 public <T extends TypedValue> T getVariableLocalTyped(String s, boolean b) {
233 public Set<String> getVariableNames() {
238 public Set<String> getVariableNamesLocal() {
243 public void setVariable(String s, Object o) {
244 if (AbstractBuilder.OPERATION_TYPE.equals(s)) {
245 operType = (String) o;
246 } else if (AbstractBuilder.RESOURCE_TYPE.equals(s)) {
247 resourceType = (String) o;
248 } else if ("msoRequestId".equals(s)) {
249 requestId = (String) o;
254 public void setVariableLocal(String s, Object o) {
259 public void setVariables(Map<String, ?> map) {
264 public void setVariablesLocal(Map<String, ?> map) {
269 public boolean hasVariables() {
274 public boolean hasVariablesLocal() {
279 public boolean hasVariable(String s) {
284 public boolean hasVariableLocal(String s) {
289 public void removeVariable(String s) {
294 public void removeVariableLocal(String s) {
299 public void removeVariables(Collection<String> collection) {
304 public void removeVariablesLocal(Collection<String> collection) {
309 public void removeVariables() {
314 public void removeVariablesLocal() {
319 public ProcessEngine getProcessEngine(){
320 // TODO Auto-generated method stub
325 public void setProcessBusinessKey(String arg0){
326 // TODO Auto-generated method stub
332 public void buildTest() throws Exception {
333 serviceRpcInputEntityBuilder.build(delegateExecution, null);