Search in sources :

Example 16 with JobExplorer

use of org.springframework.batch.core.explore.JobExplorer in project spring-boot by spring-projects.

the class BatchAutoConfigurationTests method testNoDatabase.

@Test
public void testNoDatabase() throws Exception {
    this.context = new AnnotationConfigApplicationContext();
    this.context.register(TestCustomConfiguration.class, BatchAutoConfiguration.class, TransactionAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
    assertThat(this.context.getBean(JobLauncher.class)).isNotNull();
    JobExplorer explorer = this.context.getBean(JobExplorer.class);
    assertThat(explorer).isNotNull();
    assertThat(explorer.getJobInstances("job", 0, 100)).isEmpty();
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) JobExplorer(org.springframework.batch.core.explore.JobExplorer) Test(org.junit.Test)

Aggregations

JobExplorer (org.springframework.batch.core.explore.JobExplorer)16 Test (org.junit.Test)12 JobInstance (org.springframework.batch.core.JobInstance)12 JobExecution (org.springframework.batch.core.JobExecution)11 Date (java.util.Date)5 Ignore (org.junit.Ignore)3 StepExecution (org.springframework.batch.core.StepExecution)3 JobLocator (org.springframework.batch.core.configuration.JobLocator)3 JobLauncher (org.springframework.batch.core.launch.JobLauncher)3 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)2 Calendar (java.util.Calendar)1 ProductStatus (org.mifos.framework.components.batchjobs.helpers.ProductStatus)1 CronTrigger (org.quartz.CronTrigger)1 JobDataMap (org.quartz.JobDataMap)1 JobDetail (org.quartz.JobDetail)1 JobExecutionContext (org.quartz.JobExecutionContext)1 Scheduler (org.quartz.Scheduler)1 BaseCalendar (org.quartz.impl.calendar.BaseCalendar)1 TriggerFiredBundle (org.quartz.spi.TriggerFiredBundle)1 JobParameters (org.springframework.batch.core.JobParameters)1