mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-12 00:11:22 +00:00
29 lines
928 B
Java
29 lines
928 B
Java
package org.kohsuke.github;
|
|
|
|
import com.google.common.collect.Iterables;
|
|
import com.google.common.collect.Iterators;
|
|
import org.junit.Test;
|
|
|
|
import java.io.IOException;
|
|
|
|
/**
|
|
* @author Kohsuke Kawaguchi
|
|
*/
|
|
public class CommitTest extends AbstractGitHubApiTestBase {
|
|
@Test // issue 152
|
|
public void lastStatus() throws IOException {
|
|
GHTag t = gitHub.getRepository("stapler/stapler").listTags().iterator().next();
|
|
t.getCommit().getLastStatus();
|
|
}
|
|
|
|
@Test // issue 230
|
|
public void listFiles() throws Exception {
|
|
GHRepository repo = gitHub.getRepository("stapler/stapler");
|
|
PagedIterable<GHCommit> commits = repo.queryCommits().path("pom.xml").list();
|
|
for (GHCommit commit : Iterables.limit(commits, 10)) {
|
|
GHCommit expected = repo.getCommit( commit.getSHA1() );
|
|
assertEquals(expected.getFiles().size(), commit.getFiles().size());
|
|
}
|
|
}
|
|
}
|