@Test public void convertTextAnnotation() { TextAnnotation element = Bpmn2Factory.eINSTANCE.createTextAnnotation(); when(typedFactoryManager.newNode(anyString(), eq(org.kie.workbench.common.stunner.bpmn.definition.TextAnnotation.class))).thenReturn(nodeTextAnnotation); when(nodeTextAnnotation.getContent()).thenReturn(contentTextAnnotation); when(contentTextAnnotation.getDefinition()).thenReturn(defTextAnnotation); when(propertyReaderFactory.of(element)).thenReturn(readerTextAnnotation); final Result<BpmnNode> node = tested.convert(element); final Node<? extends View<? extends BPMNViewDefinition>, ?> value = node.value().value(); assertEquals(contentTextAnnotation, value.getContent()); assertEquals(defTextAnnotation, value.getContent().getDefinition()); }
@Override public Result<BpmnNode> convert(org.eclipse.bpmn2.FlowElement element) { return Match.of(FlowElement.class, BpmnNode.class) .when(org.eclipse.bpmn2.TextAnnotation.class, this::toTextAnnotation) .when(org.eclipse.bpmn2.DataObjectReference.class, this::toDataObject) .apply(element); }
ArtifactsConverter implements NodeConverter<org.eclipse.bpmn2.FlowElement> { @Override public Result<BpmnNode> convert(org.eclipse.bpmn2.FlowElement element) { return Match.of(FlowElement.class, BpmnNode.class) .when(org.eclipse.bpmn2.TextAnnotation.class, this::toTextAnnotation) .when(org.eclipse.bpmn2.DataObjectReference.class, this::toDataObject) .apply(element); } }
ArtifactsConverter implements NodeConverter<org.eclipse.bpmn2.FlowElement> { @Override public Result<BpmnNode> convert(org.eclipse.bpmn2.FlowElement element) { return Match.of(FlowElement.class, BpmnNode.class) .when(org.eclipse.bpmn2.TextAnnotation.class, this::toTextAnnotation) .when(org.eclipse.bpmn2.DataObjectReference.class, this::toDataObject) .apply(element); } ArtifactsConverter(TypedFactoryManager typedFactoryManager, PropertyReaderFactory propertyReaderFactory); }
ArtifactsConverter implements NodeConverter<org.eclipse.bpmn2.FlowElement> { @Override public Result<BpmnNode> convert(org.eclipse.bpmn2.FlowElement element) { return Match.of(FlowElement.class, BpmnNode.class) .when(org.eclipse.bpmn2.TextAnnotation.class, this::toTextAnnotation) .when(org.eclipse.bpmn2.DataObjectReference.class, this::toDataObject) .apply(element); } ArtifactsConverter(TypedFactoryManager typedFactoryManager, PropertyReaderFactory propertyReaderFactory); @Override Result<BpmnNode> convert(org.eclipse.bpmn2.FlowElement element); }
ArtifactsConverter implements NodeConverter<org.eclipse.bpmn2.FlowElement> { @Override public Result<BpmnNode> convert(org.eclipse.bpmn2.FlowElement element) { return Match.of(FlowElement.class, BpmnNode.class) .when(org.eclipse.bpmn2.TextAnnotation.class, this::toTextAnnotation) .when(org.eclipse.bpmn2.DataObjectReference.class, this::toDataObject) .apply(element); } ArtifactsConverter(TypedFactoryManager typedFactoryManager, PropertyReaderFactory propertyReaderFactory); @Override Result<BpmnNode> convert(org.eclipse.bpmn2.FlowElement element);  }