Search in sources :

Example 1 with Milestones

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

the class MkMilestonesTest method createsMilestone.

/**
 * This tests that MkMilestones can create a MkMilestone.
 * @throws Exception - if something goes wrong.
 */
@Test
public void createsMilestone() throws Exception {
    final Milestones milestones = new MkGithub().randomRepo().milestones();
    final Milestone milestone = milestones.create("test milestone");
    MatcherAssert.assertThat(milestone, Matchers.notNullValue());
    MatcherAssert.assertThat(milestones.create("another milestone"), Matchers.notNullValue());
}
Also used : Milestones(com.jcabi.github.Milestones) Milestone(com.jcabi.github.Milestone) Test(org.junit.Test)

Example 2 with Milestones

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

the class MkMilestonesTest method iteratesMilestones.

/**
 * This tests that the iterate(Map<String, String> params)
 * method in MkMilestones works fine.
 * @throws Exception - if something goes wrong.
 */
@Test
public void iteratesMilestones() throws Exception {
    final Milestones milestones = new MkGithub().randomRepo().milestones();
    milestones.create("testMilestone");
    MatcherAssert.assertThat(milestones.iterate(new ArrayMap<String, String>()), Matchers.<Milestone>iterableWithSize(1));
}
Also used : Milestones(com.jcabi.github.Milestones) ArrayMap(com.jcabi.immutable.ArrayMap) Test(org.junit.Test)

Example 3 with Milestones

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

the class MkMilestonesTest method removesMilestone.

/**
 * This tests that MkMilestones can remove a certain MkMilestone, by number.
 * @throws Exception - if something goes wrong.
 */
@Test
public void removesMilestone() throws Exception {
    final Milestones milestones = new MkGithub().randomRepo().milestones();
    final Milestone created = milestones.create("testTitle");
    MatcherAssert.assertThat(milestones.iterate(new ArrayMap<String, String>()), Matchers.<Milestone>iterableWithSize(1));
    milestones.remove(created.number());
    MatcherAssert.assertThat(milestones.iterate(new ArrayMap<String, String>()), Matchers.<Milestone>iterableWithSize(0));
}
Also used : Milestones(com.jcabi.github.Milestones) Milestone(com.jcabi.github.Milestone) ArrayMap(com.jcabi.immutable.ArrayMap) Test(org.junit.Test)

Example 4 with Milestones

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

the class MkMilestonesTest method getsMilestone.

/**
 * This tests that MkMilestones can return a certain MkMilestone, by number.
 * @throws Exception - if something goes wrong.
 */
@Test
public void getsMilestone() throws Exception {
    final Milestones milestones = new MkGithub().randomRepo().milestones();
    final Milestone created = milestones.create("test");
    MatcherAssert.assertThat(milestones.get(created.number()), Matchers.notNullValue());
}
Also used : Milestones(com.jcabi.github.Milestones) Milestone(com.jcabi.github.Milestone) Test(org.junit.Test)

Example 5 with Milestones

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

Aggregations

Milestones (com.jcabi.github.Milestones)5 Test (org.junit.Test)5 Milestone (com.jcabi.github.Milestone)3 ArrayMap (com.jcabi.immutable.ArrayMap)2 Repo (com.jcabi.github.Repo)1 Repos (com.jcabi.github.Repos)1