@Test public void testCreateDecisionComponentItems() { final List<DecisionComponent> decisionComponentsItems = new ArrayList<>(); decisionComponentsItems.add(makeDecisionComponent("Decision-1", "uuid1", "ModelName", false)); decisionComponentsItems.add(makeDecisionComponent("Decision-1", "uuid1", "ModelName", false)); decisionComponentsItems.add(makeDecisionComponent("Decision-1", "uuid2", "ModelName", false)); decisionComponentsItems.add(makeDecisionComponent("included.Decision-2", "uuidA", "included.dmn", true)); decisionComponentsItems.add(makeDecisionComponent("included.Decision-2", "uuidA", "included.dmn", true)); decisionComponentsItems.add(makeDecisionComponent("included.Decision-2", "uuidB", "included.dmn", true)); when(itemManagedInstance.get()).then((e) -> new DecisionComponentsItem(decisionComponentsItemView)); decisionComponents.createDecisionComponentItems(decisionComponentsItems); verify(decisionComponents, times(4)).createDecisionComponentItem(decisionComponentArgumentCaptor.capture()); final List<DecisionComponent> createdDecisionComponents = decisionComponentArgumentCaptor.getAllValues(); assertEquals("uuid1", createdDecisionComponents.get(0).getDrgElement().getId().getValue()); assertEquals("uuid2", createdDecisionComponents.get(1).getDrgElement().getId().getValue()); assertEquals("uuidA", createdDecisionComponents.get(2).getDrgElement().getId().getValue()); assertEquals("uuidB", createdDecisionComponents.get(3).getDrgElement().getId().getValue()); }
void createDecisionComponentItems(final List<DecisionComponent> decisionComponents) { for (final DecisionComponent component : decisionComponents) { if (!isDRGElementAdded(component)) { createDecisionComponentItem(component); } } }
DecisionComponents { void createDecisionComponentItems(final List<DecisionComponent> decisionComponents) { for (final DecisionComponent component : decisionComponents) { if (!isDRGElementAdded(component)) { createDecisionComponentItem(component); } } } }
DecisionComponents { void createDecisionComponentItems(final List<DecisionComponent> decisionComponents) { for (final DecisionComponent component : decisionComponents) { if (!isDRGElementAdded(component)) { createDecisionComponentItem(component); } } } DecisionComponents(); @Inject  DecisionComponents(final View view,
                              final DMNIncludeModelsClient client,
                              final ManagedInstance<DecisionComponentsItem> itemManagedInstance,
                              final DecisionComponentFilter filter,
                              final DMNDiagramsSession dmnDiagramsSession,
                              final DMNGraphUtils dmnGraphUtils); }
DecisionComponents { void createDecisionComponentItems(final List<DecisionComponent> decisionComponents) { for (final DecisionComponent component : decisionComponents) { if (!isDRGElementAdded(component)) { createDecisionComponentItem(component); } } } 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 createDecisionComponentItems(final List<DecisionComponent> decisionComponents) { for (final DecisionComponent component : decisionComponents) { if (!isDRGElementAdded(component)) { createDecisionComponentItem(component); } } } 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();  }