SchedulingService { public synchronized void registerJob(String type, Class<? extends SourceJob> clazz) { if (jobMap.containsKey(type)) { throw new JobTypeAlreadyRegisteredException( String.format("job type '%s' is already registered by '%s'", type, jobMap.get(type))); } jobMap.put(type, clazz); LOG.debug("registered job '{}' as '{}'", clazz.getSimpleName(), type); } @Autowired  SchedulingService(
      ApplicationContext context,
      WidgetConfigRepository widgetConfigRepository,
      SourceDataRepository sourceDataRepository); synchronized void registerJob(String type, Class<? extends SourceJob> clazz); void scheduleJob(String group, SourceConfig config); boolean checkJobExists(String name, String group); void cancelJobs(String group); boolean canSourceJobBeExecuted(String group); static final String PARAM_CONTEXT; static final String GROUP_HARVESTER; }
@Test public void registerJobNotRegisteringTwice() throws SchedulerException { expectedException.expect(JobTypeAlreadyRegisteredException.class); schedulingService.registerJob(TEST_JOB, TestJob.class); }