Source:
public void shouldLoadAllAnnotations() throws Exception { String annotationFolder = temporaryFolderRule.getRoot().getAbsolutePath(); String dbName = mongoRule.getRandomTemporaryDatabaseName(); String collectionVariantsName = "variants"; String studyId = "1"; String fileId = "1"; String vepOutput = VepUtils.resolveVepOutput(annotationFolder, studyId, fileId); String vepOutputName = Paths.get(vepOutput).getFileName().toString(); temporaryFolderRule.newGzipFile(VepOutputContent.vepOutputContent, vepOutputName); mongoRule.restoreDump(getResourceUrl(MONGO_DUMP), dbName); JobParameters jobParameters = new EvaJobParameterBuilder() .collectionVariantsName(collectionVariantsName) .databaseName(dbName) .inputStudyId(studyId) .inputVcfId(fileId) .outputDirAnnotation(annotationFolder) .toJobParameters(); JobExecution jobExecution = jobLauncherTestUtils.launchStep(BeanNames.LOAD_VEP_ANNOTATION_STEP, jobParameters); assertEquals(ExitStatus.COMPLETED, jobExecution.getExitStatus()); assertEquals(BatchStatus.COMPLETED, jobExecution.getStatus()); DBCursor cursor = mongoRule.getCollection(dbName, collectionVariantsName).find(); DBObjectToVariantAnnotationConverter converter = new DBObjectToVariantAnnotationConverter(); int cnt = 0; int consequenceTypeCount = 0; while (cursor.hasNext()) { cnt++; DBObject dbObject = (DBObject) cursor.next().get("annot"); if (dbObject != null) { VariantAnnotation annot = converter.convertToDataModelType(dbObject); Assert.assertNotNull(annot.getConsequenceTypes()); consequenceTypeCount += annot.getConsequenceTypes().size(); } } assertEquals(300, cnt); assertTrue("Annotations not found", consequenceTypeCount > 0); }

Target:
public void shouldLoadAllAnnotations() throws Exception { String annotationFolder = temporaryFolderRule.getRoot().getAbsolutePath(); String dbName = mongoRule.restoreDumpInTemporaryDatabase(getResourceUrl(MONGO_DUMP)); String collectionVariantsName = "variants"; String studyId = "1"; String fileId = "1"; String vepOutput = URLHelper.resolveVepOutput(annotationFolder, studyId, fileId); String vepOutputName = Paths.get(vepOutput).getFileName().toString(); temporaryFolderRule.newGzipFile(VepOutputContent.vepOutputContent, vepOutputName); JobParameters jobParameters = new EvaJobParameterBuilder() .collectionVariantsName(collectionVariantsName) .databaseName(dbName) .inputStudyId(studyId) .inputVcfId(fileId) .outputDirAnnotation(annotationFolder) .toJobParameters(); JobExecution jobExecution = jobLauncherTestUtils.launchStep(BeanNames.LOAD_VEP_ANNOTATION_STEP, jobParameters); assertEquals(ExitStatus.COMPLETED, jobExecution.getExitStatus()); assertEquals(BatchStatus.COMPLETED, jobExecution.getStatus()); DBCursor cursor = mongoRule.getCollection(dbName, collectionVariantsName).find(); DBObjectToVariantAnnotationConverter converter = new DBObjectToVariantAnnotationConverter(); int cnt = 0; int consequenceTypeCount = 0; while (cursor.hasNext()) { cnt++; DBObject dbObject = (DBObject) cursor.next().get("annot"); if (dbObject != null) { VariantAnnotation annot = converter.convertToDataModelType(dbObject); Assert.assertNotNull(annot.getConsequenceTypes()); consequenceTypeCount += annot.getConsequenceTypes().size(); } } assertEquals(300, cnt); assertTrue("Annotations not found", consequenceTypeCount > 0); }