@Test public void requestCompletion_should_not_register_request_when_execution_status_is_DONE() { long projectId = 1; when(executionRepository.findByProjectIdAndJobUrl(projectId, "url")).thenReturn(new Execution().withStatus(JobStatus.DONE)); cut.requestCompletion(projectId, "url"); verify(executionCompletionRequestRepository, never()).save(any(ExecutionCompletionRequest.class)); }
public void requestCompletion(long projectId, String jobUrl) { final Execution execution = executionRepository.findByProjectIdAndJobUrl(projectId, jobUrl); if (execution == null || execution.getStatus() != JobStatus.DONE) { executionCompletionRequestRepository.save(new ExecutionCompletionRequest(jobUrl)); } }
ExecutionService { public void requestCompletion(long projectId, String jobUrl) { final Execution execution = executionRepository.findByProjectIdAndJobUrl(projectId, jobUrl); if (execution == null || execution.getStatus() != JobStatus.DONE) { executionCompletionRequestRepository.save(new ExecutionCompletionRequest(jobUrl)); } } }
ExecutionService { public void requestCompletion(long projectId, String jobUrl) { final Execution execution = executionRepository.findByProjectIdAndJobUrl(projectId, jobUrl); if (execution == null || execution.getStatus() != JobStatus.DONE) { executionCompletionRequestRepository.save(new ExecutionCompletionRequest(jobUrl)); } }  }
ExecutionService { public void requestCompletion(long projectId, String jobUrl) { final Execution execution = executionRepository.findByProjectIdAndJobUrl(projectId, jobUrl); if (execution == null || execution.getStatus() != JobStatus.DONE) { executionCompletionRequestRepository.save(new ExecutionCompletionRequest(jobUrl)); } }  @Transactional(readOnly = true) Page<ExecutionWithHandlingCountsDTO> findAll(long projectId, Pageable pageable); @Transactional(readOnly = true) ExecutionWithCountryDeploymentsAndRunsAndExecutedScenariosAndTeamIdsAndErrorsAndProblemsDTO findOneWithRuns(long projectId, long id, ExecutionCriteriaDTO criteria); ExecutionDTO discard(long projectId, long id, String discardReason); ExecutionDTO unDiscard(long projectId, long id); void requestCompletion(long projectId, String jobUrl); String getQualityStatus(long projectId, String jobUrl); List<ExecutionDTO> getLatestEligibleVersions(long projectId); void uploadExecutionReport(long projectId, String projectCode, String branch, String cycle, MultipartFile zipFile); void processSpecificDirectory(CycleDefinition cycleDefinition, File executionDirectory); }
ExecutionService { public void requestCompletion(long projectId, String jobUrl) { final Execution execution = executionRepository.findByProjectIdAndJobUrl(projectId, jobUrl); if (execution == null || execution.getStatus() != JobStatus.DONE) { executionCompletionRequestRepository.save(new ExecutionCompletionRequest(jobUrl)); } }  @Transactional(readOnly = true) Page<ExecutionWithHandlingCountsDTO> findAll(long projectId, Pageable pageable); @Transactional(readOnly = true) ExecutionWithCountryDeploymentsAndRunsAndExecutedScenariosAndTeamIdsAndErrorsAndProblemsDTO findOneWithRuns(long projectId, long id, ExecutionCriteriaDTO criteria); ExecutionDTO discard(long projectId, long id, String discardReason); ExecutionDTO unDiscard(long projectId, long id); void requestCompletion(long projectId, String jobUrl); String getQualityStatus(long projectId, String jobUrl); List<ExecutionDTO> getLatestEligibleVersions(long projectId); void uploadExecutionReport(long projectId, String projectCode, String branch, String cycle, MultipartFile zipFile); void processSpecificDirectory(CycleDefinition cycleDefinition, File executionDirectory);  }