Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 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 @@ -3703,9 +3703,17 @@ public void testSemanticMetadataAPIs() {
// Look for a second description
jsonLDString = getData(response.getBody().asString());
jsonLDObject = JSONLDUtil.decontextualizeJsonLD(jsonLDString);
assertEquals("New description",
((JsonObject) jsonLDObject.getJsonArray("https://dataverse.org/schema/citation/dsDescription").get(1))
.getString("https://dataverse.org/schema/citation/dsDescriptionValue"));
JsonArray descriptions = jsonLDObject.getJsonArray("https://dataverse.org/schema/citation/dsDescription");
assertEquals(2, descriptions.size(), "Should have two descriptions");
boolean foundNewDescription = false;
for (int i = 0; i < descriptions.size(); i++) {
JsonObject desc = descriptions.getJsonObject(i);
if ("New description".equals(desc.getString("https://dataverse.org/schema/citation/dsDescriptionValue"))) {
foundNewDescription = true;
break;
}
}
assertTrue(foundNewDescription, "Should find 'New description' in the descriptions array");

// Can't add terms of use with replace=false and a value already set (single
// valued field)
Expand Down