Search in sources :

Example 6 with Repos

use of com.jcabi.github.Repos in project jcabi-github by jcabi.

the class MkEventTest method canGetAbsentLabel.

/**
 * MkEvent can get absent label value from json object.
 * @throws Exception If some problem inside
 */
@Test
public void canGetAbsentLabel() throws Exception {
    final MkStorage storage = new MkStorage.InFile();
    final String user = "barbie";
    final Repo repo = new MkGithub(storage, user).repos().create(new Repos.RepoCreate("bar", false));
    final int num = ((MkIssueEvents) (repo.issueEvents())).create(Event.LABELED, 1, user, Optional.<String>absent()).number();
    MatcherAssert.assertThat(new Event.Smart(new MkEvent(storage, user, repo.coordinates(), num)).label(), Matchers.equalTo(Optional.<Label>absent()));
}
Also used : Repos(com.jcabi.github.Repos) Repo(com.jcabi.github.Repo) Label(com.jcabi.github.Label) Test(org.junit.Test)

Example 7 with Repos

use of com.jcabi.github.Repos in project jcabi-github by jcabi.

the class MkRepoTest method returnsMkMilestones.

/**
 * This tests that the milestones() method in MkRepo is working fine.
 * @throws Exception - if anything goes wrong.
 */
@Test
public void returnsMkMilestones() throws Exception {
    final Repos repos = new MkRepos(new MkStorage.InFile(), "jeff");
    final Repo repo = repos.create(new Repos.RepoCreate("test1", false));
    final Milestones milestones = repo.milestones();
    MatcherAssert.assertThat(milestones, Matchers.notNullValue());
}
Also used : Repos(com.jcabi.github.Repos) Milestones(com.jcabi.github.Milestones) Repo(com.jcabi.github.Repo) Test(org.junit.Test)

Example 8 with Repos

use of com.jcabi.github.Repos in project jcabi-github by jcabi.

the class MkReposTest method iterateRepos.

/**
 * MkRepos can iterate repos.
 * @throws Exception if there is any error
 */
@Test
public void iterateRepos() throws Exception {
    final String since = "1";
    final Repos repos = new MkRepos(new MkStorage.InFile(), "tom");
    MkReposTest.repo(repos, since, "repo 1");
    MkReposTest.repo(repos, "2", "repo 2");
    MatcherAssert.assertThat(repos.iterate(since), Matchers.<Repo>iterableWithSize(2));
}
Also used : Repos(com.jcabi.github.Repos) Test(org.junit.Test)

Example 9 with Repos

use of com.jcabi.github.Repos 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

Repos (com.jcabi.github.Repos)9 Test (org.junit.Test)9 Repo (com.jcabi.github.Repo)8 Label (com.jcabi.github.Label)1 Milestones (com.jcabi.github.Milestones)1