TableDisplayerView extends AbstractGwtDisplayerView<TableDisplayer> implements TableDisplayer.View { @Override public void createTable(int pageSize, FilterLabelSet filterLabelSet) { table = new PagedTable<>(pageSize); table.pageSizesSelector.setVisible(false); table.setEmptyTableCaption(TableConstants.INSTANCE.tableDisplayer_noDataAvailable()); table.pageSizesSelector.setForceDropup(true); table.pageSizesSelector.setDropupAuto(false); tableProvider.addDataDisplay(table); tableProvider.lastPageSize = pageSize; HTMLElement element = filterLabelSet.getElement(); element.getStyle().setProperty("margin-bottom", "5px"); table.getLeftToolbar().add(ElementWrapperWidget.getWidget(filterLabelSet.getElement())); exportToCsvButton = new Button("", IconType.FILE_TEXT, e -> getPresenter().export(ExportFormat.CSV)); exportToXlsButton = new Button("", IconType.FILE_EXCEL_O, e -> getPresenter().export(ExportFormat.XLS)); exportToCsvButton.setTitle(TableConstants.INSTANCE.tableDisplayer_export_to_csv()); exportToXlsButton.setTitle(TableConstants.INSTANCE.tableDisplayer_export_to_xls()); setupToolbar(); rootPanel.add(table); }  @Override void init(TableDisplayer presenter); @Override void showTitle(String title); @Override String getGroupsTitle(); @Override String getColumnsTitle(); @Override void createTable(int pageSize, FilterLabelSet filterLabelSet); @Override void redrawTable(); @Override void setWidth(int width); @Override void setSortEnabled(boolean enabled); @Override void setTotalRows(int rows, boolean isExact); @Override void setPagerEnabled(boolean enabled); @Override void setColumnPickerEnabled(boolean enabled); @Override void setExportToCsvEnabled(boolean enabled); @Override void setExportToXlsEnabled(boolean enabled); @Override void addColumn(ColumnType columnType, String columnId, String columnName, int index, boolean selectEnabled, boolean sortEnabled); @Override void gotoFirstPage(); @Override int getLastOffset(); @Override int getPageSize(); @Override void exportNoData(); @Override void exportTooManyRows(int rowNum, int limit); @Override void exportFileUrl(String url);  }
@Test public void testCreateTable() { final HasWidgets hasWidgets = mock(HasWidgets.class); when(table.getRightToolbar()).thenReturn(hasWidgets); tableDisplayerView.setupToolbar(); verify(hasWidgets, times(2)).add(any()); }