RefreshPoolsForProductJob implements AsyncJob { public static RefreshPoolsForProductJobConfig createJobConfig() { return new RefreshPoolsForProductJobConfig(); } @Inject  RefreshPoolsForProductJob(
        final ProductCurator productCurator,
        final PoolManager poolManager,
        final SubscriptionServiceAdapter subAdapter); @Override void execute(final JobExecutionContext context); static RefreshPoolsForProductJobConfig createJobConfig(); static final String JOB_KEY; static final String JOB_NAME; }
@Test public void productAndLazyFlagMustBePresent() { final Product product = new Product(INVALID_ID, VALID_NAME); product.setUuid(VALID_ID); final JobConfig jobConfig = RefreshPoolsForProductJob.createJobConfig() .setProduct(product) .setLazy(false); try { jobConfig.validate(); } catch (JobConfigValidationException e) { fail("Validation should pass!"); } }
@Test public void productMustBePresent() { final JobConfig jobConfig = RefreshPoolsForProductJob.createJobConfig() .setLazy(false); assertThrows(JobConfigValidationException.class, jobConfig::validate); }
@Test public void productUuidMustBePresent() { final Product product = new Product(INVALID_ID, VALID_NAME); final JobConfig jobConfig = RefreshPoolsForProductJob.createJobConfig() .setProduct(product) .setLazy(false); assertThrows(JobConfigValidationException.class, jobConfig::validate); }
@Test public void lazyFlagMustBePresent() { final Product product = new Product(VALID_ID, VALID_NAME); product.setUuid(VALID_ID); final JobConfig jobConfig = RefreshPoolsForProductJob.createJobConfig() .setProduct(product); assertThrows(JobConfigValidationException.class, jobConfig::validate); }