use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class CreateChangeIT method createChangeOnInvisibleBranchFails.
@Test
public void createChangeOnInvisibleBranchFails() throws Exception {
changeInTwoBranches("invisible-branch", "a.txt", "branchB", "b.txt");
block(project, "refs/heads/invisible-branch", READ, REGISTERED_USERS);
ChangeInput in = newChangeInput(ChangeStatus.NEW);
in.branch = "invisible-branch";
assertCreateFails(in, AuthException.class, "cannot upload review");
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class AgreementsIT method newChangeInput.
private ChangeInput newChangeInput() {
ChangeInput in = new ChangeInput();
in.branch = "master";
in.subject = "test";
in.project = project.get();
return in;
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class ChangeIdIT method projectChangeNumberReturnsChangeWhenProjectContainsSlashes.
@Test
public void projectChangeNumberReturnsChangeWhenProjectContainsSlashes() throws Exception {
Project.NameKey p = projectOperations.newProject().create();
ChangeInfo ci = gApi.changes().create(new ChangeInput(p.get(), "master", "msg")).get();
ChangeApi cApi = gApi.changes().id(p.get(), ci._number);
assertThat(cApi.get().changeId).isEqualTo(ci.changeId);
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class ChangeIdIT method changeIdReturnsChange.
@Test
public void changeIdReturnsChange() throws Exception {
// ChangeId is not unique and this method needs a unique changeId to work.
// Hence we generate a new change with a different content.
ChangeInfo ci = gApi.changes().create(new ChangeInput(project.get(), "master", "different message")).get();
ChangeApi cApi = gApi.changes().id(ci.changeId);
assertThat(cApi.get()._number).isEqualTo(ci._number);
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class DisablePrivateChangesIT method createPrivateChangeWithDisablePrivateChangesTrue.
@Test
@GerritConfig(name = "change.disablePrivateChanges", value = "true")
public void createPrivateChangeWithDisablePrivateChangesTrue() throws Exception {
ChangeInput input = new ChangeInput(project.get(), "master", "empty change");
input.isPrivate = true;
MethodNotAllowedException thrown = assertThrows(MethodNotAllowedException.class, () -> gApi.changes().create(input));
assertThat(thrown).hasMessageThat().contains("private changes are disabled");
}
Aggregations