TaskAdminListViewImpl extends AbstractTaskListView<TaskAdminListPresenter> { @Override public void initColumns(ListTable<TaskSummary> extendedPagedTable) { super.initColumns(extendedPagedTable); Optional<ColumnMeta<TaskSummary>> errorCountColumn = extendedPagedTable.getColumnMetaList().stream().filter(c -> COLUMN_ERROR_COUNT.equals(c.getColumn().getDataStoreName())).findFirst(); if (errorCountColumn.isPresent()) { extendedPagedTable.setColumnWidth(errorCountColumn.get().getColumn(), ERROR_COLUMN_WIDTH, Style.Unit.PX); } }  @Override List<String> getInitColumns(); @Override void initColumns(ListTable<TaskSummary> extendedPagedTable);  }
@Test public void initColumnsWithTaskVarColumnsTest() { final ListTable<TaskSummary> currentListGrid = spy(new ListTable<>(new GridGlobalPreferences())); doAnswer(new Answer() { @Override public Void answer(InvocationOnMock invocationOnMock) throws Throwable { final List<ColumnMeta> columns = (List<ColumnMeta>) invocationOnMock.getArguments()[0]; assertEquals(22, columns.size()); return null; } }).when(currentListGrid).addColumns(anyList()); ArrayList<GridColumnPreference> columnPreferences = new ArrayList<GridColumnPreference>(); columnPreferences.add(new GridColumnPreference("var1", 0, "40")); columnPreferences.add(new GridColumnPreference("var2", 1, "40")); columnPreferences.add(new GridColumnPreference("var3", 1, "40")); when(currentListGrid.getGridPreferencesStore()).thenReturn(gridPreferencesStore); when(gridPreferencesStore.getColumnPreferences()).thenReturn(columnPreferences); getView().initColumns(currentListGrid); verify(currentListGrid).addColumns(anyList()); }