use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class CreateChangeIT method createChangeWithParentCommitOnWrongBranchFails.
@Test
public void createChangeWithParentCommitOnWrongBranchFails() throws Exception {
Map<String, PushOneCommit.Result> setup = changeInTwoBranches("foo", "foo.txt", "bar", "bar.txt");
ChangeInput input = newChangeInput(ChangeStatus.NEW);
input.branch = "foo";
input.baseCommit = setup.get("bar").getCommit().getId().name();
assertCreateFails(input, BadRequestException.class, String.format("Commit %s doesn't exist on ref refs/heads/foo", input.baseCommit));
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class CreateChangeIT method newChangeInput.
private ChangeInput newChangeInput(ChangeStatus status) {
ChangeInput in = new ChangeInput();
in.project = project.get();
in.branch = "master";
in.subject = "Empty change";
in.topic = "support-gerrit-workflow-in-browser";
in.status = status;
return in;
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class CreateChangeIT method createAuthorAddedAsCcNotNotifiedWithNotifyNone.
@Test
public void createAuthorAddedAsCcNotNotifiedWithNotifyNone() throws Exception {
ChangeInput input = newChangeInput(ChangeStatus.NEW);
input.author = new AccountInput();
input.author.email = user.email();
input.author.name = user.fullName();
input.notify = NotifyHandling.NONE;
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(sender.getMessages()).isEmpty();
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class CreateChangeIT method invalidStrategy.
@Test
public void invalidStrategy() throws Exception {
changeInTwoBranches("branchA", "a.txt", "branchB", "b.txt");
ChangeInput in = newMergeChangeInput("branchA", "branchB", "octopus");
assertCreateFails(in, BadRequestException.class, "invalid merge strategy: octopus");
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class CreateChangeIT method createChangeWithNonExistingParentCommitFails.
@Test
public void createChangeWithNonExistingParentCommitFails() throws Exception {
ChangeInput input = newChangeInput(ChangeStatus.NEW);
input.baseCommit = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef";
assertCreateFails(input, UnprocessableEntityException.class, String.format("Base %s doesn't exist", input.baseCommit));
}
Aggregations