@Test public void testDeleteKeepingReferences() { final DataType existing = mock(DataType.class); final DataTypeListItem dtListItem = mock(DataTypeListItem.class); final Optional<DataTypeListItem> item = Optional.of(dtListItem); when(dataTypeList.findItem(existing)).thenReturn(item); handler.deleteKeepingReferences(existing); verify(dtListItem).destroyWithoutDependentTypes(); }
public void deleteKeepingReferences(final DataType existing) { final Optional<DataTypeListItem> currentItem = getDataTypeList().findItem(existing); currentItem.ifPresent(item -> { item.destroyWithoutDependentTypes(); }); }
DNDDataTypesHandler { public void deleteKeepingReferences(final DataType existing) { final Optional<DataTypeListItem> currentItem = getDataTypeList().findItem(existing); currentItem.ifPresent(item -> { item.destroyWithoutDependentTypes(); }); } }
DNDDataTypesHandler { public void deleteKeepingReferences(final DataType existing) { final Optional<DataTypeListItem> currentItem = getDataTypeList().findItem(existing); currentItem.ifPresent(item -> { item.destroyWithoutDependentTypes(); }); } @Inject  DNDDataTypesHandler(final DataTypeStore dataTypeStore,
                               final DataTypeManager dataTypeManager,
                               final ItemDefinitionStore itemDefinitionStore); }
DNDDataTypesHandler { public void deleteKeepingReferences(final DataType existing) { final Optional<DataTypeListItem> currentItem = getDataTypeList().findItem(existing); currentItem.ifPresent(item -> { item.destroyWithoutDependentTypes(); }); } @Inject  DNDDataTypesHandler(final DataTypeStore dataTypeStore,
                               final DataTypeManager dataTypeManager,
                               final ItemDefinitionStore itemDefinitionStore); void init(final DataTypeList dataTypeList); void onDropDataType(final Element currentElement,
                               final Element hoverElement); void deleteKeepingReferences(final DataType existing); }
DNDDataTypesHandler { public void deleteKeepingReferences(final DataType existing) { final Optional<DataTypeListItem> currentItem = getDataTypeList().findItem(existing); currentItem.ifPresent(item -> { item.destroyWithoutDependentTypes(); }); } @Inject  DNDDataTypesHandler(final DataTypeStore dataTypeStore,
                               final DataTypeManager dataTypeManager,
                               final ItemDefinitionStore itemDefinitionStore); void init(final DataTypeList dataTypeList); void onDropDataType(final Element currentElement,
                               final Element hoverElement); void deleteKeepingReferences(final DataType existing);  }