Adapt test for adding multiple reviewers to change in Gerrit core

When multiple reviewers are added at once via the PostReview REST
endpoint Gerrit used to send out one event per newly added reviewer, but
now it sends out only one event which contains all newly added
reviewers.

The code-owners plugin listens to the add reviewer event to add a change
message that lists the paths that are owned by the new reviewers. Since
such an event was triggered for each of the newly added reviewers so
far, we ended up with one change message per reviewer. Now, with only
one batch event being sent out, we have only one change message that
lists the owned paths for all newly added reviewers.

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I1469d3cf69d7d23107b3962006f5df9377edb153
diff --git a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CodeOwnersOnAddReviewerIT.java b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CodeOwnersOnAddReviewerIT.java
index 1e94d2b..be7c50f 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CodeOwnersOnAddReviewerIT.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CodeOwnersOnAddReviewerIT.java
@@ -347,20 +347,18 @@
         .current()
         .review(ReviewInput.create().reviewer(user.email()).reviewer(user2.email()));
 
-    // We expect that 2 change messages are added:
-    // 1. change message listing the paths owned by the new reviewer 'user'
-    // 2. change message listing the paths owned by the new reviewer 'user2'
+    // We expect that 1 change message is added that lists the path owned for each of the new
+    // reviewers ('user' and 'user2').
     Collection<ChangeMessageInfo> messages = gApi.changes().id(changeId).get().messages;
-    assertThat(Iterables.get(messages, messages.size() - 2).message)
-        .isEqualTo(
-            String.format(
-                "%s, who was added as reviewer owns the following files:\n* %s\n",
-                AccountTemplateUtil.getAccountTemplate(user.id()), path));
     assertThat(Iterables.getLast(messages).message)
         .isEqualTo(
             String.format(
-                "%s, who was added as reviewer owns the following files:\n* %s\n",
-                AccountTemplateUtil.getAccountTemplate(user2.id()), path));
+                "%s, who was added as reviewer owns the following files:\n* %s\n\n"
+                    + "%s, who was added as reviewer owns the following files:\n* %s\n",
+                AccountTemplateUtil.getAccountTemplate(user.id()),
+                path,
+                AccountTemplateUtil.getAccountTemplate(user2.id()),
+                path));
   }
 
   @Test