From 4d0fdceb9d5915760950bd51224de41f0d7ee122 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 13 Nov 2024 15:55:21 -0600 Subject: [PATCH] SCRUM-4513 update biogridOrcBulkPostEndpoint --- .../jobs/executors/BiogridOrcExecutor.java | 1 - .../BiogridOrcBulkUploadFmsITCase.java | 33 +++++++++++-------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/BiogridOrcExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/BiogridOrcExecutor.java index c431187de..bd4c42b51 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/BiogridOrcExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/BiogridOrcExecutor.java @@ -163,7 +163,6 @@ private boolean runLoad(BulkLoadFileHistory history, List biog history.incrementFailed(); ph.progressProcess(); } - history.incrementCompleted(); updateHistory(history); updateExceptions(history); ph.finishProcess(); diff --git a/src/test/java/org/alliancegenome/curation_api/BiogridOrcBulkUploadFmsITCase.java b/src/test/java/org/alliancegenome/curation_api/BiogridOrcBulkUploadFmsITCase.java index 0c52d02b8..f8624b2ce 100644 --- a/src/test/java/org/alliancegenome/curation_api/BiogridOrcBulkUploadFmsITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/BiogridOrcBulkUploadFmsITCase.java @@ -4,6 +4,8 @@ import static org.hamcrest.Matchers.is; import org.alliancegenome.curation_api.base.BaseITCase; +import org.alliancegenome.curation_api.model.entities.ResourceDescriptor; +import org.alliancegenome.curation_api.model.entities.ResourceDescriptorPage; import org.alliancegenome.curation_api.resources.TestContainerResource; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -35,27 +37,32 @@ public void init() { .setParam("http.connection.timeout", 100000)); } - private final String biogridOrcBulkPostEndpoint = "/api/cross-reference/bulk/FB/biogridfile"; + ResourceDescriptorPage resourceDescriptorPage; + + private final String biogridOrcBulkPostEndpoint = "/api/biogrid-orc/bulk/FB/biogridfile"; private final String biogridOrcTestFilePath = "src/test/resources/bulk/fms/12_biogrid/"; private final String biogridOrcFindEndpoint = "/api/cross-reference/find?limit=100&page=0"; + private void loadRequiredEntities() throws Exception { + ResourceDescriptor rd = createResourceDescriptor("FB"); + createResourceDescriptorPage("biogrid/orcs", "http://test.org", rd); + } + @Test @Order(1) public void biogridOrcBulkUploadCheckFields() throws Exception { - + loadRequiredEntities(); checkSuccessfulBulkLoad(biogridOrcBulkPostEndpoint, biogridOrcTestFilePath + "AF_01_all_fields.json", 1); - RestAssured.given(). - when(). - header("Content-Type", "application/json"). - body("{}"). - post(biogridOrcFindEndpoint). - then(). - statusCode(200). - body("totalResults", is(1)). - body("results", hasSize(1)). - body("results[0].referencedCurie", is("NCBI_Gene:108101")). - body("results[0].displayName", is("BioGRID CRISPR Screen Cell Line Phenotypes")); + RestAssured.given() + .when() + .header("Content-Type", "application/json") + .body("{\"referencedCurie\": \"NCBI_Gene:108101\"}").post(biogridOrcFindEndpoint) + .then().statusCode(200) + .body("totalResults", is(1)) + .body("results", hasSize(1)) + .body("results[0].referencedCurie", is("NCBI_Gene:108101")) + .body("results[0].displayName", is("BioGRID CRISPR Screen Cell Line Phenotypes")); } }