@Test
public void testLaunchTwoJobs() throws Exception {
int before = SimpleJdbcTestUtils.countRowsInTable(jdbcTemplate, "BATCH_STEP_EXECUTION");
long count = 0;
JobExecution jobExecution1 = jobLauncher.run(job1, new JobParametersBuilder(jobParameters).addLong("run.id", count++)
.toJobParameters());
JobExecution jobExecution2 = jobLauncher.run(job1, new JobParametersBuilder(jobParameters).addLong("run.id", count++)
.toJobParameters());
assertEquals(BatchStatus.COMPLETED, jobExecution1.getStatus());
assertEquals(BatchStatus.COMPLETED, jobExecution2.getStatus());
int after = SimpleJdbcTestUtils.countRowsInTable(jdbcTemplate, "BATCH_STEP_EXECUTION");
assertEquals(before + 2, after);