Skip to content

Commit

Permalink
Clean test verify
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoet-jh committed Feb 29, 2024
1 parent 9b2869e commit d3571f1
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,19 @@ private void verifyGrantThree() throws IOException {
}

private void verifyInvalidGrants(List<String> ingestRecordErrors) throws IOException {
assertTrue(ingestRecordErrors.stream().anyMatch(message ->
message.matches(".*GrantIngestRecord.*grantNumber=130823.*\\sError Message: User has blank " +
"employeeId and institutionalId\\.")));

PassClientSelector<Grant> grantSelector = new PassClientSelector<>(Grant.class);
grantSelector.setFilter(RSQL.equals("localKey", "johnshopkins.edu:grant:444444"));
grantSelector.setInclude("primaryFunder", "directFunder", "pi", "coPis");
PassClientResult<Grant> resultGrant = passClient.selectObjects(grantSelector);
// Has invalid award date format, skips row
assertEquals(0, resultGrant.getTotal());
assertTrue(ingestRecordErrors.stream().anyMatch(message ->
message.matches(".*GrantIngestRecord.*grantNumber=130823.*\\sError Message: User has blank " +
"employeeId and institutionalId\\.")));
message.matches(".*GrantIngestRecord.*grantNumber=444444.*" +
"\\sError Message: Invalid Format for 10-01-2021. Valid Format is uuuu-MM-dd.*")));

grantSelector.setFilter(RSQL.equals("localKey", "johnshopkins.edu:grant:555555"));
PassClientResult<Grant> resultGrant2 = passClient.selectObjects(grantSelector);
Expand Down

0 comments on commit d3571f1

Please sign in to comment.