use of com.jcabi.github.Repo in project jcabi-github by jcabi.
the class MkTreesTest method getTreeRec.
/**
* MkTrees can get tree recursively.
*
* @throws Exception if some problem inside
*/
@Test
public void getTreeRec() throws Exception {
final String sha = "0abcd89jcabitest";
final JsonObject json = Json.createObjectBuilder().add("tree", Json.createArrayBuilder().add(Json.createObjectBuilder().add("path", "test.txt").add("mode", "100644").add("sha", sha).add("name", "tree rec").add("type", "blob").add("content", "hello").build()).build()).build();
final Repo repo = new MkGithub().randomRepo();
repo.git().trees().create(json);
MatcherAssert.assertThat(repo.git().trees().getRec(sha).json().getString("sha"), Matchers.containsString(sha));
}
use of com.jcabi.github.Repo in project jcabi-github by jcabi.
the class MkReposTest method createsRepository.
/**
* MkRepos can create a repo.
* @throws Exception If some problem inside
*/
@Test
public void createsRepository() throws Exception {
final Repos repos = new MkRepos(new MkStorage.InFile(), "jeff");
final Repo repo = MkReposTest.repo(repos, "test", "test repo");
MatcherAssert.assertThat(repo.coordinates(), Matchers.hasToString("jeff/test"));
}
Aggregations