Skip to content

Commit

Permalink
SCRUM-4657: fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
abecerra committed Jan 10, 2025
1 parent e029a5b commit 657fe72
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ public Long validateVariant(VariantFmsDTO dto, List<Long> idsAdded, BackendBulkD
}
variant.getReferences().addAll(validatedReferences);
}
} else {
variant.setReferences(null);
}

if (variant.getRelatedNotes() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public void init() {
private final String reference = "AGRKB:000000001";
private final String reference2 = "AGRKB:000000021";
private final String pubmedId = "PMID:25920554";
private final String updatedPubmedId = "PMID:009";

private void loadRequiredEntities() throws Exception {
createSoTerm("SO:1000002", "substitution", false);
Expand Down Expand Up @@ -155,8 +156,8 @@ public void variantFmsBulkUploadUpdate() throws Exception {
body("entity.crossReferences", hasSize(1)).
body("entity.crossReferences[0].referencedCurie", is("TEST:WBVar00252637")).
body("entity.crossReferences[0].displayName", is("TEST:WBVar00252637")).
body("entity.crossReferences[0].resourceDescriptorPage.name", is("homepage"));

body("entity.crossReferences[0].resourceDescriptorPage.name", is("homepage")).
body("entity.references[0].crossReferences[0].referencedCurie", is(updatedPubmedId));
}

@Test
Expand Down Expand Up @@ -207,6 +208,7 @@ public void variantFmsBulkUploadInvalidFields() throws Exception {
checkBulkLoadRecordCounts(variantFmsBulkPostEndpoint, variantFmsTestFilePath + "IV_01_invalid_type.json", params);
checkBulkLoadRecordCounts(variantFmsBulkPostEndpoint, variantFmsTestFilePath + "IV_02_invalid_type_for_fms_submissions.json", params);
checkBulkLoadRecordCounts(variantFmsBulkPostEndpoint, variantFmsTestFilePath + "IV_03_invalid_consequence.json", params);
checkBulkLoadRecordCounts(variantFmsBulkPostEndpoint, variantFmsTestFilePath + "IV_06_invalid_reference.json", params);

params.put("Entities", createCountParams(1, 0, 1, 0));
params.put("Associations", createCountParams(1, 0, 1, 0));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[
{
"alleleId": "WB:AlleleWithVar1",
"sequenceOfReferenceAccessionNumber": "RefSeq:NC_003279.8",
"start": 1,
"end": 1000,
"genomicReferenceSequence": "A",
"genomicVariantSequence": "T",
"type": "SO:1000002",
"consequence": "SO:0001587",
"references": [
{
"publicationId": "PMID:unknown",
"crossReference": {
"id": "WB:WBPaper00042242",
"pages": [
"reference"
]
}
}
],
"notes": [
{
"note": "This is a test note.",
"references": [
{
"publicationId": "PMID:25920550",
"crossReference": {
"id": "WB:WBPaper00042241",
"pages": [
"reference"
]
}
}
]
}
],
"crossReferences": [
{
"id": "TEST:WBVar00252636",
"pages": [
"homepage"
]
}
],
"synonyms" : [
"Syn 1","Syn 2"
]
}
]

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"consequence": "SO:0001578",
"references": [
{
"publicationId": "PMID:25920554",
"publicationId": "PMID:009",
"crossReference": {
"id": "WB:WBPaper00042242",
"pages": [
Expand Down

0 comments on commit 657fe72

Please sign in to comment.