@Test public void testItemDefinitions() { final Definitions definitions = mock(Definitions.class); final ItemDefinition itemDefinition = makeItemDefinition(); final List<ItemDefinition> expectedItemDefinitions = singletonList(itemDefinition); when(dmnGraphUtils.getModelDefinitions()).thenReturn(definitions); when(definitions.getItemDefinition()).thenReturn(expectedItemDefinitions); final List<ItemDefinition> actualItemDefinitions = handler.itemDefinitions(); assertEquals(expectedItemDefinitions, actualItemDefinitions); }
List<ItemDefinition> itemDefinitions() { final Optional<Definitions> definitions = Optional.ofNullable(dmnGraphUtils.getModelDefinitions()); if (definitions.isPresent()) { return definitions.get().getItemDefinition(); } return new ArrayList<>(); }
ItemDefinitionDestroyHandler { List<ItemDefinition> itemDefinitions() { final Optional<Definitions> definitions = Optional.ofNullable(dmnGraphUtils.getModelDefinitions()); if (definitions.isPresent()) { return definitions.get().getItemDefinition(); } return new ArrayList<>(); } }
ItemDefinitionDestroyHandler { List<ItemDefinition> itemDefinitions() { final Optional<Definitions> definitions = Optional.ofNullable(dmnGraphUtils.getModelDefinitions()); if (definitions.isPresent()) { return definitions.get().getItemDefinition(); } return new ArrayList<>(); } @Inject  ItemDefinitionDestroyHandler(final ItemDefinitionStore itemDefinitionStore,
                                        final DMNGraphUtils dmnGraphUtils,
                                        final PropertiesPanelNotifier panelNotifier); }
ItemDefinitionDestroyHandler { List<ItemDefinition> itemDefinitions() { final Optional<Definitions> definitions = Optional.ofNullable(dmnGraphUtils.getModelDefinitions()); if (definitions.isPresent()) { return definitions.get().getItemDefinition(); } return new ArrayList<>(); } @Inject  ItemDefinitionDestroyHandler(final ItemDefinitionStore itemDefinitionStore,
                                        final DMNGraphUtils dmnGraphUtils,
                                        final PropertiesPanelNotifier panelNotifier); void destroy(final DataType dataType, final boolean notifyPropertiesPanel); }
ItemDefinitionDestroyHandler { List<ItemDefinition> itemDefinitions() { final Optional<Definitions> definitions = Optional.ofNullable(dmnGraphUtils.getModelDefinitions()); if (definitions.isPresent()) { return definitions.get().getItemDefinition(); } return new ArrayList<>(); } @Inject  ItemDefinitionDestroyHandler(final ItemDefinitionStore itemDefinitionStore,
                                        final DMNGraphUtils dmnGraphUtils,
                                        final PropertiesPanelNotifier panelNotifier); void destroy(final DataType dataType, final boolean notifyPropertiesPanel);  }