@Test public void toTextAnnotationElement() { textAnnotation = new TextAnnotation(); textAnnotation.getGeneral().getDocumentation().setValue(DOC); textAnnotation.getGeneral().getName().setValue(NAME); textAnnotationNode = new NodeImpl<>(UUID.uuid()); textAnnotationNode.setContent(textAnnotationView); when(textAnnotationView.getDefinition()).thenReturn(textAnnotation); when(propertyWriterFactory.of(any(org.eclipse.bpmn2.TextAnnotation.class))).thenReturn(textAnnotationWriter); artifactsConverter = new ArtifactsConverter(propertyWriterFactory); PropertyWriter propertyWriter = artifactsConverter.toElement(((NodeImpl) textAnnotationNode)); verify(textAnnotationWriter).setName(NAME); verify(textAnnotationWriter).setDocumentation(DOC); verify(textAnnotationWriter).setAbsoluteBounds(textAnnotationNode); assertEquals(textAnnotationWriter, propertyWriter); }
public PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node) { return NodeMatch.fromNode(BaseArtifacts.class, PropertyWriter.class) .when(TextAnnotation.class, this::toTextAnnotation) .when(DataObject.class, this::toDataObjectAnnotation) .ignore(Object.class) .apply(node) .value(); }
ArtifactsConverter { public PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node) { return NodeMatch.fromNode(BaseArtifacts.class, PropertyWriter.class) .when(TextAnnotation.class, this::toTextAnnotation) .when(DataObject.class, this::toDataObjectAnnotation) .ignore(Object.class) .apply(node) .value(); } }
ArtifactsConverter { public PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node) { return NodeMatch.fromNode(BaseArtifacts.class, PropertyWriter.class) .when(TextAnnotation.class, this::toTextAnnotation) .when(DataObject.class, this::toDataObjectAnnotation) .ignore(Object.class) .apply(node) .value(); } ArtifactsConverter(PropertyWriterFactory propertyWriterFactory); }
ArtifactsConverter { public PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node) { return NodeMatch.fromNode(BaseArtifacts.class, PropertyWriter.class) .when(TextAnnotation.class, this::toTextAnnotation) .when(DataObject.class, this::toDataObjectAnnotation) .ignore(Object.class) .apply(node) .value(); } ArtifactsConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node); }
ArtifactsConverter { public PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node) { return NodeMatch.fromNode(BaseArtifacts.class, PropertyWriter.class) .when(TextAnnotation.class, this::toTextAnnotation) .when(DataObject.class, this::toDataObjectAnnotation) .ignore(Object.class) .apply(node) .value(); } ArtifactsConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node);  }