use of com.google.gerrit.server.AssigneeStatusUpdate in project gerrit by GerritCodeReview.
the class ChangeNotesTest method assigneeStatusUpdateChangeNotes.
@Test
public void assigneeStatusUpdateChangeNotes() throws Exception {
Change c = newChange();
ChangeUpdate update = newUpdate(c, otherUser);
update.setAssignee(otherUserId);
update.commit();
update = newUpdate(c, changeOwner);
update.removeAssignee();
update.commit();
update = newUpdate(c, changeOwner);
update.setAssignee(changeOwner.getAccountId());
update.commit();
update = newUpdate(c, changeOwner);
update.setAssignee(otherUserId);
update.commit();
ChangeNotes notes = newNotes(c);
ImmutableList<AssigneeStatusUpdate> statusUpdates = notes.getAssigneeUpdates();
assertThat(statusUpdates).hasSize(4);
assertThat(statusUpdates.get(3).updatedBy()).isEqualTo(otherUserId);
assertThat(statusUpdates.get(3).currentAssignee()).hasValue(otherUserId);
assertThat(statusUpdates.get(2).currentAssignee()).isEmpty();
assertThat(statusUpdates.get(1).currentAssignee()).hasValue(changeOwner.getAccountId());
assertThat(statusUpdates.get(0).currentAssignee()).hasValue(otherUserId);
}
Aggregations