@Test public void getAllJobExecutionManagersTest() { List<JobExecutionManagerListProjections> jobExecutionManagerDetails = Lists.newArrayList(); jobExecutionManagerDetails.add(getjobExecutionManagerDetailsProjections()); Page<JobExecutionManagerListProjections> allJobExecutionManagerDetails = new PageImpl<JobExecutionManagerListProjections>(jobExecutionManagerDetails,new PageRequest(0, 1), jobExecutionManagerDetails.size()); when(jobExecutionManagerService.getAllJobExecutionManagers(0, 1, StringUtils.EMPTY)).thenReturn(allJobExecutionManagerDetails); assertThat(jobExecutionManagerRepository.findAllJobExecutionManagers(StringUtils.EMPTY, new PageRequest(0, 1)).getContent().size(), is(1)); }
@Override public Page<JobExecutionManagerListProjections> getAllJobExecutionManagers(final Integer page, final Integer size, final String searchTerm) { return jobExecutionManagerRepository.findAllJobExecutionManagers(searchTerm.toLowerCase(), PageRequest.of(page, size)); }
JobExecutionManagerServiceImpl implements JobExecutionManagerService { @Override public Page<JobExecutionManagerListProjections> getAllJobExecutionManagers(final Integer page, final Integer size, final String searchTerm) { return jobExecutionManagerRepository.findAllJobExecutionManagers(searchTerm.toLowerCase(), PageRequest.of(page, size)); } }
JobExecutionManagerServiceImpl implements JobExecutionManagerService { @Override public Page<JobExecutionManagerListProjections> getAllJobExecutionManagers(final Integer page, final Integer size, final String searchTerm) { return jobExecutionManagerRepository.findAllJobExecutionManagers(searchTerm.toLowerCase(), PageRequest.of(page, size)); }  }
JobExecutionManagerServiceImpl implements JobExecutionManagerService { @Override public Page<JobExecutionManagerListProjections> getAllJobExecutionManagers(final Integer page, final Integer size, final String searchTerm) { return jobExecutionManagerRepository.findAllJobExecutionManagers(searchTerm.toLowerCase(), PageRequest.of(page, size)); }  @Override Page<JobExecutionManagerListProjections> getAllJobExecutionManagers(final Integer page, final Integer size, final String searchTerm); @Override String createJob(final MultipartFile fileToUpload, final JobDetails jobDetails, final String userId); @Override String updateJob(final MultipartFile fileToUpload, final JobDetails jobDetails, final String userId); @Override Collection<String> getAllJobIds(); @Override JobExecutionManager getByJobId(final String jobId); @Override String enableDisableJob(final String jobId, final String action, final String userId); }
JobExecutionManagerServiceImpl implements JobExecutionManagerService { @Override public Page<JobExecutionManagerListProjections> getAllJobExecutionManagers(final Integer page, final Integer size, final String searchTerm) { return jobExecutionManagerRepository.findAllJobExecutionManagers(searchTerm.toLowerCase(), PageRequest.of(page, size)); }  @Override Page<JobExecutionManagerListProjections> getAllJobExecutionManagers(final Integer page, final Integer size, final String searchTerm); @Override String createJob(final MultipartFile fileToUpload, final JobDetails jobDetails, final String userId); @Override String updateJob(final MultipartFile fileToUpload, final JobDetails jobDetails, final String userId); @Override Collection<String> getAllJobIds(); @Override JobExecutionManager getByJobId(final String jobId); @Override String enableDisableJob(final String jobId, final String action, final String userId);  }