use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class DisablePrivateChangesIT method createPrivateChangeWithDisablePrivateChangesFalse.
@Test
public void createPrivateChangeWithDisablePrivateChangesFalse() throws Exception {
ChangeInput input = new ChangeInput(project.get(), "master", "empty change");
input.isPrivate = true;
assertThat(gApi.changes().create(input).get().isPrivate).isTrue();
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class DisablePrivateChangesIT method createNonPrivateChangeWithDisablePrivateChangesTrue.
@Test
@GerritConfig(name = "change.disablePrivateChanges", value = "true")
public void createNonPrivateChangeWithDisablePrivateChangesTrue() throws Exception {
ChangeInput input = new ChangeInput(project.get(), "master", "empty change");
assertThat(gApi.changes().create(input).get().isPrivate).isNull();
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class ChangeEditIT method sha1sOfTwoChangesWithSameContentAfterEditDiffer.
@Test
public void sha1sOfTwoChangesWithSameContentAfterEditDiffer() throws Exception {
ChangeInput changeInput = new ChangeInput();
changeInput.project = project.get();
changeInput.branch = "master";
changeInput.subject = "Empty change";
changeInput.status = ChangeStatus.NEW;
ChangeInfo info1 = gApi.changes().create(changeInput).get();
gApi.changes().id(info1._number).edit().modifyFile(FILE_NAME, RawInputUtil.create(CONTENT_NEW));
gApi.changes().id(info1._number).edit().publish(new PublishChangeEditInput());
info1 = gApi.changes().id(info1._number).get();
ChangeInfo info2 = gApi.changes().create(changeInput).get();
gApi.changes().id(info2._number).edit().modifyFile(FILE_NAME, RawInputUtil.create(CONTENT_NEW));
gApi.changes().id(info2._number).edit().publish(new PublishChangeEditInput());
info2 = gApi.changes().id(info2._number).get();
assertThat(info1.currentRevision).isNotEqualTo(info2.currentRevision);
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class ChangeIT method createEmptyChangeOnNonExistingBranch.
@Test
public void createEmptyChangeOnNonExistingBranch() throws Exception {
ChangeInput in = new ChangeInput();
in.branch = "foo";
in.subject = "Create a change on new branch from the API";
in.project = project.get();
in.newBranch = true;
ChangeInfo info = gApi.changes().create(in).get();
assertThat(info.project).isEqualTo(in.project);
assertThat(RefNames.fullName(info.branch)).isEqualTo(RefNames.fullName(in.branch));
assertThat(info.subject).isEqualTo(in.subject);
assertThat(Iterables.getOnlyElement(info.messages).message).isEqualTo("Uploaded patch set 1.");
}
use of com.google.gerrit.extensions.common.ChangeInput in project gerrit by GerritCodeReview.
the class ChangeIT method createEmptyChange.
@Test
public void createEmptyChange() throws Exception {
ChangeInput in = new ChangeInput();
in.branch = Constants.MASTER;
in.subject = "Create a change from the API";
in.project = project.get();
ChangeInfo info = gApi.changes().create(in).get();
assertThat(info.project).isEqualTo(in.project);
assertThat(RefNames.fullName(info.branch)).isEqualTo(RefNames.fullName(in.branch));
assertThat(info.subject).isEqualTo(in.subject);
assertThat(Iterables.getOnlyElement(info.messages).message).isEqualTo("Uploaded patch set 1.");
}
Aggregations