diff --git a/eva-accession-deprecate/src/test/java/uk/ac/ebi/eva/accession/deprecate/configuration/jobs/DeprecateStudySubmittedVariantsJobConfigurationTest.java b/eva-accession-deprecate/src/test/java/uk/ac/ebi/eva/accession/deprecate/configuration/jobs/DeprecateStudySubmittedVariantsJobConfigurationTest.java index 933c56803..c571c2ffd 100644 --- a/eva-accession-deprecate/src/test/java/uk/ac/ebi/eva/accession/deprecate/configuration/jobs/DeprecateStudySubmittedVariantsJobConfigurationTest.java +++ b/eva-accession-deprecate/src/test/java/uk/ac/ebi/eva/accession/deprecate/configuration/jobs/DeprecateStudySubmittedVariantsJobConfigurationTest.java @@ -31,6 +31,7 @@ import org.springframework.batch.test.JobLauncherTestUtils; import org.springframework.batch.test.JobRepositoryTestUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.ApplicationContext; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.test.annotation.DirtiesContext; @@ -56,6 +57,7 @@ import static org.springframework.data.mongodb.core.query.Query.query; import static uk.ac.ebi.eva.accession.deprecate.configuration.BeanNames.DEPRECATE_STUDY_SUBMITTED_VARIANTS_JOB; import static uk.ac.ebi.eva.accession.deprecate.configuration.BeanNames.DEPRECATE_STUDY_SUBMITTED_VARIANTS_STEP; +import static uk.ac.ebi.eva.accession.deprecate.test.configuration.BatchTestConfiguration.JOB_LAUNCHER_FROM_MONGO; @RunWith(SpringRunner.class) @ContextConfiguration(classes = {BatchTestConfiguration.class, MongoTestConfiguration.class}) @@ -65,7 +67,8 @@ public class DeprecateStudySubmittedVariantsJobConfigurationTest { private static final String TEST_DB = "test-db"; @Autowired - private JobLauncherTestUtils jobLauncherTestUtils; + @Qualifier(JOB_LAUNCHER_FROM_MONGO) + private JobLauncherTestUtils jobLauncherTestUtilsFromMongo; @Autowired private JobExplorer jobExplorer; @@ -113,7 +116,7 @@ public void tearDown() { @Test public void basicJobCompletion() throws Exception { - JobExecution jobExecution = jobLauncherTestUtils.launchJob(); + JobExecution jobExecution = jobLauncherTestUtilsFromMongo.launchJob(); List expectedSteps = Collections.singletonList(DEPRECATE_STUDY_SUBMITTED_VARIANTS_STEP); assertStepsExecuted(expectedSteps, jobExecution); @@ -131,7 +134,7 @@ private void assertStepsExecuted(List expectedSteps, JobExecution jobExecution) @Test @DirtiesContext public void restartCompletedJobThatIsAlreadyInTheRepository() throws Exception { - JobExecution jobExecution = jobLauncherTestUtils.launchJob(); + JobExecution jobExecution = jobLauncherTestUtilsFromMongo.launchJob(); List expectedSteps = Collections.singletonList(DEPRECATE_STUDY_SUBMITTED_VARIANTS_STEP); assertStepsExecuted(expectedSteps, jobExecution); @@ -143,7 +146,7 @@ public void restartCompletedJobThatIsAlreadyInTheRepository() throws Exception { jobExecution.getJobParameters()) .getJobInstance().getInstanceId(); - jobExecution = jobLauncherTestUtils.launchJob(); + jobExecution = jobLauncherTestUtilsFromMongo.launchJob(); expectedSteps = Collections.singletonList(DEPRECATE_STUDY_SUBMITTED_VARIANTS_STEP); assertStepsExecuted(expectedSteps, jobExecution); assertEquals(BatchStatus.COMPLETED, jobExecution.getStatus());