Add ready property to ReviewResult
This is particularly needed for transitioning PolyGerrit to use this new API. We can use this property to determine immediately upon receiving a response to posting a review whether we need to fall back to a second API call to start review. Bug: Issue 6760 Change-Id: Ib0ef5f5a0d454de4cd4b9496ab1cf81dba729a99
This commit is contained in:
@@ -510,7 +510,8 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
assertThat(r.getChange().change().isWorkInProgress()).isTrue();
|
||||
|
||||
ReviewInput in = ReviewInput.noScore().setWorkInProgress(false);
|
||||
gApi.changes().id(r.getChangeId()).revision("current").review(in);
|
||||
ReviewResult result = gApi.changes().id(r.getChangeId()).revision("current").review(in);
|
||||
assertThat(result.ready).isTrue();
|
||||
|
||||
ChangeInfo info = gApi.changes().id(r.getChangeId()).get();
|
||||
assertThat(info.workInProgress).isNull();
|
||||
@@ -523,7 +524,8 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
assertThat(r.getChange().change().isWorkInProgress()).isFalse();
|
||||
|
||||
ReviewInput in = ReviewInput.noScore().setWorkInProgress(true);
|
||||
gApi.changes().id(r.getChangeId()).revision("current").review(in);
|
||||
ReviewResult result = gApi.changes().id(r.getChangeId()).revision("current").review(in);
|
||||
assertThat(result.ready).isNull();
|
||||
|
||||
ChangeInfo info = gApi.changes().id(r.getChangeId()).get();
|
||||
assertThat(info.workInProgress).isTrue();
|
||||
|
||||
Reference in New Issue
Block a user