ExpiredPoolsCleanupJob implements AsyncJob { @Override public void execute(JobExecutionContext context) throws JobExecutionException { this.poolManager.cleanupExpiredPools(); context.setJobResult("Expired pools cleanup completed successfully"); } @Inject  ExpiredPoolsCleanupJob(PoolManager poolManager); @Override void execute(JobExecutionContext context); static final String JOB_KEY; static final String JOB_NAME; static final String DEFAULT_SCHEDULE; }
@Test public void execute() throws Exception { JobExecutionContext context = mock(JobExecutionContext.class); ExpiredPoolsCleanupJob job = this.createJobInstance(); job.execute(context); verify(this.poolManager).cleanupExpiredPools(); }