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;
26 import org.camunda.bpm.engine.ProcessEngine;
27 import org.camunda.bpm.engine.ProcessEngineServices;
28 import org.camunda.bpm.engine.delegate.DelegateExecution;
29 import org.camunda.bpm.engine.runtime.Incident;
30 import org.camunda.bpm.engine.variable.VariableMap;
31 import org.camunda.bpm.engine.variable.value.TypedValue;
32 import org.camunda.bpm.model.bpmn.BpmnModelInstance;
33 import org.camunda.bpm.model.bpmn.instance.FlowElement;
34 import org.junit.Test;
36 public class NetworkRpcInputEntityBuilderTest {
37 NetworkRpcInputEntityBuilder networRpcInputEntityBuilder = new NetworkRpcInputEntityBuilder();
39 DelegateExecution delegateExecution = new DelegateExecution() {
40 private String operType;
41 private String resourceType;
42 private String requestId;
45 public String getProcessInstanceId() {
50 public String getProcessBusinessKey() {
55 public String getProcessDefinitionId() {
60 public String getParentId() {
65 public String getCurrentActivityId() {
70 public String getCurrentActivityName() {
75 public String getActivityInstanceId() {
80 public String getParentActivityInstanceId() {
85 public String getCurrentTransitionId() {
90 public DelegateExecution getProcessInstance() {
95 public DelegateExecution getSuperExecution() {
100 public boolean isCanceled() {
105 public String getTenantId() {
110 public void setVariable(String s, Object o, String s1) {
115 public Incident createIncident(String s, String s1) {
120 public Incident createIncident(String s, String s1, String s2) {
125 public void resolveIncident(String s) {
130 public String getId() {
135 public String getEventName() {
140 public String getBusinessKey() {
145 public BpmnModelInstance getBpmnModelInstance() {
150 public FlowElement getBpmnModelElementInstance() {
155 public ProcessEngineServices getProcessEngineServices() {
160 public String getVariableScopeKey() {
165 public Map<String, Object> getVariables() {
170 public VariableMap getVariablesTyped() {
175 public VariableMap getVariablesTyped(boolean b) {
180 public Map<String, Object> getVariablesLocal() {
185 public VariableMap getVariablesLocalTyped() {
190 public VariableMap getVariablesLocalTyped(boolean b) {
195 public Object getVariable(String s) {
196 if (AbstractBuilder.OPERATION_TYPE.equals(s)) {
198 } else if (AbstractBuilder.RESOURCE_TYPE.equals(s)) {
200 } else if ("msoRequestId".equals(s)) {
207 public Object getVariableLocal(String s) {
212 public <T extends TypedValue> T getVariableTyped(String s) {
217 public <T extends TypedValue> T getVariableTyped(String s, boolean b) {
222 public <T extends TypedValue> T getVariableLocalTyped(String s) {
227 public <T extends TypedValue> T getVariableLocalTyped(String s, boolean b) {
232 public Set<String> getVariableNames() {
237 public Set<String> getVariableNamesLocal() {
242 public void setVariable(String s, Object o) {
243 if (AbstractBuilder.OPERATION_TYPE.equals(s)) {
244 operType = (String) o;
245 } else if (AbstractBuilder.RESOURCE_TYPE.equals(s)) {
246 resourceType = (String) o;
247 } else if ("msoRequestId".equals(s)) {
248 requestId = (String) o;
253 public void setVariableLocal(String s, Object o) {
258 public void setVariables(Map<String, ?> map) {
263 public void setVariablesLocal(Map<String, ?> map) {
268 public boolean hasVariables() {
273 public boolean hasVariablesLocal() {
278 public boolean hasVariable(String s) {
283 public boolean hasVariableLocal(String s) {
288 public void removeVariable(String s) {
293 public void removeVariableLocal(String s) {
298 public void removeVariables(Collection<String> collection) {
303 public void removeVariablesLocal(Collection<String> collection) {
308 public void removeVariables() {
313 public void removeVariablesLocal() {
318 public ProcessEngine getProcessEngine() {
319 // TODO Auto-generated method stub
324 public void setProcessBusinessKey(String arg0) {
325 // TODO Auto-generated method stub
331 public void buildTest() {
332 networRpcInputEntityBuilder.build(delegateExecution, null);