Skip to content

Commit

Permalink
Merge pull request #10882 from IQSS/10849-add-isreleased-field-to-isp…
Browse files Browse the repository at this point in the history
…artof

add isReleased field to isPartOf
  • Loading branch information
ofahimIQSS authored Oct 8, 2024
2 parents 4afcfb2 + 7cc81e0 commit 45bdf5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ private static JsonObjectBuilder addEmbeddedOwnerObject(DvObject dvo, JsonObject
ownerObject.add("type", "DATAVERSE");
Dataverse in = (Dataverse) dvo;
ownerObject.add("identifier", in.getAlias());
ownerObject.add("isReleased", in.isReleased());
}

if (dvo.isInstanceofDataset()) {
Expand Down
7 changes: 5 additions & 2 deletions src/test/java/edu/harvard/iq/dataverse/api/DatasetsIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -2134,8 +2134,11 @@ public void testGetDatasetOwners() {

Response getDatasetWithOwners = UtilIT.getDatasetWithOwners(persistentId, apiToken, true);
getDatasetWithOwners.prettyPrint();
getDatasetWithOwners.then().assertThat().body("data.isPartOf.identifier", equalTo(dataverseAlias));

getDatasetWithOwners.then().assertThat().body("data.isPartOf.identifier", equalTo(dataverseAlias));
getDatasetWithOwners.then().assertThat().body("data.isPartOf.isReleased", equalTo(false));
getDatasetWithOwners.then().assertThat().body("data.isPartOf.isPartOf.identifier", equalTo("root"));
getDatasetWithOwners.then().assertThat().body("data.isPartOf.isPartOf.isReleased", equalTo(true));

Response destroyDatasetResponse = UtilIT.destroyDataset(datasetId, apiToken);
assertEquals(200, destroyDatasetResponse.getStatusCode());

Expand Down

0 comments on commit 45bdf5a

Please sign in to comment.