Search in sources :

Example 56 with Repo

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));
}
Also used : Repo(com.jcabi.github.Repo) JsonObject(javax.json.JsonObject) Test(org.junit.Test)

Example 57 with Repo

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"));
}
Also used : Repos(com.jcabi.github.Repos) Repo(com.jcabi.github.Repo) Test(org.junit.Test)

Aggregations

Repo (com.jcabi.github.Repo)57 Test (org.junit.Test)55 Coordinates (com.jcabi.github.Coordinates)11 Issue (com.jcabi.github.Issue)10 Repos (com.jcabi.github.Repos)10 References (com.jcabi.github.References)5 Github (com.jcabi.github.Github)3 JsonObject (javax.json.JsonObject)3 Comment (com.jcabi.github.Comment)2 Content (com.jcabi.github.Content)2 Event (com.jcabi.github.Event)2 RepoCommit (com.jcabi.github.RepoCommit)2 ArrayMap (com.jcabi.immutable.ArrayMap)2 Branch (com.jcabi.github.Branch)1 Contents (com.jcabi.github.Contents)1 Fork (com.jcabi.github.Fork)1 IssueLabels (com.jcabi.github.IssueLabels)1 Label (com.jcabi.github.Label)1 Labels (com.jcabi.github.Labels)1 Language (com.jcabi.github.Language)1