HealEntireOrgJob implements AsyncJob { public static HealEntireOrgJobConfig createJobConfig() { return new HealEntireOrgJobConfig(); } @Inject  HealEntireOrgJob(Entitler entitler, EventSink eventSink, ConsumerCurator consumerCurator,
        OwnerCurator ownerCurator, I18n i18n); @Override void execute(JobExecutionContext context); static HealEntireOrgJobConfig createJobConfig(); String healSingleConsumer(Object... args); static final String JOB_KEY; static final String JOB_NAME; static final String OWNER_KEY; static final String ENTITLE_DATE_KEY; }
@Test public void testJobConfigSetOwnerAndEntitleDate() { Owner owner = this.createTestOwner(HealEntireOrgJob.OWNER_KEY, "log_level"); Date entitleDate = new Date(); JobConfig config = HealEntireOrgJob.createJobConfig().setOwner(owner).setEntitleDate(entitleDate); assertDoesNotThrow(config::validate); assertEquals(owner, config.getContextOwner()); JobArguments jobArguments = config.getJobArguments(); assertTrue(jobArguments.containsKey(HealEntireOrgJob.OWNER_KEY)); assertEquals(owner.getKey(), jobArguments.getAsString(HealEntireOrgJob.OWNER_KEY)); assertTrue(jobArguments.containsKey(HealEntireOrgJob.ENTITLE_DATE_KEY)); assertEquals(entitleDate, jobArguments.getAs(HealEntireOrgJob.ENTITLE_DATE_KEY, Date.class)); }