RemoteTaskServiceImpl extends AbstractKieServerService implements TaskService { @Override public List<TaskEventSummary> getTaskEvents(String serverTemplateId, String containerId, Long taskId, Integer page, Integer pageSize) { if (serverTemplateId == null || serverTemplateId.isEmpty()) { return emptyList(); } UserTaskServicesClient client = getClient(serverTemplateId, UserTaskServicesClient.class); List<TaskEventInstance> events = client.findTaskEvents(containerId, taskId, page, pageSize, "id", false); return events.stream().map(e -> build(e)).collect(toList()); }  @Override TaskSummary getTask(String serverTemplateId, String containerId, Long taskId); @Override TaskSummary getTaskWithSLA(String serverTemplateId, String containerId, Long taskId); @Override void updateTask(String serverTemplateId,
                           String containerId,
                           Long taskId,
                           Integer priority,
                           String description,
                           Date dueDate); @Override void claimTask(String serverTemplateId,
                          String containerId,
                          Long taskId); @Override void releaseTask(String serverTemplateId,
                            String containerId,
                            Long taskId); @Override void startTask(String serverTemplateId,
                          String containerId,
                          Long taskId); @Override void completeTask(final String serverTemplateId,
                             final String containerId,
                             final Long taskId,
                             final Map<String, Object> output); @Override void resumeTask(String serverTemplateId,
                           String containerId,
                           Long taskId); @Override void suspendTask(String serverTemplateId,
                            String containerId,
                            Long taskId); @Override void saveTaskContent(String serverTemplateId,
                                String containerId,
                                Long taskId,
                                Map<String, Object> output); @Override void addTaskComment(String serverTemplateId,
                               String containerId,
                               Long taskId,
                               String text,
                               Date addedOn); @Override void deleteTaskComment(String serverTemplateId,
                                  String containerId,
                                  Long taskId,
                                  Long commentId); @Override List<CommentSummary> getTaskComments(String serverTemplateId,
                                                String containerId,
                                                Long taskId); @Override List<TaskEventSummary> getTaskEvents(String serverTemplateId,
                                                String containerId,
                                                Long taskId,
                                                Integer page,
                                                Integer pageSize); @Override void delegate(String serverTemplateId, String containerId, Long taskId, String entity); @Override List<TaskAssignmentSummary> delegateTasks(String serverTemplateId, List<TaskKey> tasksKeyToReassign, String entity); @Override void forward(String serverTemplateId,
                        String containerId,
                        Long taskId,
                        String entity); @Override TaskAssignmentSummary getTaskAssignmentDetails(String serverTemplateId,
                                                          String containerId,
                                                          Long taskId); @Override void executeReminderForTask(String serverTemplateId,
                                       String containerId,
                                       Long taskId,
                                       String fromUser); @Override TaskSummary getTaskByWorkItemId(String serverTemplateId,
                                           String containerId,
                                           Long workItemId); static int NOT_FOUND_ERROR_CODE; }
@Test public void getTaskEventsTest() { final long taskId = 1l; final String containerId = "containerId"; final String serverTemplateId = "serverTemplateId"; TaskEventInstance eventInstance = TaskEventInstance.builder() .taskId(taskId) .type("STARTED") .user("wbadmin") .workItemId(2L) .date(new Date()) .message("") .build(); when(userTaskServicesClient.findTaskEvents(containerId, taskId, 0, 5, "id", false)).thenReturn(Arrays.asList(eventInstance)); List<TaskEventSummary> taskEventSummaries = remoteTaskService.getTaskEvents(serverTemplateId, containerId, taskId, 0, 5); verify(userTaskServicesClient).findTaskEvents(containerId, taskId, 0, 5, "id", false); assertEquals(1, taskEventSummaries.size()); assertEquals(eventInstance.getId(), taskEventSummaries.get(0).getEventId()); assertEquals(eventInstance.getTaskId(), taskEventSummaries.get(0).getTaskId()); assertEquals(eventInstance.getType(), taskEventSummaries.get(0).getType()); assertEquals(eventInstance.getUserId(), taskEventSummaries.get(0).getUserId()); assertEquals(eventInstance.getWorkItemId(), taskEventSummaries.get(0).getWorkItemId()); assertEquals(eventInstance.getLogTime(), taskEventSummaries.get(0).getLogTime()); assertEquals(eventInstance.getMessage(), taskEventSummaries.get(0).getMessage()); }