commit d6340b481c27a3e8587cc54c6d1ac9c83a5e7cb1 Author: Matthias Sohn Date: Sun Oct 11 09:23:21 2020 +0200 Replace deprecated ChangeApi#comments Change-Id: I3532636f082409b956c6da06d58699ac8089b6c3 diff --git a/java/com/google/gerrit/acceptance/AbstractDaemonTest.java b/java/com/google/gerrit/acceptance/AbstractDaemonTest.java index c35c9c2..4ab5d51 100644 --- a/java/com/google/gerrit/acceptance/AbstractDaemonTest.java +++ b/java/com/google/gerrit/acceptance/AbstractDaemonTest.java @@ -1557,7 +1557,8 @@ public abstract class AbstractDaemonTest { protected List getChangeSortedComments(int changeNum) throws Exception { List comments = new ArrayList<>(); - Map> commentsMap = gApi.changes().id(changeNum).comments(); + Map> commentsMap = + gApi.changes().id(changeNum).commentsRequest().get(); for (Map.Entry> e : commentsMap.entrySet()) { for (CommentInfo c : e.getValue()) { c.path = e.getKey(); // Set the comment's path field. diff --git a/java/com/google/gerrit/testing/TestCommentHelper.java b/java/com/google/gerrit/testing/TestCommentHelper.java index da8f871..5865a3c 100644 --- a/java/com/google/gerrit/testing/TestCommentHelper.java +++ b/java/com/google/gerrit/testing/TestCommentHelper.java @@ -65,7 +65,7 @@ public class TestCommentHelper { } public Collection getPublishedComments(String changeId) throws Exception { - return gApi.changes().id(changeId).comments().values().stream() + return gApi.changes().id(changeId).commentsRequest().get().values().stream() .flatMap(Collection::stream) .collect(toList()); } diff --git a/javatests/com/google/gerrit/acceptance/api/change/ChangeIT.java b/javatests/com/google/gerrit/acceptance/api/change/ChangeIT.java index 298aa5d..496a2b4 100644 --- a/javatests/com/google/gerrit/acceptance/api/change/ChangeIT.java +++ b/javatests/com/google/gerrit/acceptance/api/change/ChangeIT.java @@ -3769,7 +3769,7 @@ public class ChangeIT extends AbstractDaemonTest { .startsWith(subject); List comments = - Iterables.getOnlyElement(gApi.changes().id(id).comments().values()); + Iterables.getOnlyElement(gApi.changes().id(id).commentsRequest().get().values()); assertThat(Iterables.getOnlyElement(comments).message).isEqualTo(ci.message); } diff --git a/javatests/com/google/gerrit/acceptance/git/AbstractPushForReview.java b/javatests/com/google/gerrit/acceptance/git/AbstractPushForReview.java index e994d03..e153ff8 100644 --- a/javatests/com/google/gerrit/acceptance/git/AbstractPushForReview.java +++ b/javatests/com/google/gerrit/acceptance/git/AbstractPushForReview.java @@ -2731,7 +2731,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { } private Collection getPublishedComments(String changeId) throws Exception { - return gApi.changes().id(changeId).comments().values().stream() + return gApi.changes().id(changeId).commentsRequest().get().values().stream() .flatMap(Collection::stream) .collect(toList()); } diff --git a/javatests/com/google/gerrit/acceptance/rest/account/ImpersonationIT.java b/javatests/com/google/gerrit/acceptance/rest/account/ImpersonationIT.java index a11328f..5c596dc 100644 --- a/javatests/com/google/gerrit/acceptance/rest/account/ImpersonationIT.java +++ b/javatests/com/google/gerrit/acceptance/rest/account/ImpersonationIT.java @@ -506,7 +506,8 @@ public class ImpersonationIT extends AbstractDaemonTest { assertThat(m.author._accountId).isEqualTo(user.id().get()); CommentInfo c = - Iterables.getOnlyElement(gApi.changes().id(r.getChangeId()).comments().get(di.path)); + Iterables.getOnlyElement( + gApi.changes().id(r.getChangeId()).commentsRequest().get().get(di.path)); assertThat(c.author._accountId).isEqualTo(user.id().get()); assertThat(c.message).isEqualTo(di.message); diff --git a/javatests/com/google/gerrit/acceptance/server/mail/MailProcessorIT.java b/javatests/com/google/gerrit/acceptance/server/mail/MailProcessorIT.java index 4f79e09..5679c41 100644 --- a/javatests/com/google/gerrit/acceptance/server/mail/MailProcessorIT.java +++ b/javatests/com/google/gerrit/acceptance/server/mail/MailProcessorIT.java @@ -459,7 +459,7 @@ public class MailProcessorIT extends AbstractMailIT { private ImmutableSet getCommentsAndRobotComments(String changeId) throws RestApiException { return Streams.concat( - gApi.changes().id(changeId).comments().values().stream(), + gApi.changes().id(changeId).commentsRequest().get().values().stream(), gApi.changes().id(changeId).robotComments().values().stream()) .flatMap(Collection::stream) .collect(toImmutableSet());