2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018 Huawei 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=========================================================
20 package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.builder;
22 import org.camunda.bpm.engine.ProcessEngineServices;
23 import org.camunda.bpm.engine.delegate.DelegateExecution;
24 import org.camunda.bpm.engine.runtime.Incident;
25 import org.camunda.bpm.engine.variable.VariableMap;
26 import org.camunda.bpm.engine.variable.value.TypedValue;
27 import org.camunda.bpm.model.bpmn.BpmnModelInstance;
28 import org.camunda.bpm.model.bpmn.instance.FlowElement;
29 import org.junit.Test;
31 import java.util.Collection;
32 import java.util.HashMap;
36 public class AbstractBuilderTest {
38 AbstractBuilder abstractBuilder = new AbstractBuilder() {
40 Object build(DelegateExecution execution, Object input) throws Exception {
45 DelegateExecution delegateExecution = new DelegateExecution() {
47 public String getProcessInstanceId() {
52 public String getProcessBusinessKey() {
57 public String getProcessDefinitionId() {
62 public String getParentId() {
67 public String getCurrentActivityId() {
72 public String getCurrentActivityName() {
77 public String getActivityInstanceId() {
82 public String getParentActivityInstanceId() {
87 public String getCurrentTransitionId() {
92 public DelegateExecution getProcessInstance() {
97 public DelegateExecution getSuperExecution() {
102 public boolean isCanceled() {
107 public String getTenantId() {
112 public void setVariable(String s, Object o, String s1) {
117 public Incident createIncident(String s, String s1) {
122 public Incident createIncident(String s, String s1, String s2) {
127 public void resolveIncident(String s) {
132 public String getId() {
137 public String getEventName() {
142 public String getBusinessKey() {
147 public BpmnModelInstance getBpmnModelInstance() {
152 public FlowElement getBpmnModelElementInstance() {
157 public ProcessEngineServices getProcessEngineServices() {
162 public String getVariableScopeKey() {
167 public Map<String, Object> getVariables() {
172 public VariableMap getVariablesTyped() {
177 public VariableMap getVariablesTyped(boolean b) {
182 public Map<String, Object> getVariablesLocal() {
187 public VariableMap getVariablesLocalTyped() {
192 public VariableMap getVariablesLocalTyped(boolean b) {
197 public Object getVariable(String s) {
202 public Object getVariableLocal(String s) {
207 public <T extends TypedValue> T getVariableTyped(String s) {
212 public <T extends TypedValue> T getVariableTyped(String s, boolean b) {
217 public <T extends TypedValue> T getVariableLocalTyped(String s) {
222 public <T extends TypedValue> T getVariableLocalTyped(String s, boolean b) {
227 public Set<String> getVariableNames() {
232 public Set<String> getVariableNamesLocal() {
237 public void setVariable(String s, Object o) {
242 public void setVariableLocal(String s, Object o) {
247 public void setVariables(Map<String, ?> map) {
252 public void setVariablesLocal(Map<String, ?> map) {
257 public boolean hasVariables() {
262 public boolean hasVariablesLocal() {
267 public boolean hasVariable(String s) {
272 public boolean hasVariableLocal(String s) {
277 public void removeVariable(String s) {
282 public void removeVariableLocal(String s) {
287 public void removeVariables(Collection<String> collection) {
292 public void removeVariablesLocal(Collection<String> collection) {
297 public void removeVariables() {
302 public void removeVariablesLocal() {
309 public void buildTest() throws Exception {
310 abstractBuilder.build(null, null);
314 public void getRequestActoinTest() throws Exception {
315 abstractBuilder.getRequestActoin(delegateExecution);
319 public void getSvcActionTest() throws Exception {
320 abstractBuilder.getSvcAction(delegateExecution);
324 public void getRequestIdTest() throws Exception {
325 abstractBuilder.getRequestId(delegateExecution);
329 public void getOnapServiceModelInformationEntityTest() throws Exception {
330 abstractBuilder.getOnapServiceModelInformationEntity(delegateExecution);
334 public void getOnapNetworkModelInformationEntityTest() throws Exception {
335 abstractBuilder.getOnapNetworkModelInformationEntity(delegateExecution);
339 public void getParamEntitiesTest() throws Exception {
340 abstractBuilder.getParamEntities(new HashMap<>());
344 public void getRequestInformationEntityTest() throws Exception {
345 abstractBuilder.getRequestInformationEntity(delegateExecution);
349 public void getServiceInformationEntityTest() throws Exception {
350 abstractBuilder.getServiceInformationEntity(delegateExecution);
354 public void getServiceInstanceNameTest() throws Exception {
355 abstractBuilder.getServiceInstanceName(delegateExecution);