@Test public void convertSupported() { StartEvent startEvent = mock(StartEvent.class); tested.convertNode(startEvent); verify(startEventConverter).convert(startEvent); EndEvent endEvent = mock(EndEvent.class); tested.convertNode(endEvent); verify(endEventConverter).convert(endEvent); BoundaryEvent boundaryEvent = mock(BoundaryEvent.class); tested.convertNode(boundaryEvent); verify(eventConverter).convertBoundaryEvent(boundaryEvent); IntermediateCatchEvent intermediateCatchEvent = mock(IntermediateCatchEvent.class); tested.convertNode(intermediateCatchEvent); verify(eventConverter).convert(intermediateCatchEvent); IntermediateThrowEvent intermediateThrowEvent = mock(IntermediateThrowEvent.class); tested.convertNode(intermediateThrowEvent); verify(throwEventConverter).convert(intermediateThrowEvent); Task task = mock(Task.class); tested.convertNode(task); verify(taskConverter).convert(task); Gateway gateway = mock(Gateway.class); tested.convertNode(gateway); verify(gatewayConverter).convert(gateway); SubProcess subProcess = mock(SubProcess.class); tested.convertNode(subProcess); verify(subProcessConverter).convertSubProcess(subProcess); CallActivity callActivity = mock(CallActivity.class); tested.convertNode(callActivity); verify(callActivityConverter).convert(callActivity); TextAnnotation textAnnotation = mock(TextAnnotation.class); tested.convertNode(textAnnotation); verify(textAnnotationConverter).convert(textAnnotation); DataObjectReference dataObjectReference = mock(DataObjectReference.class); tested.convertNode(dataObjectReference); verify(dataObjectConverter).convert(dataObjectReference); }
public Result<BpmnNode> convertNode(FlowElement flowElement) { return Match.<FlowElement, Result<BpmnNode>>of() .<StartEvent>when(e -> e instanceof StartEvent, converterFactory.startEventConverter()::convert) .<EndEvent>when(e -> e instanceof EndEvent, converterFactory.endEventConverter()::convert) .<BoundaryEvent>when(e -> e instanceof BoundaryEvent, converterFactory.intermediateCatchEventConverter()::convertBoundaryEvent) .<IntermediateCatchEvent>when(e -> e instanceof IntermediateCatchEvent, converterFactory.intermediateCatchEventConverter()::convert) .<IntermediateThrowEvent>when(e -> e instanceof IntermediateThrowEvent, converterFactory.intermediateThrowEventConverter()::convert) .<Task>when(e -> e instanceof Task, converterFactory.taskConverter()::convert) .<Gateway>when(e -> e instanceof Gateway, converterFactory.gatewayConverter()::convert) .<SubProcess>when(e -> e instanceof SubProcess, converterFactory.subProcessConverter()::convertSubProcess) .<CallActivity>when(e -> e instanceof CallActivity, converterFactory.callActivityConverter()::convert) .<TextAnnotation>when(e -> e instanceof TextAnnotation, converterFactory.textAnnotationConverter()::convert) .<DataObjectReference>when(e -> e instanceof DataObjectReference, converterFactory.dataObjectConverter()::convert) .ignore(e -> e instanceof DataStoreReference, DataStoreReference.class) .ignore(e -> e instanceof DataObject, DataObject.class) .defaultValue(Result.ignored("FlowElement not found", getNotFoundMessage(flowElement))) .inputDecorator(BPMNElementDecorators.flowElementDecorator()) .outputDecorator(BPMNElementDecorators.resultBpmnDecorator()) .mode(getMode()) .apply(flowElement) .value(); }
FlowElementConverter extends AbstractConverter { public Result<BpmnNode> convertNode(FlowElement flowElement) { return Match.<FlowElement, Result<BpmnNode>>of() .<StartEvent>when(e -> e instanceof StartEvent, converterFactory.startEventConverter()::convert) .<EndEvent>when(e -> e instanceof EndEvent, converterFactory.endEventConverter()::convert) .<BoundaryEvent>when(e -> e instanceof BoundaryEvent, converterFactory.intermediateCatchEventConverter()::convertBoundaryEvent) .<IntermediateCatchEvent>when(e -> e instanceof IntermediateCatchEvent, converterFactory.intermediateCatchEventConverter()::convert) .<IntermediateThrowEvent>when(e -> e instanceof IntermediateThrowEvent, converterFactory.intermediateThrowEventConverter()::convert) .<Task>when(e -> e instanceof Task, converterFactory.taskConverter()::convert) .<Gateway>when(e -> e instanceof Gateway, converterFactory.gatewayConverter()::convert) .<SubProcess>when(e -> e instanceof SubProcess, converterFactory.subProcessConverter()::convertSubProcess) .<CallActivity>when(e -> e instanceof CallActivity, converterFactory.callActivityConverter()::convert) .<TextAnnotation>when(e -> e instanceof TextAnnotation, converterFactory.textAnnotationConverter()::convert) .<DataObjectReference>when(e -> e instanceof DataObjectReference, converterFactory.dataObjectConverter()::convert) .ignore(e -> e instanceof DataStoreReference, DataStoreReference.class) .ignore(e -> e instanceof DataObject, DataObject.class) .defaultValue(Result.ignored("FlowElement not found", getNotFoundMessage(flowElement))) .inputDecorator(BPMNElementDecorators.flowElementDecorator()) .outputDecorator(BPMNElementDecorators.resultBpmnDecorator()) .mode(getMode()) .apply(flowElement) .value(); } }
FlowElementConverter extends AbstractConverter { public Result<BpmnNode> convertNode(FlowElement flowElement) { return Match.<FlowElement, Result<BpmnNode>>of() .<StartEvent>when(e -> e instanceof StartEvent, converterFactory.startEventConverter()::convert) .<EndEvent>when(e -> e instanceof EndEvent, converterFactory.endEventConverter()::convert) .<BoundaryEvent>when(e -> e instanceof BoundaryEvent, converterFactory.intermediateCatchEventConverter()::convertBoundaryEvent) .<IntermediateCatchEvent>when(e -> e instanceof IntermediateCatchEvent, converterFactory.intermediateCatchEventConverter()::convert) .<IntermediateThrowEvent>when(e -> e instanceof IntermediateThrowEvent, converterFactory.intermediateThrowEventConverter()::convert) .<Task>when(e -> e instanceof Task, converterFactory.taskConverter()::convert) .<Gateway>when(e -> e instanceof Gateway, converterFactory.gatewayConverter()::convert) .<SubProcess>when(e -> e instanceof SubProcess, converterFactory.subProcessConverter()::convertSubProcess) .<CallActivity>when(e -> e instanceof CallActivity, converterFactory.callActivityConverter()::convert) .<TextAnnotation>when(e -> e instanceof TextAnnotation, converterFactory.textAnnotationConverter()::convert) .<DataObjectReference>when(e -> e instanceof DataObjectReference, converterFactory.dataObjectConverter()::convert) .ignore(e -> e instanceof DataStoreReference, DataStoreReference.class) .ignore(e -> e instanceof DataObject, DataObject.class) .defaultValue(Result.ignored("FlowElement not found", getNotFoundMessage(flowElement))) .inputDecorator(BPMNElementDecorators.flowElementDecorator()) .outputDecorator(BPMNElementDecorators.resultBpmnDecorator()) .mode(getMode()) .apply(flowElement) .value(); } FlowElementConverter(BaseConverterFactory converterFactory); }
FlowElementConverter extends AbstractConverter { public Result<BpmnNode> convertNode(FlowElement flowElement) { return Match.<FlowElement, Result<BpmnNode>>of() .<StartEvent>when(e -> e instanceof StartEvent, converterFactory.startEventConverter()::convert) .<EndEvent>when(e -> e instanceof EndEvent, converterFactory.endEventConverter()::convert) .<BoundaryEvent>when(e -> e instanceof BoundaryEvent, converterFactory.intermediateCatchEventConverter()::convertBoundaryEvent) .<IntermediateCatchEvent>when(e -> e instanceof IntermediateCatchEvent, converterFactory.intermediateCatchEventConverter()::convert) .<IntermediateThrowEvent>when(e -> e instanceof IntermediateThrowEvent, converterFactory.intermediateThrowEventConverter()::convert) .<Task>when(e -> e instanceof Task, converterFactory.taskConverter()::convert) .<Gateway>when(e -> e instanceof Gateway, converterFactory.gatewayConverter()::convert) .<SubProcess>when(e -> e instanceof SubProcess, converterFactory.subProcessConverter()::convertSubProcess) .<CallActivity>when(e -> e instanceof CallActivity, converterFactory.callActivityConverter()::convert) .<TextAnnotation>when(e -> e instanceof TextAnnotation, converterFactory.textAnnotationConverter()::convert) .<DataObjectReference>when(e -> e instanceof DataObjectReference, converterFactory.dataObjectConverter()::convert) .ignore(e -> e instanceof DataStoreReference, DataStoreReference.class) .ignore(e -> e instanceof DataObject, DataObject.class) .defaultValue(Result.ignored("FlowElement not found", getNotFoundMessage(flowElement))) .inputDecorator(BPMNElementDecorators.flowElementDecorator()) .outputDecorator(BPMNElementDecorators.resultBpmnDecorator()) .mode(getMode()) .apply(flowElement) .value(); } FlowElementConverter(BaseConverterFactory converterFactory); Result<BpmnNode> convertNode(FlowElement flowElement); }
FlowElementConverter extends AbstractConverter { public Result<BpmnNode> convertNode(FlowElement flowElement) { return Match.<FlowElement, Result<BpmnNode>>of() .<StartEvent>when(e -> e instanceof StartEvent, converterFactory.startEventConverter()::convert) .<EndEvent>when(e -> e instanceof EndEvent, converterFactory.endEventConverter()::convert) .<BoundaryEvent>when(e -> e instanceof BoundaryEvent, converterFactory.intermediateCatchEventConverter()::convertBoundaryEvent) .<IntermediateCatchEvent>when(e -> e instanceof IntermediateCatchEvent, converterFactory.intermediateCatchEventConverter()::convert) .<IntermediateThrowEvent>when(e -> e instanceof IntermediateThrowEvent, converterFactory.intermediateThrowEventConverter()::convert) .<Task>when(e -> e instanceof Task, converterFactory.taskConverter()::convert) .<Gateway>when(e -> e instanceof Gateway, converterFactory.gatewayConverter()::convert) .<SubProcess>when(e -> e instanceof SubProcess, converterFactory.subProcessConverter()::convertSubProcess) .<CallActivity>when(e -> e instanceof CallActivity, converterFactory.callActivityConverter()::convert) .<TextAnnotation>when(e -> e instanceof TextAnnotation, converterFactory.textAnnotationConverter()::convert) .<DataObjectReference>when(e -> e instanceof DataObjectReference, converterFactory.dataObjectConverter()::convert) .ignore(e -> e instanceof DataStoreReference, DataStoreReference.class) .ignore(e -> e instanceof DataObject, DataObject.class) .defaultValue(Result.ignored("FlowElement not found", getNotFoundMessage(flowElement))) .inputDecorator(BPMNElementDecorators.flowElementDecorator()) .outputDecorator(BPMNElementDecorators.resultBpmnDecorator()) .mode(getMode()) .apply(flowElement) .value(); } FlowElementConverter(BaseConverterFactory converterFactory); Result<BpmnNode> convertNode(FlowElement flowElement);  }