Skip to content

Commit

Permalink
SCRUM-4513 update biogridOrcBulkPostEndpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgibs committed Nov 14, 2024
1 parent 662ef78 commit 4d0fdce
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ private boolean runLoad(BulkLoadFileHistory history, List<BiogridOrcFmsDTO> biog
history.incrementFailed();
ph.progressProcess();
}
history.incrementCompleted();
updateHistory(history);
updateExceptions(history);
ph.finishProcess();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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"));
}

}

0 comments on commit 4d0fdce

Please sign in to comment.