MasterSlaveJobServiceImpl extends AbstractService implements MasterSlaveJobService, ApplicationContextAware { @Override public List<String> getJarFileNameList(String group, String name) { MasterSlaveJob job = new MasterSlaveJob(); job.setGroupName(group); job.setJobName(name); List<MasterSlaveJob> masterSlaveJobList = baseDao.getList(MasterSlaveJob.class, job, false); List<String> jarFileNameList = new ArrayList<>(); if (masterSlaveJobList == null) { return jarFileNameList; } jarFileNameList.addAll(masterSlaveJobList.stream().map(MasterSlaveJob::getJarFileName).collect(Collectors.toList())); return jarFileNameList; }  @Override void setApplicationContext(ApplicationContext applicationContext); @Override List<MasterSlaveJob> getAllJobs(); @Override MasterSlaveJob getJob(String group, String name, String jarFileName); @Override void saveJob(String jarFilePath, String packagesToScan); @Override List<String> getJarFileNameList(String group, String name);  }
@Test public void getJarFileNameList() { masterSlaveJobService.saveJob(getSampleJarFile(), "com.zuoxiaolong"); List<String> jarFileNameList = masterSlaveJobService.getJarFileNameList("com.zuoxiaolong.niubi.job.sample.spring.job.Job1", "test"); Assert.assertNotNull(jarFileNameList); Assert.assertTrue(jarFileNameList.size() == 1); Assert.assertEquals("niubi-job-sample-spring.jar" , jarFileNameList.get(0)); }