use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class AutoMergeIT method autoMergeCreatedWhenNewPatchSetCreatedOnApi.
@Test
public void autoMergeCreatedWhenNewPatchSetCreatedOnApi() throws Exception {
ChangeInput ci = new ChangeInput(project.get(), "master", "Merge commit");
ci.merge = new MergeInput();
ci.merge.source = parent1.name();
String changeId = gApi.changes().create(ci).get().changeId;
gApi.changes().id(changeId).setMessage("New Commit Message\n\nChange-Id: " + changeId);
assertThat(gApi.changes().id(changeId).get().revisions.size()).isEqualTo(2);
String newChangePatchSetSha1 = gApi.changes().id(changeId).get().currentRevision;
assertAutoMergeCreated(ObjectId.fromString(newChangePatchSetSha1));
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class AutoMergeIT method autoMergeCreatedWhenChangeCreatedOnApi.
@Test
public void autoMergeCreatedWhenChangeCreatedOnApi() throws Exception {
ChangeInput ci = new ChangeInput(project.get(), "master", "Merge commit");
ci.merge = new MergeInput();
ci.merge.source = parent1.name();
String newChangePatchSetSha1 = gApi.changes().create(ci).get().currentRevision;
assertAutoMergeCreated(ObjectId.fromString(newChangePatchSetSha1));
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class WorkInProgressByDefaultIT method createChangeBypassWorkInProgressByDefaultForProjectEnabled.
@Test
public void createChangeBypassWorkInProgressByDefaultForProjectEnabled() throws Exception {
Project.NameKey project = projectOperations.newProject().create();
setWorkInProgressByDefaultForProject(project);
ChangeInput input = new ChangeInput(project.get(), "master", "empty change");
input.workInProgress = false;
assertThat(gApi.changes().create(input).get().workInProgress).isNull();
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class WorkInProgressByDefaultIT method createChangeBypassWorkInProgressByDefaultForUserEnabled.
@Test
public void createChangeBypassWorkInProgressByDefaultForUserEnabled() throws Exception {
Project.NameKey project = projectOperations.newProject().create();
setWorkInProgressByDefaultForUser();
ChangeInput input = new ChangeInput(project.get(), "master", "empty change");
input.workInProgress = false;
assertThat(gApi.changes().create(input).get().workInProgress).isNull();
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class WorkInProgressByDefaultIT method createChangeWithWorkInProgressByDefaultForUserEnabled.
@Test
public void createChangeWithWorkInProgressByDefaultForUserEnabled() throws Exception {
Project.NameKey project = projectOperations.newProject().create();
setWorkInProgressByDefaultForUser();
ChangeInput input = new ChangeInput(project.get(), "master", "empty change");
assertThat(gApi.changes().create(input).get().workInProgress).isTrue();
}
Aggregations