use of com.google.gerrit.extensions.client.ChangeStatus in project gerrit by GerritCodeReview.
the class DraftChangeIT method markChangeAsDraft.
private void markChangeAsDraft(Change.Id id) throws Exception {
try (BatchUpdate batchUpdate = batchUpdateFactory.create(db, project, atrScope.get().getUser(), TimeUtil.nowTs())) {
batchUpdate.addOp(id, new MarkChangeAsDraftUpdateOp());
batchUpdate.execute();
}
ChangeStatus changeStatus = gApi.changes().id(id.get()).get().status;
assertThat(changeStatus).isEqualTo(ChangeStatus.DRAFT);
}
use of com.google.gerrit.extensions.client.ChangeStatus in project gerrit by GerritCodeReview.
the class ChangeIT method setChangeStatus.
private void setChangeStatus(Change.Id id, Change.Status newStatus) throws Exception {
try (BatchUpdate batchUpdate = batchUpdateFactory.create(project, atrScope.get().getUser(), TimeUtil.now())) {
batchUpdate.addOp(id, new ChangeStatusUpdateOp(newStatus));
batchUpdate.execute();
}
ChangeStatus changeStatus = gApi.changes().id(id.get()).get().status;
assertThat(changeStatus).isEqualTo(newStatus.asChangeStatus());
}
use of com.google.gerrit.extensions.client.ChangeStatus in project gerrit by GerritCodeReview.
the class SubmoduleSubscriptionsWholeTopicMergeIT method nonSubmoduleInSameTopic.
@Test
public void nonSubmoduleInSameTopic() throws Exception {
Project.NameKey standaloneKey = createProjectForPush(getSubmitType());
TestRepository<?> standAlone = cloneProject(standaloneKey);
allowMatchingSubmoduleSubscription(subKey, "refs/heads/master", superKey, "refs/heads/master");
createSubmoduleSubscription(superRepo, "master", subKey, "master");
ObjectId superPreviousId = pushChangeTo(superRepo, "master");
ObjectId subId = pushChangeTo(subRepo, "refs/for/master", "some message", "same-topic");
ObjectId standAloneId = pushChangeTo(standAlone, "refs/for/master", "some message", "same-topic");
String subChangeId = getChangeId(subRepo, subId).get();
String standAloneChangeId = getChangeId(standAlone, standAloneId).get();
approve(subChangeId);
approve(standAloneChangeId);
gApi.changes().id(subChangeId).current().submit();
expectToHaveSubmoduleState(superRepo, "master", subKey, subRepo, "master");
ChangeStatus status = gApi.changes().id(standAloneChangeId).info().status;
assertThat(status).isEqualTo(ChangeStatus.MERGED);
superRepo.git().fetch().setRemote("origin").call().getAdvertisedRef("refs/heads/master").getObjectId();
assertWithMessage("submodule subscription update should have made one commit").that(superRepo.getRepository().resolve("origin/master^")).isEqualTo(superPreviousId);
}
use of com.google.gerrit.extensions.client.ChangeStatus in project gerrit by GerritCodeReview.
the class AbstractSubmit method assertMerged.
protected void assertMerged(String changeId) throws RestApiException {
ChangeStatus status = gApi.changes().id(changeId).info().status;
assertThat(status).isEqualTo(ChangeStatus.MERGED);
}
Aggregations