Replace deprecated ChangeApi#comments
Change-Id: I3532636f082409b956c6da06d58699ac8089b6c3
This commit is contained in:
committed by
Luca Milanesio
parent
605ba11bc9
commit
d6340b481c
@@ -1557,7 +1557,8 @@ public abstract class AbstractDaemonTest {
|
||||
|
||||
protected List<CommentInfo> getChangeSortedComments(int changeNum) throws Exception {
|
||||
List<CommentInfo> comments = new ArrayList<>();
|
||||
Map<String, List<CommentInfo>> commentsMap = gApi.changes().id(changeNum).comments();
|
||||
Map<String, List<CommentInfo>> commentsMap =
|
||||
gApi.changes().id(changeNum).commentsRequest().get();
|
||||
for (Map.Entry<String, List<CommentInfo>> e : commentsMap.entrySet()) {
|
||||
for (CommentInfo c : e.getValue()) {
|
||||
c.path = e.getKey(); // Set the comment's path field.
|
||||
|
||||
@@ -65,7 +65,7 @@ public class TestCommentHelper {
|
||||
}
|
||||
|
||||
public Collection<CommentInfo> 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());
|
||||
}
|
||||
|
||||
@@ -3769,7 +3769,7 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
.startsWith(subject);
|
||||
|
||||
List<CommentInfo> 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -2731,7 +2731,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest {
|
||||
}
|
||||
|
||||
private Collection<CommentInfo> 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());
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -459,7 +459,7 @@ public class MailProcessorIT extends AbstractMailIT {
|
||||
private ImmutableSet<CommentInfo> 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());
|
||||
|
||||
Reference in New Issue
Block a user