Skip to content

Commit

Permalink
add test to assert capitalizataion of Dataset and Software #10517
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Sep 4, 2024
1 parent 4842d92 commit 673d775
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/java/edu/harvard/iq/dataverse/api/DatasetTypesIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,24 @@ public void testCreateSoftwareDatasetNative() {
UtilIT.publishDataverseViaNativeApi(dataverseAlias, apiToken).then().assertThat().statusCode(OK.getStatusCode());
UtilIT.publishDatasetViaNativeApi(datasetPid, "major", apiToken).then().assertThat().statusCode(OK.getStatusCode());

Response createDataset = UtilIT.createRandomDatasetViaNativeApi(dataverseAlias, apiToken);
createDataset.prettyPrint();
createDataset.then().assertThat().statusCode(CREATED.getStatusCode());

String dataset2Pid = JsonPath.from(createDataset.getBody().asString()).getString("data.persistentId");

UtilIT.publishDatasetViaNativeApi(dataset2Pid, "major", apiToken).then().assertThat().statusCode(OK.getStatusCode());

Response searchCollection = UtilIT.searchAndShowFacets("parentName:" + dataverseAlias, null);
searchCollection.prettyPrint();
searchCollection.then().assertThat()
.body("data.total_count", CoreMatchers.is(2))
.body("data.count_in_response", CoreMatchers.is(2))
.body("data.facets[0].datasetType.friendly", CoreMatchers.is("Dataset Type"))
.body("data.facets[0].datasetType.labels[0].Dataset", CoreMatchers.is(1))
.body("data.facets[0].datasetType.labels[1].Software", CoreMatchers.is(1))
.statusCode(OK.getStatusCode());

// Response searchAsGuest = UtilIT.search(SearchFields.DATASET_TYPE + ":software", null);
// searchAsGuest.prettyPrint();
// searchAsGuest.then().assertThat()
Expand Down

0 comments on commit 673d775

Please sign in to comment.