use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class PrivateByDefaultIT method createChangeWithPrivateByDefaultEnabled.
@Test
public void createChangeWithPrivateByDefaultEnabled() throws Exception {
setPrivateByDefault(project2, InheritableBoolean.TRUE);
ChangeInput input = new ChangeInput(project2.get(), "master", "empty change");
assertThat(gApi.changes().create(input).get().isPrivate).isTrue();
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class PrivateByDefaultIT method createChangeBypassPrivateByDefaultEnabled.
@Test
public void createChangeBypassPrivateByDefaultEnabled() throws Exception {
setPrivateByDefault(project2, InheritableBoolean.TRUE);
ChangeInput input = new ChangeInput(project2.get(), "master", "empty change");
input.isPrivate = false;
assertThat(gApi.changes().create(input).get().isPrivate).isNull();
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class CreateChangeIT method createEmptyChange_MissingBranch.
@Test
public void createEmptyChange_MissingBranch() throws Exception {
ChangeInput ci = new ChangeInput();
ci.project = project.get();
assertCreateFails(ci, BadRequestException.class, "branch must be non-empty");
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class CreateChangeIT method createEmptyChange_MissingMessage.
@Test
public void createEmptyChange_MissingMessage() throws Exception {
ChangeInput ci = new ChangeInput();
ci.project = project.get();
ci.branch = "master";
assertCreateFails(ci, BadRequestException.class, "commit message must be non-empty");
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class CreateChangeIT method canCreateChangeOnRefsMetaConfig.
@Test
public void canCreateChangeOnRefsMetaConfig() throws Exception {
requestScopeOperations.setApiUser(admin.id());
projectOperations.project(project).forUpdate().add(allow(CREATE).ref("refs/*").group(REGISTERED_USERS)).add(allow(READ).ref("refs/meta/config").group(REGISTERED_USERS)).update();
requestScopeOperations.setApiUser(user.id());
ChangeInput ci = newChangeInput(ChangeStatus.NEW);
ci.subject = "Subject";
ci.branch = RefNames.REFS_CONFIG;
assertThat(gApi.changes().create(ci).info().branch).isEqualTo(RefNames.REFS_CONFIG);
}
Aggregations