RequestListPresenter extends AbstractMultiGridPresenter<RequestSummary, RequestListPresenter.RequestListView> { protected RequestSummary getRequestSummary(final DataSet dataSet, final Integer index) { return new RequestSummary( getColumnLongValue(dataSet, COLUMN_ID, index), getColumnDateValue(dataSet, COLUMN_TIMESTAMP, index), RequestStatus.valueOf(getColumnStringValue(dataSet, COLUMN_STATUS, index)), getColumnStringValue(dataSet, COLUMN_COMMANDNAME, index), getColumnStringValue(dataSet, COLUMN_MESSAGE, index), getColumnStringValue(dataSet, COLUMN_BUSINESSKEY, index), getColumnIntValue(dataSet, COLUMN_RETRIES, index), getColumnIntValue(dataSet, COLUMN_EXECUTIONS, index), getColumnStringValue(dataSet, COLUMN_PROCESS_NAME, index), getColumnLongValue(dataSet, COLUMN_PROCESS_INSTANCE_ID, index), getColumnStringValue(dataSet, COLUMN_PROCESS_INSTANCE_DESCRIPTION, index), getColumnStringValue(dataSet, COLUMN_JOB_DEPLOYMENT_ID, index) ); } RequestListPresenter();  RequestListPresenter(RequestListViewImpl view,
                                Caller<ExecutorService> executorServices,
                                DataSetQueryHelper dataSetQueryHelper,
                                Event<RequestChangedEvent> requestChangedEvent,
                                Event<JobSelectedEvent> jobSelectedEvent,
                                PlaceManager placeManager); @Inject void setFilterSettingsManager(final JobListFilterSettingsManager filterSettingsManager); @Override void createListBreadcrumb(); void setupDetailBreadcrumb(String detailLabel); void cancelRequest(final String deploymentId,
                              final Long requestId); void requeueRequest(final String deploymentId,
                               final Long requestId); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); @Override void selectSummaryItem(final RequestSummary job); void requestCreated(@Observes RequestChangedEvent event); @Override void setupActiveSearchFilters(); @Override boolean existActiveSearchFilters(); @Override ActiveFilterItem getActiveFilterFromColumnFilter(ColumnFilter columnFilter); String getStatusColumnFilterDescription(ColumnFilter columnFilter); void openProcessInstanceView(final String processInstanceId); Predicate<RequestSummary> getCancelActionCondition(); Predicate<RequestSummary> getRequeueActionCondition(); Predicate<RequestSummary> getViewProcessActionCondition(); void bulkCancel(List<RequestSummary> jobsSelected); void bulkRequeue(List<RequestSummary> jobsSelected);  }
@Test public void testGetRequestSummary() { final Long id = 1l; final String message = "message"; final String status = "DONE"; final String commandName = "commandName"; final String businessKey = "businessKey"; final Integer retries = 2; final Integer executions = 1; final Date time = new Date(); final String processName = "myProcessName"; final Long processInstanceId = Long.valueOf(33); final String processInstanceDescription = "myProcessInstanceDescription"; final String deploymentId = "test"; final DataSet dataSet = mock(DataSet.class); when(dataSet.getValueAt(0, COLUMN_ID)).thenReturn(id); when(dataSet.getValueAt(0, COLUMN_TIMESTAMP)).thenReturn(time); when(dataSet.getValueAt(0, COLUMN_STATUS)).thenReturn(status); when(dataSet.getValueAt(0, COLUMN_COMMANDNAME)).thenReturn(commandName); when(dataSet.getValueAt(0, COLUMN_MESSAGE)).thenReturn(message); when(dataSet.getValueAt(0, COLUMN_BUSINESSKEY)).thenReturn(businessKey); when(dataSet.getValueAt(0, COLUMN_RETRIES)).thenReturn(retries); when(dataSet.getValueAt(0, COLUMN_EXECUTIONS)).thenReturn(executions); when(dataSet.getValueAt(0, COLUMN_PROCESS_NAME)).thenReturn(processName); when(dataSet.getValueAt(0, COLUMN_PROCESS_INSTANCE_ID)).thenReturn(processInstanceId); when(dataSet.getValueAt(0, COLUMN_PROCESS_INSTANCE_DESCRIPTION)).thenReturn(processInstanceDescription); when(dataSet.getValueAt(0, COLUMN_JOB_DEPLOYMENT_ID)).thenReturn(deploymentId); final RequestSummary rs = presenter.getRequestSummary(dataSet, 0); assertEquals(id, rs.getId()); assertEquals(time, rs.getTime()); assertEquals(RequestStatus.DONE, rs.getStatus()); assertEquals(commandName, rs.getCommandName()); assertEquals(message, rs.getMessage()); assertEquals(businessKey, rs.getKey()); assertEquals(retries, rs.getRetries()); assertEquals(executions, rs.getExecutions()); assertEquals(processName, rs.getProcessName()); assertEquals(processInstanceId, rs.getProcessInstanceId()); assertEquals(processInstanceDescription, rs.getProcessInstanceDescription()); assertEquals(deploymentId, rs.getDeploymentId()); }