ProcessVariableListPresenter extends AbstractListPresenter<ProcessVariableSummary> implements ProcessInstanceSummaryAware { public void loadVariableHistory(final ParameterizedCommand<List<ProcessVariableSummary>> callback, final String variableName) { variablesServices.call(new RemoteCallback<List<ProcessVariableSummary>>() { @Override public void callback(final List<ProcessVariableSummary> processVariableSummaries) { callback.execute(processVariableSummaries); } }, new HasBusyIndicatorDefaultErrorCallback(view)).getVariableHistory(processInstance.getProcessInstanceKey(), variableName); } @Inject  ProcessVariableListPresenter(final ProcessVariableListView view,
                                        final Caller<ProcessVariablesService> variablesServices); @PostConstruct void init(); IsWidget getWidget(); @Override void setProcessInstance(ProcessInstanceSummary processInstance); int getProcessInstanceStatus(); void loadVariableHistory(final ParameterizedCommand<List<ProcessVariableSummary>> callback,
                                    final String variableName); @Override void getData(Range visibleRange);  }
@Test public void testLoadVariableHistory() { final ParameterizedCommand callback = mock(ParameterizedCommand.class); final String variableName = "variable"; final String deploymentId = "deploymentId"; final long processInstanceId = 1l; final ProcessInstanceSummary processInstance = ProcessInstanceSummary.builder() .withServerTemplateId("serverTemplateIdTest") .withDeploymentId(deploymentId) .withProcessInstanceId(processInstanceId) .build(); final ProcessVariableSummary summary = new ProcessVariableSummary(variableName, "variableInstanceId", processInstanceId, "oldValue", "newValue", System.currentTimeMillis(), "type"); final List<ProcessVariableSummary> summaries = Arrays.asList(summary); when(processVariablesService.getVariableHistory(eq(processInstance.getProcessInstanceKey()), eq(variableName))).thenReturn(summaries); when(view.getListGrid()).thenReturn(extendedPagedTable); presenter.setProcessInstance(processInstance); presenter.loadVariableHistory(callback, variableName); verify(callback).execute(summaries); }