Skip to content

Commit 8e8966d

Browse files
committed
another empty answers unit test
1 parent ac3fd32 commit 8e8966d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/test/java/edu/harvard/iq/dataverse/util/json/JsonParserTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,5 +909,13 @@ public void testGuestbookResponse() throws JsonParseException {
909909
System.out.println(e.getMessage());
910910
assertTrue(e.getMessage().contains("Guestbook Response entry is required but not present"));
911911
}
912+
// Test missing "answers" empty array
913+
try {
914+
jsonObj = JsonUtil.getJsonObject("{\"answers\" : []}");
915+
gbr = sut.parseGuestbookResponse(jsonObj, guestbookResponse);
916+
} catch (JsonParseException e) {
917+
System.out.println(e.getMessage());
918+
assertTrue(e.getMessage().contains("Guestbook Response entry is required but not present"));
919+
}
912920
}
913921
}

0 commit comments

Comments
 (0)