ServiceTaskParseHandler extends AbstractActivityBpmnParseHandler<ServiceTask> { protected void executeParse(BpmnParse bpmnParse, ServiceTask serviceTask) { if (StringUtils.isNotEmpty(serviceTask.getType())) { createActivityBehaviorForServiceTaskType(bpmnParse, serviceTask); } else if (ImplementationType.IMPLEMENTATION_TYPE_CLASS.equalsIgnoreCase(serviceTask.getImplementationType())) { createClassDelegateServiceTask(bpmnParse, serviceTask); } else if (ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION.equalsIgnoreCase(serviceTask.getImplementationType())) { createServiceTaskDelegateExpressionActivityBehavior(bpmnParse, serviceTask); } else if (ImplementationType.IMPLEMENTATION_TYPE_EXPRESSION.equalsIgnoreCase(serviceTask.getImplementationType())) { createServiceTaskExpressionActivityBehavior(bpmnParse, serviceTask); } else if (ImplementationType.IMPLEMENTATION_TYPE_WEBSERVICE.equalsIgnoreCase(serviceTask.getImplementationType()) && StringUtils.isNotEmpty(serviceTask.getOperationRef())) { createWebServiceActivityBehavior(bpmnParse, serviceTask); } else { createDefaultServiceTaskActivityBehavior(bpmnParse, serviceTask); } }  Class<? extends BaseElement> getHandledType();  }
@Test public void executeParseShouldUseDefaultBehaviorWhenNoInformationIsProvided() throws Exception { ServiceTask serviceTask = new ServiceTask(); ServiceTaskDelegateExpressionActivityBehavior defaultBehavior = mock(ServiceTaskDelegateExpressionActivityBehavior.class); given(activityBehaviorFactory.createDefaultServiceTaskBehavior(serviceTask)).willReturn(defaultBehavior); serviceTaskParseHandler.executeParse(bpmnParse, serviceTask); assertThat(serviceTask.getBehavior()).isEqualTo(defaultBehavior); }