use of com.google.gerrit.extensions.common.ChangeInfo in project gerrit by GerritCodeReview.
the class CreateChangeIT method createNewChangeSignedOffByFooter.
@Test
public void createNewChangeSignedOffByFooter() throws Exception {
setSignedOffByFooter(true);
try {
ChangeInfo info = assertCreateSucceeds(newChangeInput(ChangeStatus.NEW));
String message = info.revisions.get(info.currentRevision).commit.message;
assertThat(message).contains(String.format("%sAdministrator <%s>", SIGNED_OFF_BY_TAG, admin.newIdent().getEmailAddress()));
} finally {
setSignedOffByFooter(false);
}
}
use of com.google.gerrit.extensions.common.ChangeInfo in project gerrit by GerritCodeReview.
the class CreateChangeIT method createAuthorAddedAsCcAndNotified.
@Test
public void createAuthorAddedAsCcAndNotified() throws Exception {
ChangeInput input = newChangeInput(ChangeStatus.NEW);
input.author = new AccountInput();
input.author.email = user.email();
input.author.name = user.fullName();
ChangeInfo info = assertCreateSucceeds(input);
assertThat(info.reviewers.get(ReviewerState.CC)).hasSize(1);
assertThat(Iterables.getOnlyElement(info.reviewers.get(ReviewerState.CC)).email).isEqualTo(user.email());
assertThat(Iterables.getOnlyElement(Iterables.getOnlyElement(sender.getMessages()).rcpt()).email()).isEqualTo(user.email());
}
use of com.google.gerrit.extensions.common.ChangeInfo in project gerrit by GerritCodeReview.
the class PrivateByDefaultIT method createChangeWithPrivateByDefaultInherited.
@Test
public void createChangeWithPrivateByDefaultInherited() throws Exception {
setPrivateByDefault(project1, InheritableBoolean.TRUE);
ChangeInfo info = gApi.changes().create(new ChangeInput(project2.get(), "master", "empty change")).get();
assertThat(info.isPrivate).isTrue();
}
use of com.google.gerrit.extensions.common.ChangeInfo in project gerrit by GerritCodeReview.
the class SubmitByCherryPickIT method submitDependentConflictingChangesOutOfOrder.
@Test
public void submitDependentConflictingChangesOutOfOrder() throws Throwable {
RevCommit initialHead = projectOperations.project(project).getHead("master");
testRepo.reset(initialHead);
PushOneCommit.Result change = createChange("Change 1", "b", "b1");
PushOneCommit.Result change2 = createChange("Change 2", "b", "b2");
assertThat(change2.getCommit().getParent(0)).isEqualTo(change.getCommit());
// Submit fails; change2 contains the delta "b1" -> "b2", which cannot be
// applied against tip.
submitWithConflict(change2.getChangeId(), "Failed to submit 1 change due to the following problems:\n" + "Change " + change2.getChange().getId() + ": Change could not be " + "merged due to a path conflict. Please rebase the change locally and " + "upload the rebased commit for review.");
ChangeInfo info3 = get(change2.getChangeId(), ListChangesOption.MESSAGES);
assertThat(info3.status).isEqualTo(ChangeStatus.NEW);
// Tip has not changed.
List<RevCommit> log = getRemoteLog();
assertThat(log.get(0)).isEqualTo(initialHead.getId());
assertNoSubmitter(change2.getChangeId(), 1);
assertRefUpdatedEvents();
assertChangeMergedEvents();
}
use of com.google.gerrit.extensions.common.ChangeInfo in project gerrit by GerritCodeReview.
the class CreateChangeIT method createNewChangeWithCommentsInCommitMessage.
@Test
public void createNewChangeWithCommentsInCommitMessage() throws Exception {
ChangeInput ci = newChangeInput(ChangeStatus.NEW);
ci.subject += "\n# Comment line";
ChangeInfo info = gApi.changes().create(ci).get();
assertThat(info.revisions.get(info.currentRevision).commit.message).doesNotContain("# Comment line");
}
Aggregations