Merge "Test that implicitly CCing a user without username works"
This commit is contained in:
@@ -1558,9 +1558,20 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
|
||||
@Test
|
||||
public void implicitlyCcOnNonVotingReviewPgStyle() throws Exception {
|
||||
testImplicitlyCcOnNonVotingReviewPgStyle(user);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void implicitlyCcOnNonVotingReviewForUserWithoutUserNamePgStyle() throws Exception {
|
||||
TestAccount accountWithoutUsername = accountCreator.create();
|
||||
assertThat(accountWithoutUsername.username).isNull();
|
||||
testImplicitlyCcOnNonVotingReviewPgStyle(accountWithoutUsername);
|
||||
}
|
||||
|
||||
private void testImplicitlyCcOnNonVotingReviewPgStyle(TestAccount testAccount) throws Exception {
|
||||
PushOneCommit.Result r = createChange();
|
||||
setApiUser(user);
|
||||
assertThat(getReviewerState(r.getChangeId(), user.id)).isEmpty();
|
||||
setApiUser(testAccount);
|
||||
assertThat(getReviewerState(r.getChangeId(), testAccount.id)).isEmpty();
|
||||
|
||||
// Exact request format made by PG UI at ddc6b7160fe416fed9e7e3180489d44c82fd64f8.
|
||||
ReviewInput in = new ReviewInput();
|
||||
@@ -1571,15 +1582,26 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
gApi.changes().id(r.getChangeId()).revision(r.getCommit().name()).review(in);
|
||||
|
||||
// If we're not reading from NoteDb, then the CCed user will be returned in the REVIEWER state.
|
||||
assertThat(getReviewerState(r.getChangeId(), user.id))
|
||||
assertThat(getReviewerState(r.getChangeId(), testAccount.id))
|
||||
.hasValue(notesMigration.readChanges() ? CC : REVIEWER);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void implicitlyCcOnNonVotingReviewGwtStyle() throws Exception {
|
||||
testImplicitlyCcOnNonVotingReviewGwtStyle(user);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void implicitlyCcOnNonVotingReviewForUserWithoutUserNameGwtStyle() throws Exception {
|
||||
TestAccount accountWithoutUsername = accountCreator.create();
|
||||
assertThat(accountWithoutUsername.username).isNull();
|
||||
testImplicitlyCcOnNonVotingReviewGwtStyle(accountWithoutUsername);
|
||||
}
|
||||
|
||||
private void testImplicitlyCcOnNonVotingReviewGwtStyle(TestAccount testAccount) throws Exception {
|
||||
PushOneCommit.Result r = createChange();
|
||||
setApiUser(user);
|
||||
assertThat(getReviewerState(r.getChangeId(), user.id)).isEmpty();
|
||||
setApiUser(testAccount);
|
||||
assertThat(getReviewerState(r.getChangeId(), testAccount.id)).isEmpty();
|
||||
|
||||
// Exact request format made by GWT UI at ddc6b7160fe416fed9e7e3180489d44c82fd64f8.
|
||||
ReviewInput in = new ReviewInput();
|
||||
@@ -1589,7 +1611,7 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
gApi.changes().id(r.getChangeId()).revision(r.getCommit().name()).review(in);
|
||||
|
||||
// If we're not reading from NoteDb, then the CCed user will be returned in the REVIEWER state.
|
||||
assertThat(getReviewerState(r.getChangeId(), user.id))
|
||||
assertThat(getReviewerState(r.getChangeId(), testAccount.id))
|
||||
.hasValue(notesMigration.readChanges() ? CC : REVIEWER);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user