Search in sources :

Example 1 with File

use of com.google.gitiles.FileJsonData.File in project gitiles by GerritCodeReview.

the class PathServletTest method fileJson.

@Test
public void fileJson() throws Exception {
    RevBlob blob = repo.blob("contents");
    repo.branch("master").commit().add("path/to/file", blob).create();
    File file = buildJson(File.class, "/repo/+/master/path/to/file");
    assertThat(file.id).isEqualTo(blob.name());
    assertThat(file.repo).isEqualTo("repo");
    assertThat(file.revision).isEqualTo("master");
    assertThat(file.path).isEqualTo("path/to/file");
}
Also used : RevBlob(org.eclipse.jgit.revwalk.RevBlob) File(com.google.gitiles.FileJsonData.File) Test(org.junit.Test)

Aggregations

File (com.google.gitiles.FileJsonData.File)1 RevBlob (org.eclipse.jgit.revwalk.RevBlob)1 Test (org.junit.Test)1