Search in sources :

Example 6 with SubmittedTogetherInfo

use of com.google.gerrit.extensions.api.changes.SubmittedTogetherInfo in project gerrit by GerritCodeReview.

the class SubmittedTogetherIT method doesNotIncludeCurrentFiles.

@Test
public void doesNotIncludeCurrentFiles() throws Exception {
    RevCommit c1_1 = commitBuilder().add("a.txt", "1").message("subject: 1").create();
    RevCommit c2_1 = commitBuilder().add("b.txt", "2").message("subject: 2").create();
    String id2 = getChangeId(c2_1);
    pushHead(testRepo, "refs/for/master", false);
    SubmittedTogetherInfo info = gApi.changes().id(id2).submittedTogether(EnumSet.of(NON_VISIBLE_CHANGES));
    assertThat(info.changes).hasSize(2);
    assertThat(info.changes.get(0).currentRevision).isEqualTo(c2_1.name());
    assertThat(info.changes.get(1).currentRevision).isEqualTo(c1_1.name());
    assertThat(info.changes.get(0).currentRevision).isEqualTo(c2_1.name());
    RevisionInfo rev = info.changes.get(0).revisions.get(c2_1.name());
    assertThat(rev.files).isNull();
}
Also used : RevisionInfo(com.google.gerrit.extensions.common.RevisionInfo) SubmittedTogetherInfo(com.google.gerrit.extensions.api.changes.SubmittedTogetherInfo) RevCommit(org.eclipse.jgit.revwalk.RevCommit) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Aggregations

SubmittedTogetherInfo (com.google.gerrit.extensions.api.changes.SubmittedTogetherInfo)6 AbstractDaemonTest (com.google.gerrit.acceptance.AbstractDaemonTest)4 RevCommit (org.eclipse.jgit.revwalk.RevCommit)4 Test (org.junit.Test)4 RevisionInfo (com.google.gerrit.extensions.common.RevisionInfo)2 ChangeInfo (com.google.gerrit.extensions.common.ChangeInfo)1 FileInfo (com.google.gerrit.extensions.common.FileInfo)1 AuthException (com.google.gerrit.extensions.restapi.AuthException)1 Change (com.google.gerrit.reviewdb.client.Change)1 ChangeSet (com.google.gerrit.server.git.ChangeSet)1 ChangeData (com.google.gerrit.server.query.change.ChangeData)1 OrmException (com.google.gwtorm.server.OrmException)1 IOException (java.io.IOException)1