Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
35 changes: 35 additions & 0 deletions src/test/java/edu/harvard/iq/dataverse/api/InReviewWorkflowIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading