@Test public void testCreateNewDataTypeFromProperty() { final DataObjectProperty dataProperty = mock(DataObjectProperty.class); final String propertyName = "name"; final String propertyType = "type"; final DataType newType = mock(DataType.class); when(dataProperty.getProperty()).thenReturn(propertyName); when(dataProperty.getType()).thenReturn(propertyType); when(dataTypeManager.fromNew()).thenReturn(dataTypeManager); when(dataTypeManager.asList(anyBoolean())).thenReturn(dataTypeManager); when(dataTypeManager.withType(propertyType)).thenReturn(dataTypeManager); when(dataTypeManager.get()).thenReturn(newType); final DataType actual = dataTypeList.createNewDataType(dataProperty); assertEquals(newType, actual); verify(dataTypeManager).asList(false); verify(newType).setName(propertyName); }
DataType createNewDataType(final DataObjectProperty dataProperty) { final DataType newDataType = dataTypeManager.fromNew() .withType(dataProperty.getType()) .asList(dataProperty.isList()) .get(); newDataType.setName(dataProperty.getProperty()); return newDataType; }
DataTypeList { DataType createNewDataType(final DataObjectProperty dataProperty) { final DataType newDataType = dataTypeManager.fromNew() .withType(dataProperty.getType()) .asList(dataProperty.isList()) .get(); newDataType.setName(dataProperty.getProperty()); return newDataType; } }
DataTypeList { DataType createNewDataType(final DataObjectProperty dataProperty) { final DataType newDataType = dataTypeManager.fromNew() .withType(dataProperty.getType()) .asList(dataProperty.isList()) .get(); newDataType.setName(dataProperty.getProperty()); return newDataType; } @Inject  DataTypeList(final View view,
                        final ManagedInstance<DataTypeListItem> listItems,
                        final DataTypeManager dataTypeManager,
                        final DataTypeSearchBar searchBar,
                        final DNDListComponent dndListComponent,
                        final DataTypeStackHash dataTypeStackHash,
                        final DNDDataTypesHandler dndDataTypesHandler,
                        final DataTypeListHighlightHelper highlightHelper,
                        final IsKogito isKogito); }
DataTypeList { DataType createNewDataType(final DataObjectProperty dataProperty) { final DataType newDataType = dataTypeManager.fromNew() .withType(dataProperty.getType()) .asList(dataProperty.isList()) .get(); newDataType.setName(dataProperty.getProperty()); return newDataType; } @Inject  DataTypeList(final View view,
                        final ManagedInstance<DataTypeListItem> listItems,
                        final DataTypeManager dataTypeManager,
                        final DataTypeSearchBar searchBar,
                        final DNDListComponent dndListComponent,
                        final DataTypeStackHash dataTypeStackHash,
                        final DNDDataTypesHandler dndDataTypesHandler,
                        final DataTypeListHighlightHelper highlightHelper,
                        final IsKogito isKogito); HTMLElement getElement(); void setupItems(final List<DataType> dataTypes); Optional<DataTypeListItem> findItem(final DataType dataType); DNDListComponent getDNDListComponent(); List<DataTypeListItem> getItems(); void showNoDataTypesFound(); void showListItems(); void collapseAll(); void enableEditMode(final String dataTypeHash); void registerDataTypeListItemUpdateCallback(final Consumer<DataTypeListItem> onDataTypeListItemUpdate); Optional<DataTypeListItem> findItemByDataTypeHash(final String dataTypeHash); String calculateHash(final DataType dataType); void onDataTypeEditModeToggle(final @Observes DataTypeEditModeToggleEvent event); HTMLElement getListItems(); void importDataObjects(final List<DataObject> selectedDataObjects); void disableEditModeForChildren(final DataTypeListItem dataTypeListItem); List<String> getExistingDataTypesNames(); void highlightLevel(final DataType dataType); void highlightLevel(final Element element); void highlight(final Element element); void cleanLevelHighlightClass(); void cleanHighlightClass(); }
DataTypeList { DataType createNewDataType(final DataObjectProperty dataProperty) { final DataType newDataType = dataTypeManager.fromNew() .withType(dataProperty.getType()) .asList(dataProperty.isList()) .get(); newDataType.setName(dataProperty.getProperty()); return newDataType; } @Inject  DataTypeList(final View view,
                        final ManagedInstance<DataTypeListItem> listItems,
                        final DataTypeManager dataTypeManager,
                        final DataTypeSearchBar searchBar,
                        final DNDListComponent dndListComponent,
                        final DataTypeStackHash dataTypeStackHash,
                        final DNDDataTypesHandler dndDataTypesHandler,
                        final DataTypeListHighlightHelper highlightHelper,
                        final IsKogito isKogito); HTMLElement getElement(); void setupItems(final List<DataType> dataTypes); Optional<DataTypeListItem> findItem(final DataType dataType); DNDListComponent getDNDListComponent(); List<DataTypeListItem> getItems(); void showNoDataTypesFound(); void showListItems(); void collapseAll(); void enableEditMode(final String dataTypeHash); void registerDataTypeListItemUpdateCallback(final Consumer<DataTypeListItem> onDataTypeListItemUpdate); Optional<DataTypeListItem> findItemByDataTypeHash(final String dataTypeHash); String calculateHash(final DataType dataType); void onDataTypeEditModeToggle(final @Observes DataTypeEditModeToggleEvent event); HTMLElement getListItems(); void importDataObjects(final List<DataObject> selectedDataObjects); void disableEditModeForChildren(final DataTypeListItem dataTypeListItem); List<String> getExistingDataTypesNames(); void highlightLevel(final DataType dataType); void highlightLevel(final Element element); void highlight(final Element element); void cleanLevelHighlightClass(); void cleanHighlightClass();  }