diff --git a/eva-accession-core/src/main/java/uk/ac/ebi/eva/accession/core/configuration/MongoConfiguration.java b/eva-accession-core/src/main/java/uk/ac/ebi/eva/accession/core/configuration/MongoConfiguration.java index 16983faf0..d26b6567a 100644 --- a/eva-accession-core/src/main/java/uk/ac/ebi/eva/accession/core/configuration/MongoConfiguration.java +++ b/eva-accession-core/src/main/java/uk/ac/ebi/eva/accession/core/configuration/MongoConfiguration.java @@ -27,7 +27,11 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.core.env.Environment; +import org.springframework.data.mongodb.MongoDbFactory; import org.springframework.data.mongodb.config.EnableMongoAuditing; +import org.springframework.data.mongodb.core.MongoTemplate; +import org.springframework.data.mongodb.core.convert.DefaultMongoTypeMapper; +import org.springframework.data.mongodb.core.convert.MappingMongoConverter; import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; import java.net.UnknownHostException; @@ -56,4 +60,10 @@ public MongoClient mongoClient(MongoProperties properties, ObjectProvider implements ISubmittedVariant { + @Field("asm") private String assemblyAccession; + @Field("tax") private int taxonomyAccession; + @Field("study") private String projectAccession; private String contig; private long start; + @Field("ref") private String referenceAllele; + @Field("alt") private String alternateAllele; + @Field("evidence") private boolean supportedByEvidence; SubmittedVariantEntity() { diff --git a/eva-accession-pipeline/src/test/java/uk/ac/ebi/eva/accession/pipeline/io/AccessionWriterTest.java b/eva-accession-pipeline/src/test/java/uk/ac/ebi/eva/accession/pipeline/io/AccessionWriterTest.java index 4d6d6ad63..0aeedea2b 100644 --- a/eva-accession-pipeline/src/test/java/uk/ac/ebi/eva/accession/pipeline/io/AccessionWriterTest.java +++ b/eva-accession-pipeline/src/test/java/uk/ac/ebi/eva/accession/pipeline/io/AccessionWriterTest.java @@ -177,11 +177,13 @@ public void testSaveInitializesCreatedDate() throws Exception { "reference", "alternate", false); LocalDateTime beforeSave = LocalDateTime.now(); accessionWriter.write(Collections.singletonList(variant)); + LocalDateTime afterSave = LocalDateTime.now(); List> accessions = service.get(Collections.singletonList(variant)); assertEquals(1, accessions.size()); ISubmittedVariant savedVariant = accessions.iterator().next().getData(); assertTrue(beforeSave.isBefore(savedVariant.getCreatedDate())); + assertTrue(afterSave.isAfter(savedVariant.getCreatedDate())); } @Test