RegenProductEntitlementCertsJob implements AsyncJob { public static RegenProductEntitlementCertsConfig createJobConfig() { return new RegenProductEntitlementCertsConfig(); } @Inject  RegenProductEntitlementCertsJob(PoolManager poolManager, OwnerCurator ownerCurator); @Override void execute(JobExecutionContext context); static RegenProductEntitlementCertsConfig createJobConfig(); static final String JOB_KEY; static final String JOB_NAME; }
@Test public void testBasicConfig() { JobConfig config = RegenProductEntitlementCertsJob.createJobConfig(); assertEquals(RegenProductEntitlementCertsJob.JOB_KEY, config.getJobKey()); assertEquals(RegenProductEntitlementCertsJob.JOB_NAME, config.getJobName()); }
@Test public void testConfigSetProductId() { String productId = "test_prod_id"; JobConfig config = RegenProductEntitlementCertsJob.createJobConfig() .setProductId(productId); JobArguments args = config.getJobArguments(); assertNotNull(args); assertEquals(1, args.size()); String argKey = args.keySet().iterator().next(); assertNotNull(argKey); assertFalse(argKey.isEmpty()); assertEquals(productId, args.getAsString(argKey)); }
@Test public void testConfigSetLazyRegen() { boolean lazyRegen = true; JobConfig config = RegenProductEntitlementCertsJob.createJobConfig() .setLazyRegeneration(lazyRegen); JobArguments args = config.getJobArguments(); assertNotNull(args); assertEquals(1, args.size()); String argKey = args.keySet().iterator().next(); assertNotNull(argKey); assertFalse(argKey.isEmpty()); assertEquals(lazyRegen, args.getAsBoolean(argKey)); }