RemoteExecutorServiceImpl extends AbstractKieServerService implements ExecutorService { @Override public RequestDetails getRequestDetails(String serverTemplateId, String deploymentId, Long requestId) { JobServicesClient jobClient = null; if (deploymentId != null && !deploymentId.isEmpty()) { jobClient = getClient(serverTemplateId, deploymentId, JobServicesClient.class); } else { jobClient = getClient(serverTemplateId, JobServicesClient.class); } Optional<RequestInfoInstance> request = ofNullable(jobClient.getRequestById(deploymentId, requestId, true, true)); return request.map(new RequestDetailsMapper()).orElse(null); }  @Override RequestDetails getRequestDetails(String serverTemplateId,
                                            String deploymentId,
                                            Long requestId); @Override Long scheduleRequest(String serverTemplateId,
                                String commandName,
                                Date date,
                                Map<String, String> ctx); @Override void cancelRequest(String serverTemplateId,
                              String deploymentId,
                              Long requestId); @Override void requeueRequest(String serverTemplateId,
                               String deploymentId,
                               Long requestId); @Override void acknowledgeError(String serverTemplateId,
                                 String deploymentId,
                                 String... errorId); @Override ExecutionErrorSummary getError(String serverTemplateId,
                                          String deploymentId,
                                          String errorId);  }
@Test public void testGetRequestDetails() { final RequestInfoInstance ri = newRequestInfoInstance(); when(jobServicesClient.getRequestById("", ri.getId(), true, true)).thenReturn(ri); final RequestDetails rd = executorService.getRequestDetails("", "", ri.getId()); assertRequestDetails(ri, rd); }
@Test public void testGetRequestDetailsEmpty() { final Long requestId = 1l; when(jobServicesClient.getRequestById("", requestId, true, true)).thenReturn(new RequestInfoInstance()); final RequestDetails requestDetails = executorService.getRequestDetails("", "", requestId); assertNotNull(requestDetails); assertNotNull(requestDetails.getRequest()); assertTrue(requestDetails.getErrors().isEmpty()); assertTrue(requestDetails.getParams().isEmpty()); }
@Test public void testGetRequestDetailsNull() { final RequestDetails requestDetails = executorService.getRequestDetails(null, null, null); assertNull(requestDetails); }