use of com.google.gerrit.extensions.api.changes.ChangeApi in project gerrit by GerritCodeReview.
the class CheckMergeabilityIT method checkContentMergedCommit.
@Test
public void checkContentMergedCommit() throws Exception {
testRepo.branch("HEAD").commit().insertChangeId().message("first commit").add("a.txt", "a contents ").create();
testRepo.git().push().setRemote("origin").setRefSpecs(new RefSpec("HEAD:refs/heads/master")).call();
// create a change, and cherrypick into master
PushOneCommit.Result cId = createChange();
RevCommit commitId = cId.getCommit();
CherryPickInput cpi = new CherryPickInput();
cpi.destination = "master";
cpi.message = "cherry pick the commit";
ChangeApi orig = gApi.changes().id(cId.getChangeId());
ChangeApi cherry = orig.current().cherryPick(cpi);
cherry.current().review(ReviewInput.approve());
cherry.current().submit();
ObjectId remoteId = getRemoteHead();
assertThat(remoteId).isNotEqualTo(commitId);
assertContentMerged("master", commitId.getName(), "recursive");
}
use of com.google.gerrit.extensions.api.changes.ChangeApi in project gerrit by GerritCodeReview.
the class ChangeIdIT method projectChangeNumberReturnsChange.
@Test
public void projectChangeNumberReturnsChange() throws Exception {
ChangeApi cApi = gApi.changes().id(project.get(), changeInfo._number);
assertThat(cApi.get().changeId).isEqualTo(changeInfo.changeId);
}
use of com.google.gerrit.extensions.api.changes.ChangeApi in project gerrit by GerritCodeReview.
the class ChangeIdIT method tripletChangeIdReturnsChange.
@Test
public void tripletChangeIdReturnsChange() throws Exception {
ChangeApi cApi = gApi.changes().id(project.get(), changeInfo.branch, changeInfo.changeId);
assertThat(cApi.get().changeId).isEqualTo(changeInfo.changeId);
}
use of com.google.gerrit.extensions.api.changes.ChangeApi in project gerrit by GerritCodeReview.
the class ChangeIdIT method changeNumberReturnsChange.
@Test
public void changeNumberReturnsChange() throws Exception {
ChangeApi cApi = gApi.changes().id(changeInfo._number);
assertThat(cApi.get().changeId).isEqualTo(changeInfo.changeId);
}
use of com.google.gerrit.extensions.api.changes.ChangeApi in project gerrit by GerritCodeReview.
the class ChangeIdIT method projectChangeNumberReturnsChangeWhenProjectContainsSlashes.
@Test
public void projectChangeNumberReturnsChangeWhenProjectContainsSlashes() throws Exception {
Project.NameKey p = createProject("foo/bar");
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);
}
Aggregations