@Test public void testSynchronizeElementsFrom() { final Node node1 = mock(Node.class); final Node node2 = mock(Node.class); final Node node3 = mock(Node.class); final List<Node> nodes = Arrays.asList(node1, node2, node3); final DRGElement drgElement = mock(DRGElement.class); final String contentDefinitionId = "id"; final DRGElement drgElement1 = mock(DRGElement.class); final DRGElement drgElement2 = mock(DRGElement.class); final DRGElement drgElement3 = mock(DRGElement.class); when(drgElement.getContentDefinitionId()).thenReturn(contentDefinitionId); doNothing().when(synchronizer).updateText(any(DRGElement.class), any(Node.class)); doReturn(nodes).when(synchronizer).getElementsWithContentId(contentDefinitionId); doReturn(drgElement1).when(synchronizer).getDRGElementFromContentDefinition(node1); doReturn(drgElement2).when(synchronizer).getDRGElementFromContentDefinition(node2); doReturn(drgElement3).when(synchronizer).getDRGElementFromContentDefinition(node3); doNothing().when(synchronizer).synchronizeBaseDRGProperties(any(DRGElement.class), any(DRGElement.class)); doNothing().when(synchronizer).synchronizeSpecializedProperties(any(DRGElement.class), any(DRGElement.class)); synchronizer.synchronizeElementsFrom(drgElement); verify(synchronizer).getElementsWithContentId(contentDefinitionId); verify(synchronizer).updateText(drgElement, node1); verify(synchronizer).updateText(drgElement, node2); verify(synchronizer).updateText(drgElement, node3); verify(synchronizer).synchronizeBaseDRGProperties(drgElement, drgElement1); verify(synchronizer).synchronizeBaseDRGProperties(drgElement, drgElement2); verify(synchronizer).synchronizeBaseDRGProperties(drgElement, drgElement3); verify(synchronizer).synchronizeSpecializedProperties(drgElement, drgElement1); verify(synchronizer).synchronizeSpecializedProperties(drgElement, drgElement2); verify(synchronizer).synchronizeSpecializedProperties(drgElement, drgElement3); verify(refreshDecisionComponentsEvent).fire(any(RefreshDecisionComponents.class)); }
public void synchronizeElementsFrom(final DRGElement drgElement) { final String contentDefinitionId = drgElement.getContentDefinitionId(); final List<Node> nodes = getElementsWithContentId(contentDefinitionId); for (final Node node : nodes) { updateText(drgElement, node); final DRGElement element = getDRGElementFromContentDefinition(node); synchronizeBaseDRGProperties(drgElement, element); synchronizeSpecializedProperties(drgElement, element); } refreshDecisionComponentsEvent.fire(new RefreshDecisionComponents()); }
DMNElementsSynchronizer { public void synchronizeElementsFrom(final DRGElement drgElement) { final String contentDefinitionId = drgElement.getContentDefinitionId(); final List<Node> nodes = getElementsWithContentId(contentDefinitionId); for (final Node node : nodes) { updateText(drgElement, node); final DRGElement element = getDRGElementFromContentDefinition(node); synchronizeBaseDRGProperties(drgElement, element); synchronizeSpecializedProperties(drgElement, element); } refreshDecisionComponentsEvent.fire(new RefreshDecisionComponents()); } }
DMNElementsSynchronizer { public void synchronizeElementsFrom(final DRGElement drgElement) { final String contentDefinitionId = drgElement.getContentDefinitionId(); final List<Node> nodes = getElementsWithContentId(contentDefinitionId); for (final Node node : nodes) { updateText(drgElement, node); final DRGElement element = getDRGElementFromContentDefinition(node); synchronizeBaseDRGProperties(drgElement, element); synchronizeSpecializedProperties(drgElement, element); } refreshDecisionComponentsEvent.fire(new RefreshDecisionComponents()); } @Inject  DMNElementsSynchronizer(final DMNDiagramsSession dmnDiagramsSession,
                                   final Event<RefreshDecisionComponents> refreshDecisionComponentsEvent,
                                   final DMNGraphUtils graphUtils,
                                   final NodeTextSetter nodeTextSetter); }
DMNElementsSynchronizer { public void synchronizeElementsFrom(final DRGElement drgElement) { final String contentDefinitionId = drgElement.getContentDefinitionId(); final List<Node> nodes = getElementsWithContentId(contentDefinitionId); for (final Node node : nodes) { updateText(drgElement, node); final DRGElement element = getDRGElementFromContentDefinition(node); synchronizeBaseDRGProperties(drgElement, element); synchronizeSpecializedProperties(drgElement, element); } refreshDecisionComponentsEvent.fire(new RefreshDecisionComponents()); } @Inject  DMNElementsSynchronizer(final DMNDiagramsSession dmnDiagramsSession,
                                   final Event<RefreshDecisionComponents> refreshDecisionComponentsEvent,
                                   final DMNGraphUtils graphUtils,
                                   final NodeTextSetter nodeTextSetter); void onExpressionEditorChanged(final @Observes ExpressionEditorChanged event); void onPropertyChanged(final @Observes FormFieldChanged event); void synchronizeElementsFrom(final DRGElement drgElement); void synchronizeFromNode(final Optional<Node> node); }
DMNElementsSynchronizer { public void synchronizeElementsFrom(final DRGElement drgElement) { final String contentDefinitionId = drgElement.getContentDefinitionId(); final List<Node> nodes = getElementsWithContentId(contentDefinitionId); for (final Node node : nodes) { updateText(drgElement, node); final DRGElement element = getDRGElementFromContentDefinition(node); synchronizeBaseDRGProperties(drgElement, element); synchronizeSpecializedProperties(drgElement, element); } refreshDecisionComponentsEvent.fire(new RefreshDecisionComponents()); } @Inject  DMNElementsSynchronizer(final DMNDiagramsSession dmnDiagramsSession,
                                   final Event<RefreshDecisionComponents> refreshDecisionComponentsEvent,
                                   final DMNGraphUtils graphUtils,
                                   final NodeTextSetter nodeTextSetter); void onExpressionEditorChanged(final @Observes ExpressionEditorChanged event); void onPropertyChanged(final @Observes FormFieldChanged event); void synchronizeElementsFrom(final DRGElement drgElement); void synchronizeFromNode(final Optional<Node> node);  }