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()));
}
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());
}
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));
}
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"));
}
Aggregations