From a196f635f881ae51c5115c9abf50eea94e5d992e Mon Sep 17 00:00:00 2001 From: Vera Clemens Date: Fri, 6 Feb 2026 14:08:07 +0100 Subject: [PATCH 1/2] fix: fix bug in notifications API related to SUBMITTEDDS notifications --- .../iq/dataverse/util/json/InAppNotificationsJsonPrinter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/util/json/InAppNotificationsJsonPrinter.java b/src/main/java/edu/harvard/iq/dataverse/util/json/InAppNotificationsJsonPrinter.java index ec04dfaf6a1..d1aa2d03c65 100644 --- a/src/main/java/edu/harvard/iq/dataverse/util/json/InAppNotificationsJsonPrinter.java +++ b/src/main/java/edu/harvard/iq/dataverse/util/json/InAppNotificationsJsonPrinter.java @@ -241,7 +241,7 @@ private void addGuidesFields(final NullSafeJsonBuilder notificationJson, String } private void addSubmittedDatasetFields(final NullSafeJsonBuilder notificationJson, final UserNotification userNotification, final AuthenticatedUser requestor) { - addDatasetFields(notificationJson, userNotification); + addDatasetVersionFields(notificationJson, userNotification); addRequestorFields(notificationJson, requestor); } From 82647308c07e2e5d2110219339eb1272f4796f49 Mon Sep 17 00:00:00 2001 From: Vera Clemens Date: Fri, 6 Feb 2026 14:29:15 +0100 Subject: [PATCH 2/2] test: extend InReviewWorkflowIT --- .../iq/dataverse/api/InReviewWorkflowIT.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/test/java/edu/harvard/iq/dataverse/api/InReviewWorkflowIT.java b/src/test/java/edu/harvard/iq/dataverse/api/InReviewWorkflowIT.java index a2bef649c72..409a62d2978 100644 --- a/src/test/java/edu/harvard/iq/dataverse/api/InReviewWorkflowIT.java +++ b/src/test/java/edu/harvard/iq/dataverse/api/InReviewWorkflowIT.java @@ -429,6 +429,41 @@ public void testCuratorSendsCommentsToAuthor() { // .body("data[3].reasonsForReturn", equalTo(null)) .statusCode(OK.getStatusCode()); + // The author realizes she wants to add another file and creates a new draft version. + Response authorAddsNewFileCreatingNewDraft = UtilIT.uploadFileViaNative(datasetId.toString(), pathToFile1, authorApiToken); + authorAddsNewFileCreatingNewDraft.prettyPrint(); + authorAddsNewFileCreatingNewDraft.then().assertThat() + .statusCode(OK.getStatusCode()); + + // The author re-submits. + Response submit4 = UtilIT.submitDatasetForReview(datasetPersistentId, authorApiToken); + submit4.prettyPrint(); + submit4.then().assertThat() + .body("data.inReview", equalTo(true)) + .statusCode(OK.getStatusCode()); + + // The curator checks notifications and sees that the dataset has been re-submitted after it was published. + Response curatorChecksForNotificationsPostPublication = UtilIT.getNotifications(curatorApiToken); + curatorChecksForNotificationsPostPublication.prettyPrint(); + curatorChecksForNotificationsPostPublication.then().assertThat() + .body("data[0].type", equalTo(SUBMITTEDDS.toString())) + .body("data[1].type", equalTo(PUBLISHEDDS.toString())) + .statusCode(OK.getStatusCode()); + + // The curator checks again, this time in app notification format. + Response curatorChecksForNotificationsPostPublicationInAppFormat = UtilIT.getNotifications(curatorApiToken, true, null, null, null); + curatorChecksForNotificationsPostPublicationInAppFormat.prettyPrint(); + curatorChecksForNotificationsPostPublicationInAppFormat.then().assertThat() + .body("data[0].type", equalTo(SUBMITTEDDS.toString())) + .body("data[0].objectDeleted", equalTo(null)) + .body("data[0].datasetPersistentIdentifier", equalTo(datasetPersistentId)) + .body("data[0].ownerAlias", equalTo(dataverseAlias)) + .body("data[1].type", equalTo(PUBLISHEDDS.toString())) + .body("data[1].objectDeleted", equalTo(null)) + .body("data[1].datasetPersistentIdentifier", equalTo(datasetPersistentId)) + .body("data[1].ownerAlias", equalTo(dataverseAlias)) + .statusCode(OK.getStatusCode()); + // These println's are here in case you want to log into the GUI to see what notifications look like. System.out.println("Curator username/password: " + curatorUsername); System.out.println("Author username/password: " + authorUsername);