RegenEnvEntitlementCertsJob implements AsyncJob { public static RegenEnvEntitlementCertsJobConfig createJobConfig() { return new RegenEnvEntitlementCertsJobConfig(); } @Inject  RegenEnvEntitlementCertsJob(PoolManager poolManager); @Override void execute(JobExecutionContext context); static RegenEnvEntitlementCertsJobConfig createJobConfig(); static final String JOB_KEY; static final String JOB_NAME; }
@Test public void validateJobConfig() { JobConfig config = RegenEnvEntitlementCertsJob.createJobConfig() .setOwner(owner) .setEnvironment(environment) .setLazyRegeneration(true) .setContent(content); assertDoesNotThrow(config::validate); }
@Test public void ownerAndLazyRegenNotRequired() { JobConfig config = RegenEnvEntitlementCertsJob.createJobConfig() .setEnvironment(environment) .setContent(content); assertDoesNotThrow(config::validate); }
@Test public void environmentMustBePresent() { JobConfig config = RegenEnvEntitlementCertsJob.createJobConfig() .setOwner(owner) .setLazyRegeneration(true) .setContent(content); assertThrows(JobConfigValidationException.class, config::validate); }
@Test public void contentMustBePresent() { JobConfig config = RegenEnvEntitlementCertsJob.createJobConfig() .setOwner(owner) .setEnvironment(environment) .setLazyRegeneration(true); assertThrows(JobConfigValidationException.class, config::validate); }