RefreshPoolsJob implements AsyncJob { public static RefreshPoolsJobConfig createJobConfig() { return new RefreshPoolsJobConfig(); } @Inject  RefreshPoolsJob(OwnerCurator ownerCurator, PoolManager poolManager,
        SubscriptionServiceAdapter subAdapter); void execute(JobExecutionContext context); static RefreshPoolsJobConfig createJobConfig(); static final String JOB_KEY; static final String JOB_NAME; }
@Test public void testJobConfigSetOwner() { Owner owner = this.createTestOwner("owner_key", "log_level"); JobConfig config = RefreshPoolsJob.createJobConfig() .setOwner(owner); assertEquals(owner, config.getContextOwner()); }
@Test public void testJobConfigSetLazyRegeneration() { JobConfig config = RefreshPoolsJob.createJobConfig() .setLazyRegeneration(true); JobArguments args = config.getJobArguments(); assertTrue(args.containsKey(RefreshPoolsJob.LAZY_REGEN)); assertEquals(true, args.getAsBoolean(RefreshPoolsJob.LAZY_REGEN)); }
@Test public void testValidate() throws JobConfigValidationException { Owner owner = this.createTestOwner("owner_key", "log_level"); JobConfig config = RefreshPoolsJob.createJobConfig() .setOwner(owner) .setLazyRegeneration(false); config.validate(); }
@Test public void testValidateNoOwner() { JobConfig config = RefreshPoolsJob.createJobConfig() .setLazyRegeneration(true); assertThrows(JobConfigValidationException.class, config::validate); }
@Test public void testValidateNoLazyRegeneration() { Owner owner = this.createTestOwner("owner_key", "log_level"); JobConfig config = RefreshPoolsJob.createJobConfig() .setOwner(owner); assertThrows(JobConfigValidationException.class, config::validate); }