File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
src/test/java/edu/harvard/iq/dataverse/api Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff 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)
You can’t perform that action at this time.
0 commit comments