Skip to content

Commit

Permalink
Changes in IT
Browse files Browse the repository at this point in the history
  • Loading branch information
VarunReddy1111 committed Dec 12, 2024
1 parent 73b0e5f commit 0a90c85
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
import static org.hamcrest.Matchers.not;

import java.time.OffsetDateTime;
import java.util.List;

import org.alliancegenome.curation_api.base.BaseITCase;
import org.alliancegenome.curation_api.constants.VocabularyConstants;
import org.alliancegenome.curation_api.model.entities.ResourceDescriptor;
import org.alliancegenome.curation_api.model.entities.Vocabulary;
import org.alliancegenome.curation_api.model.entities.VocabularyTerm;
import org.alliancegenome.curation_api.resources.TestContainerResource;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
Expand Down Expand Up @@ -48,6 +52,8 @@ public void init() {
private String requiredDataProvider2 = "RGD";
private String soTerm = "SO:0001217";
private String soTerm2 = "SO:0000336";
private String noteType = "comment";
private VocabularyTerm noteTypeVocabTerm;

private final String geneBulkPostEndpoint = "/api/gene/bulk/WB/genes";
private final String geneBulkPostEndpointRGD = "/api/gene/bulk/RGD/genes";
Expand All @@ -64,6 +70,9 @@ private void loadRequiredEntities() throws Exception {
createResourceDescriptorPage("homepage2", "http://test2.org", rd2);
createSoTerm(soTerm, "protein_coding_gene", false);
createSoTerm(soTerm2, "pseudogene", false);
Vocabulary noteTypeVocab = getVocabulary("note_type");
noteTypeVocabTerm = createVocabularyTerm(noteTypeVocab, noteType, false);
createVocabularyTermSet(VocabularyConstants.GENE_NOTE_TYPES_VOCABULARY_TERM_SET, noteTypeVocab, List.of(noteTypeVocabTerm));
}

@Test
Expand Down Expand Up @@ -161,8 +170,7 @@ public void geneBulkUploadCheckFields() throws Exception {
body("entity.relatedNotes[0].dateUpdated", is(OffsetDateTime.parse("2022-03-10T22:10:12Z").toString())).
body("entity.relatedNotes[0].dateCreated", is(OffsetDateTime.parse("2022-03-09T22:10:12Z").toString())).
body("entity.relatedNotes[0].freeText", is("Test note")).
body("entity.relatedNotes[0].noteType.name", is("comment")).
body("entity.relatedNotes[0].references[0].curie", is(requiredReference));
body("entity.relatedNotes[0].noteType.name", is(noteType));
}

@Test
Expand Down Expand Up @@ -251,15 +259,14 @@ public void geneBulkUploadUpdateFields() throws Exception {
body("entity.crossReferences[0].resourceDescriptorPage.name", is("homepage2")).
body("entity.geneType.curie", is(soTerm2)).
body("entity.relatedNotes", hasSize(1)).
body("entity.relatedNotes[0].internal", is(true)).
body("entity.relatedNotes[0].obsolete", is(false)).
body("entity.relatedNotes[0].updatedBy.uniqueId", is("DATEST:Person0001")).
body("entity.relatedNotes[0].createdBy.uniqueId", is("DATEST:Person0002")).
body("entity.relatedNotes[0].dateUpdated", is(OffsetDateTime.parse("2022-03-20T22:10:12Z").toString())).
body("entity.relatedNotes[0].dateCreated", is(OffsetDateTime.parse("2022-03-19T22:10:12Z").toString())).
body("entity.relatedNotes[0].internal", is(false)).
body("entity.relatedNotes[0].obsolete", is(true)).
body("entity.relatedNotes[0].updatedBy.uniqueId", is("DATEST:Person0002")).
body("entity.relatedNotes[0].createdBy.uniqueId", is("DATEST:Person0001")).
body("entity.relatedNotes[0].dateUpdated", is(OffsetDateTime.parse("2022-03-10T22:10:12Z").toString())).
body("entity.relatedNotes[0].dateCreated", is(OffsetDateTime.parse("2022-03-09T22:10:12Z").toString())).
body("entity.relatedNotes[0].freeText", is("Test note")).
body("entity.relatedNotes[0].noteType.name", is("indel_verification")).
body("entity.relatedNotes[0].references[0].curie", is(requiredReference2));
body("entity.relatedNotes[0].noteType.name", is(noteType));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,15 @@
"note_dtos": [
{
"free_text": "Test note",
"note_type_name": "indel_verification",
"created_by_curie": "DATEST:Person0002",
"updated_by_curie": "DATEST:Person0001",
"date_created": "2022-03-19T22:10:12+00:00",
"date_updated": "2022-03-20T22:10:12+00:00",
"note_type_name": "comment",
"internal": false,
"obsolete": true,
"created_by_curie": "DATEST:Person0001",
"updated_by_curie": "DATEST:Person0002",
"date_created": "2022-03-09T22:10:12+00:00",
"date_updated": "2022-03-10T22:10:12+00:00",
"evidence_curies": [
"PMID:25920551"
"PMID:25920550"
]
}
],
Expand Down

0 comments on commit 0a90c85

Please sign in to comment.