use of com.google.gerrit.entities.ChangeMessage in project gerrit by GerritCodeReview.
the class ChangeNotesTest method changeMessageWithTemplate.
@Test
public void changeMessageWithTemplate() throws Exception {
Change c = newChange();
ChangeUpdate update = newUpdate(c, changeOwner);
update.putReviewer(changeOwner.getAccount().id(), REVIEWER);
String messageTemplate = String.format("Change update by %s, also includes %s", AccountTemplateUtil.getAccountTemplate(changeOwner.getAccountId()), AccountTemplateUtil.getAccountTemplate(otherUser.getAccountId()));
update.setChangeMessage(messageTemplate);
update.commit();
ChangeNotes notes = newNotes(c);
ChangeMessage cm = Iterables.getOnlyElement(notes.getChangeMessages());
assertThat(cm.getMessage()).isEqualTo(messageTemplate);
}
Aggregations