Skip to content

Commit 4ab16f3

Browse files
committed
make test order independent
1 parent d2b6a46 commit 4ab16f3

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/test/java/edu/harvard/iq/dataverse/api/DatasetsIT.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3703,9 +3703,17 @@ public void testSemanticMetadataAPIs() {
37033703
// Look for a second description
37043704
jsonLDString = getData(response.getBody().asString());
37053705
jsonLDObject = JSONLDUtil.decontextualizeJsonLD(jsonLDString);
3706-
assertEquals("New description",
3707-
((JsonObject) jsonLDObject.getJsonArray("https://dataverse.org/schema/citation/dsDescription").get(1))
3708-
.getString("https://dataverse.org/schema/citation/dsDescriptionValue"));
3706+
JsonArray descriptions = jsonLDObject.getJsonArray("https://dataverse.org/schema/citation/dsDescription");
3707+
assertEquals(2, descriptions.size(), "Should have two descriptions");
3708+
boolean foundNewDescription = false;
3709+
for (int i = 0; i < descriptions.size(); i++) {
3710+
JsonObject desc = descriptions.getJsonObject(i);
3711+
if ("New description".equals(desc.getString("https://dataverse.org/schema/citation/dsDescriptionValue"))) {
3712+
foundNewDescription = true;
3713+
break;
3714+
}
3715+
}
3716+
assertTrue(foundNewDescription, "Should find 'New description' in the descriptions array");
37093717

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

0 commit comments

Comments
 (0)