|
6 | 6 | import io.restassured.response.Response; |
7 | 7 | import edu.harvard.iq.dataverse.authorization.DataverseRole; |
8 | 8 | import jakarta.json.Json; |
| 9 | +import jakarta.json.JsonArray; |
9 | 10 | import jakarta.json.JsonObjectBuilder; |
10 | 11 |
|
11 | 12 | import static edu.harvard.iq.dataverse.UserNotification.Type.*; |
@@ -120,6 +121,13 @@ public void testCuratorSendsCommentsToAuthor() { |
120 | 121 | .body("message", equalTo("You cannot submit this dataset for review because it is already in review.")) |
121 | 122 | .statusCode(FORBIDDEN.getStatusCode()); |
122 | 123 |
|
| 124 | + // Confirm that when getting the dataset, the "InReview" lock is listed |
| 125 | + Response getDatasetJson = UtilIT.nativeGet(datasetId, authorApiToken); |
| 126 | + getDatasetJson.prettyPrint(); |
| 127 | + getDatasetJson.then().assertThat() |
| 128 | + .body("data.locks[0]", equalTo("InReview")) |
| 129 | + .statusCode(200); |
| 130 | + |
123 | 131 | Response authorsChecksForCommentsPrematurely = UtilIT.getNotifications(authorApiToken); |
124 | 132 | authorsChecksForCommentsPrematurely.prettyPrint(); |
125 | 133 | authorsChecksForCommentsPrematurely.then().assertThat() |
@@ -429,6 +437,14 @@ public void testCuratorSendsCommentsToAuthor() { |
429 | 437 | // .body("data[3].reasonsForReturn", equalTo(null)) |
430 | 438 | .statusCode(OK.getStatusCode()); |
431 | 439 |
|
| 440 | + // Confirm that when getting the dataset, the "InReview" lock is no longer listed |
| 441 | + JsonArray emptyArray = Json.createArrayBuilder().build(); |
| 442 | + getDatasetJson = UtilIT.nativeGet(datasetId, authorApiToken); |
| 443 | + getDatasetJson.prettyPrint(); |
| 444 | + getDatasetJson.then().assertThat() |
| 445 | + .body("data.locks", equalTo(emptyArray)) |
| 446 | + .statusCode(200); |
| 447 | + |
432 | 448 | // These println's are here in case you want to log into the GUI to see what notifications look like. |
433 | 449 | System.out.println("Curator username/password: " + curatorUsername); |
434 | 450 | System.out.println("Author username/password: " + authorUsername); |
|
0 commit comments