@Test public void testCreateDecisionComponentItem() { final DecisionComponentsItem item = mock(DecisionComponentsItem.class); final List<DecisionComponentsItem> decisionComponentsItems = spy(new ArrayList<>()); final DecisionComponentsItem.View decisionComponentsView = mock(DecisionComponentsItem.View.class); final HTMLElement htmlElement = mock(HTMLElement.class); final DecisionComponent component = mock(DecisionComponent.class); when(decisionComponentsView.getElement()).thenReturn(htmlElement); when(itemManagedInstance.get()).thenReturn(item); when(item.getView()).thenReturn(decisionComponentsView); doReturn(decisionComponentsItems).when(decisionComponents).getDecisionComponentsItems(); decisionComponents.createDecisionComponentItem(component); verify(item).setDecisionComponent(any(DecisionComponent.class)); verify(decisionComponentsItems).add(item); verify(view).addListItem(htmlElement); }
void createDecisionComponentItem(final DecisionComponent component) { final DecisionComponentsItem item = itemManagedInstance.get(); item.setDecisionComponent(component); getDecisionComponentsItems().add(item); view.addListItem(item.getView().getElement()); }
DecisionComponents { void createDecisionComponentItem(final DecisionComponent component) { final DecisionComponentsItem item = itemManagedInstance.get(); item.setDecisionComponent(component); getDecisionComponentsItems().add(item); view.addListItem(item.getView().getElement()); } }
DecisionComponents { void createDecisionComponentItem(final DecisionComponent component) { final DecisionComponentsItem item = itemManagedInstance.get(); item.setDecisionComponent(component); getDecisionComponentsItems().add(item); view.addListItem(item.getView().getElement()); } DecisionComponents(); @Inject  DecisionComponents(final View view,
                              final DMNIncludeModelsClient client,
                              final ManagedInstance<DecisionComponentsItem> itemManagedInstance,
                              final DecisionComponentFilter filter,
                              final DMNDiagramsSession dmnDiagramsSession,
                              final DMNGraphUtils dmnGraphUtils); }
DecisionComponents { void createDecisionComponentItem(final DecisionComponent component) { final DecisionComponentsItem item = itemManagedInstance.get(); item.setDecisionComponent(component); getDecisionComponentsItems().add(item); view.addListItem(item.getView().getElement()); } DecisionComponents(); @Inject  DecisionComponents(final View view,
                              final DMNIncludeModelsClient client,
                              final ManagedInstance<DecisionComponentsItem> itemManagedInstance,
                              final DecisionComponentFilter filter,
                              final DMNDiagramsSession dmnDiagramsSession,
                              final DMNGraphUtils dmnGraphUtils); @PostConstruct void init(); View getView(); void refresh(); void removeAllItems(); }
DecisionComponents { void createDecisionComponentItem(final DecisionComponent component) { final DecisionComponentsItem item = itemManagedInstance.get(); item.setDecisionComponent(component); getDecisionComponentsItems().add(item); view.addListItem(item.getView().getElement()); } DecisionComponents(); @Inject  DecisionComponents(final View view,
                              final DMNIncludeModelsClient client,
                              final ManagedInstance<DecisionComponentsItem> itemManagedInstance,
                              final DecisionComponentFilter filter,
                              final DMNDiagramsSession dmnDiagramsSession,
                              final DMNGraphUtils dmnGraphUtils); @PostConstruct void init(); View getView(); void refresh(); void removeAllItems();  }