Skip to content

Commit

Permalink
IQSS#4275 fix IT wrt DOIs reparse
Browse files Browse the repository at this point in the history
  • Loading branch information
sekmiller committed Jun 1, 2018
1 parent 1bdfa60 commit ae31ca9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/test/java/edu/harvard/iq/dataverse/api/DatasetsIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ public void testCreateDataset() {
.statusCode(OK.getStatusCode());

String identifier = JsonPath.from(datasetAsJson.getBody().asString()).getString("data.identifier");
System.out.println("identifier: " + identifier);
assertEquals(6, identifier.length());
assertEquals(10, identifier.length());

Response deleteDatasetResponse = UtilIT.deleteDatasetViaNativeApi(datasetId, apiToken);
deleteDatasetResponse.prettyPrint();
Expand Down Expand Up @@ -526,7 +525,8 @@ public void testSequentialNumberAsIdentifierGenerationStyle() {

String identifier = JsonPath.from(datasetAsJson.getBody().asString()).getString("data.identifier");
System.out.println("identifier: " + identifier);
assertTrue(StringUtils.isNumeric(identifier));
String numericPart = identifier.replace("FK2/", ""); //remove shoulder from identifier
assertTrue(StringUtils.isNumeric(numericPart));

Response deleteDatasetResponse = UtilIT.deleteDatasetViaNativeApi(datasetId, apiToken);
deleteDatasetResponse.prettyPrint();
Expand Down
8 changes: 5 additions & 3 deletions src/test/java/edu/harvard/iq/dataverse/api/SearchIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,8 @@ public void testIdentifier() {
String identifier = JsonPath.from(datasetAsJson.getBody().asString()).getString("data.identifier");
System.out.println("identifier: " + identifier);

Response searchUnpublished = UtilIT.search(identifier, apiToken);
String searchPart = identifier.replace("FK2/", "");
Response searchUnpublished = UtilIT.search(searchPart, apiToken);
searchUnpublished.prettyPrint();
searchUnpublished.then().assertThat()
.statusCode(OK.getStatusCode())
Expand All @@ -631,13 +632,14 @@ public void testIdentifier() {
publishDataset.then().assertThat()
.statusCode(OK.getStatusCode());

Response searchTargeted = UtilIT.search("dsPersistentId:" + identifier, apiToken);
searchPart = identifier.replace("FK2/", "");
Response searchTargeted = UtilIT.search("dsPersistentId:" + searchPart, apiToken);
searchTargeted.prettyPrint();
searchTargeted.then().assertThat()
.statusCode(OK.getStatusCode())
.body("data.total_count", CoreMatchers.equalTo(1));

Response searchUntargeted = UtilIT.search(identifier, apiToken);
Response searchUntargeted = UtilIT.search(searchPart, apiToken);
searchUntargeted.prettyPrint();
searchUntargeted.then().assertThat()
.statusCode(OK.getStatusCode())
Expand Down

0 comments on commit ae31ca9

Please sign in to comment.