@Before public void setupMocks() { when(presenter.getDataProvider()).thenReturn(dataProviderMock); when(pagedTableMock.getColumnSortList()).thenReturn(new ColumnSortList()); }
@Before public void setup() { processRuntimeDataServiceCaller = new CallerMock<ProcessRuntimeDataService>(processRuntimeDataService); presenter.setProcessRuntimeDataService(processRuntimeDataServiceCaller); when(view.getListGrid()).thenReturn(extendedPagedTable); when(extendedPagedTable.getColumnSortList()).thenReturn(new ColumnSortList()); when(perspectiveManager.getCurrentPerspective()).thenReturn(perspectiveActivity); when(perspectiveActivity.getIdentifier()).thenReturn(PERSPECTIVE_ID); commonConstants = org.jbpm.workbench.common.client.resources.i18n.Constants.INSTANCE; }
@Test public void testDataStoreNameIsSet() { doAnswer(new Answer() { @Override public Void answer(InvocationOnMock invocationOnMock) throws Throwable { final List<ColumnMeta> columns = (List<ColumnMeta>) invocationOnMock.getArguments()[0]; for (ColumnMeta columnMeta : columns) { assertNotNull(columnMeta.getColumn().getDataStoreName()); } return null; } }).when(currentListGrid).addColumns(anyList()); when(currentListGrid.getColumnSortList()).thenReturn(new ColumnSortList()); view.initColumns(currentListGrid); verify(currentListGrid).addColumns(anyList()); }