use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class AbstractSubmit method submitEmptyCommitPatchSetCanFastForward_emptyCommitAllowed.
@Test
@TestProjectInput(rejectEmptyCommit = InheritableBoolean.FALSE)
public void submitEmptyCommitPatchSetCanFastForward_emptyCommitAllowed() throws Throwable {
ChangeInput ci = new ChangeInput();
ci.subject = "Empty change";
ci.project = project.get();
ci.branch = "master";
ChangeApi change = gApi.changes().create(ci);
approve(change.id());
change.current().submit();
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class ChangeIT method createWipChangeWithWorkInProgressByDefaultForProject.
@Test
public void createWipChangeWithWorkInProgressByDefaultForProject() throws Exception {
ConfigInput input = new ConfigInput();
input.workInProgressByDefault = InheritableBoolean.TRUE;
gApi.projects().name(project.get()).config(input);
String changeId = gApi.changes().create(new ChangeInput(project.get(), "master", "Test Change")).get().id;
assertThat(gApi.changes().id(changeId).get().workInProgress).isTrue();
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class ChangeIT method createEmptyChangeOnExistingBranchWithNewBranch.
@Test
public void createEmptyChangeOnExistingBranchWithNewBranch() throws Exception {
ChangeInput in = new ChangeInput();
in.branch = Constants.MASTER;
in.subject = "Create a change on new branch from the API";
in.project = project.get();
in.newBranch = true;
assertThrows(ResourceConflictException.class, () -> gApi.changes().create(in).get());
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class ChangeIT method setWorkInProgressAllowedAsAdmin.
@Test
public void setWorkInProgressAllowedAsAdmin() throws Exception {
requestScopeOperations.setApiUser(user.id());
String changeId = gApi.changes().create(new ChangeInput(project.get(), "master", "Test Change")).get().id;
requestScopeOperations.setApiUser(admin.id());
gApi.changes().id(changeId).setWorkInProgress();
assertThat(gApi.changes().id(changeId).get().workInProgress).isTrue();
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class ChangeIT method setReadyForReviewAllowedAsAdmin.
@Test
public void setReadyForReviewAllowedAsAdmin() throws Exception {
requestScopeOperations.setApiUser(user.id());
String changeId = gApi.changes().create(new ChangeInput(project.get(), "master", "Test Change")).get().id;
gApi.changes().id(changeId).setWorkInProgress();
requestScopeOperations.setApiUser(admin.id());
gApi.changes().id(changeId).setReadyForReview();
assertThat(gApi.changes().id(changeId).get().workInProgress).isNull();
}
Aggregations