@@ -123,9 +123,9 @@ public void testCuratorSendsCommentsToAuthor() {
123123 Response authorsChecksForCommentsPrematurely = UtilIT .getNotifications (authorApiToken );
124124 authorsChecksForCommentsPrematurely .prettyPrint ();
125125 authorsChecksForCommentsPrematurely .then ().assertThat ()
126- .body ("data.notifications [0].type" , equalTo (CREATEACC .toString ()))
126+ .body ("data[0].type" , equalTo (CREATEACC .toString ()))
127127 // The author thinks, "What's taking the curator so long to review my data?!?"
128- .body ("data.notifications [1]" , equalTo (null ))
128+ .body ("data[1]" , equalTo (null ))
129129 .statusCode (OK .getStatusCode ());
130130
131131 String joeRandomComments = "Joe Random says you'll never graduate." ;
@@ -135,12 +135,12 @@ public void testCuratorSendsCommentsToAuthor() {
135135 Response curatorChecksNotificationsAndFindsWorkToDo = UtilIT .getNotifications (curatorApiToken );
136136 curatorChecksNotificationsAndFindsWorkToDo .prettyPrint ();
137137 curatorChecksNotificationsAndFindsWorkToDo .then ().assertThat ()
138- .body ("data.notifications [0].type" , equalTo (SUBMITTEDDS .toString ()))
139- .body ("data.notifications [0].reasonForReturn" , equalTo (null ))
140- .body ("data.notifications [1].type" , equalTo (CREATEDV .toString ()))
141- .body ("data.notifications [1].reasonForReturn" , equalTo (null ))
142- .body ("data.notifications [2].type" , equalTo (CREATEACC .toString ()))
143- .body ("data.notifications [2].reasonForReturn" , equalTo (null ))
138+ .body ("data[0].type" , equalTo (SUBMITTEDDS .toString ()))
139+ .body ("data[0].reasonForReturn" , equalTo (null ))
140+ .body ("data[1].type" , equalTo (CREATEDV .toString ()))
141+ .body ("data[1].reasonForReturn" , equalTo (null ))
142+ .body ("data[2].type" , equalTo (CREATEACC .toString ()))
143+ .body ("data[2].reasonForReturn" , equalTo (null ))
144144 .statusCode (OK .getStatusCode ());
145145
146146 // Joe Random, a user with no perms on dataset, tries returning the dataset as if he's a curator and fails.
@@ -305,11 +305,11 @@ public void testCuratorSendsCommentsToAuthor() {
305305 Response authorChecksForCommentsAgain = UtilIT .getNotifications (authorApiToken );
306306 authorChecksForCommentsAgain .prettyPrint ();
307307 authorChecksForCommentsAgain .then ().assertThat ()
308- .body ("data.notifications [0].type" , equalTo (RETURNEDDS .toString ()))
308+ .body ("data[0].type" , equalTo (RETURNEDDS .toString ()))
309309 // The author thinks, "This why we have curators!"
310- //.body("data.notifications [0].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
311- .body ("data.notifications [1].type" , equalTo (CREATEACC .toString ()))
312- //.body("data.notifications [1].reasonsForReturn", equalTo(null))
310+ //.body("data[0].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
311+ .body ("data[1].type" , equalTo (CREATEACC .toString ()))
312+ //.body("data[1].reasonsForReturn", equalTo(null))
313313 .statusCode (OK .getStatusCode ());
314314
315315 // The author upload the file she forgot.
@@ -333,15 +333,15 @@ public void testCuratorSendsCommentsToAuthor() {
333333 curatorChecksNotifications .prettyPrint ();
334334 curatorChecksNotifications .then ().assertThat ()
335335 // TODO: Test this issue from the UI as well: https://github.com/IQSS/dataverse/issues/2526
336- .body ("data.notifications [0].type" , equalTo (SUBMITTEDDS .toString ()))
337- //.body("data.notifications [0].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
338- .body ("data.notifications [1].type" , equalTo (INGESTCOMPLETED .toString ()))
339- .body ("data.notifications [2].type" , equalTo (SUBMITTEDDS .toString ()))
336+ .body ("data[0].type" , equalTo (SUBMITTEDDS .toString ()))
337+ //.body("data[0].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
338+ .body ("data[1].type" , equalTo (INGESTCOMPLETED .toString ()))
339+ .body ("data[2].type" , equalTo (SUBMITTEDDS .toString ()))
340340 // Yes, it's a little weird that the first "SUBMITTEDDS" notification now shows the return reason when it showed nothing before. For now we are simply always showing all the reasons for return. They start to stack up. That way you can see the history.
341- //.body("data.notifications [1].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
342- .body ("data.notifications [3].type" , equalTo (CREATEDV .toString ()))
343- .body ("data.notifications [4].type" , equalTo (CREATEACC .toString ()))
344- //.body("data.notifications [2].reasonsForReturn", equalTo(null))
341+ //.body("data[1].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
342+ .body ("data[3].type" , equalTo (CREATEDV .toString ()))
343+ .body ("data[4].type" , equalTo (CREATEACC .toString ()))
344+ //.body("data[2].reasonsForReturn", equalTo(null))
345345 .statusCode (OK .getStatusCode ());
346346
347347 String reasonForReturn2 = "A README is required." ;
@@ -355,15 +355,15 @@ public void testCuratorSendsCommentsToAuthor() {
355355 Response authorChecksForComments3 = UtilIT .getNotifications (authorApiToken );
356356 authorChecksForComments3 .prettyPrint ();
357357 authorChecksForComments3 .then ().assertThat ()
358- .body ("data.notifications [0].type" , equalTo (RETURNEDDS .toString ()))
359- // .body("data.notifications [0].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
360- //.body("data.notifications [0].reasonsForReturn[1].message", equalTo("A README is required."))
361- .body ("data.notifications [1].type" , equalTo (RETURNEDDS .toString ()))
358+ .body ("data[0].type" , equalTo (RETURNEDDS .toString ()))
359+ // .body("data[0].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
360+ //.body("data[0].reasonsForReturn[1].message", equalTo("A README is required."))
361+ .body ("data[1].type" , equalTo (RETURNEDDS .toString ()))
362362 // Yes, it's a little weird that the reason for return on the first "RETURNEDDS" changed. We're showing the history.
363- // .body("data.notifications [1].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
364- // .body("data.notifications [1].reasonsForReturn[1].message", equalTo("A README is required."))
365- .body ("data.notifications [2].type" , equalTo (CREATEACC .toString ()))
366- // .body("data.notifications [2].reasonsForReturn", equalTo(null))
363+ // .body("data[1].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
364+ // .body("data[1].reasonsForReturn[1].message", equalTo("A README is required."))
365+ .body ("data[2].type" , equalTo (CREATEACC .toString ()))
366+ // .body("data[2].reasonsForReturn", equalTo(null))
367367 .statusCode (OK .getStatusCode ());
368368
369369 String pathToReadme = "README.md" ;
@@ -386,20 +386,20 @@ public void testCuratorSendsCommentsToAuthor() {
386386 curatorHopesTheReadmeIsThereNow .prettyPrint ();
387387 curatorHopesTheReadmeIsThereNow .then ().assertThat ()
388388 // TODO: Test this issue from the UI as well: https://github.com/IQSS/dataverse/issues/2526
389- .body ("data.notifications [0].type" , equalTo (SUBMITTEDDS .toString ()))
390- // .body("data.notifications [0].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
391- // .body("data.notifications [0].reasonsForReturn[1].message", equalTo("A README is required."))
392- .body ("data.notifications [1].type" , equalTo (SUBMITTEDDS .toString ()))
393- // .body("data.notifications [1].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
394- // .body("data.notifications [1].reasonsForReturn[1].message", equalTo("A README is required."))
395- .body ("data.notifications [2].type" , equalTo (INGESTCOMPLETED .toString ()))
396- .body ("data.notifications [3].type" , equalTo (SUBMITTEDDS .toString ()))
389+ .body ("data[0].type" , equalTo (SUBMITTEDDS .toString ()))
390+ // .body("data[0].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
391+ // .body("data[0].reasonsForReturn[1].message", equalTo("A README is required."))
392+ .body ("data[1].type" , equalTo (SUBMITTEDDS .toString ()))
393+ // .body("data[1].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
394+ // .body("data[1].reasonsForReturn[1].message", equalTo("A README is required."))
395+ .body ("data[2].type" , equalTo (INGESTCOMPLETED .toString ()))
396+ .body ("data[3].type" , equalTo (SUBMITTEDDS .toString ()))
397397 // Yes, it's a little weird that the first "SUBMITTEDDS" notification now shows the return reason when it showed nothing before. We're showing the history.
398- // .body("data.notifications [2].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
399- // .body("data.notifications [2].reasonsForReturn[1].message", equalTo("A README is required."))
400- .body ("data.notifications [4].type" , equalTo (CREATEDV .toString ()))
401- .body ("data.notifications [5].type" , equalTo (CREATEACC .toString ()))
402- // .body("data.notifications [3].reasonsForReturn", equalTo(null))
398+ // .body("data[2].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
399+ // .body("data[2].reasonsForReturn[1].message", equalTo("A README is required."))
400+ .body ("data[4].type" , equalTo (CREATEDV .toString ()))
401+ .body ("data[5].type" , equalTo (CREATEACC .toString ()))
402+ // .body("data[3].reasonsForReturn", equalTo(null))
403403 .statusCode (OK .getStatusCode ());
404404
405405 // The curator publishes the dataverse.
@@ -417,16 +417,16 @@ public void testCuratorSendsCommentsToAuthor() {
417417 Response authorsChecksForCommentsPostPublication = UtilIT .getNotifications (authorApiToken );
418418 authorsChecksForCommentsPostPublication .prettyPrint ();
419419 authorsChecksForCommentsPostPublication .then ().assertThat ()
420- .body ("data.notifications [0].type" , equalTo (PUBLISHEDDS .toString ()))
421- .body ("data.notifications [1].type" , equalTo (RETURNEDDS .toString ()))
422- // .body("data.notifications [1].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
423- // .body("data.notifications [1].reasonsForReturn[1].message", equalTo("A README is required."))
424- .body ("data.notifications [2].type" , equalTo (RETURNEDDS .toString ()))
420+ .body ("data[0].type" , equalTo (PUBLISHEDDS .toString ()))
421+ .body ("data[1].type" , equalTo (RETURNEDDS .toString ()))
422+ // .body("data[1].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
423+ // .body("data[1].reasonsForReturn[1].message", equalTo("A README is required."))
424+ .body ("data[2].type" , equalTo (RETURNEDDS .toString ()))
425425 // Yes, it's a little weird that the reason for return on the first "RETURNEDDS" changed. For now we are always showing the most recent reason for return.
426- // .body("data.notifications [2].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
427- //.body("data.notifications [2].reasonsForReturn[1].message", equalTo("A README is required."))
428- .body ("data.notifications [3].type" , equalTo (CREATEACC .toString ()))
429- // .body("data.notifications [3].reasonsForReturn", equalTo(null))
426+ // .body("data[2].reasonsForReturn[0].message", equalTo("You forgot to upload any files."))
427+ //.body("data[2].reasonsForReturn[1].message", equalTo("A README is required."))
428+ .body ("data[3].type" , equalTo (CREATEACC .toString ()))
429+ // .body("data[3].reasonsForReturn", equalTo(null))
430430 .statusCode (OK .getStatusCode ());
431431
432432 // These println's are here in case you want to log into the GUI to see what notifications look like.
0 commit comments