Search in sources :

Example 46 with Repo

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

the class MkRepoTest method exposesAttributes.

/**
 * Repo can exponse attributes.
 * @throws Exception If some problem inside
 */
@Test
public void exposesAttributes() throws Exception {
    final Repo repo = new MkGithub().randomRepo();
    MatcherAssert.assertThat(new Repo.Smart(repo).description(), Matchers.notNullValue());
    MatcherAssert.assertThat(new Repo.Smart(repo).isPrivate(), Matchers.is(false));
}
Also used : Repo(com.jcabi.github.Repo) Test(org.junit.Test)

Example 47 with Repo

use of com.jcabi.github.Repo 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 48 with Repo

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

the class MkGitTest method canFetchOwnRepo.

/**
 * MkGit can fetch its own repo.
 *
 * @throws Exception if something goes wrong.
 */
@Test
public void canFetchOwnRepo() throws Exception {
    final Repo repo = new MkGithub().randomRepo();
    MatcherAssert.assertThat(repo.git().repo(), Matchers.equalTo(repo));
}
Also used : Repo(com.jcabi.github.Repo) Test(org.junit.Test)

Example 49 with Repo

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

the class MkLabelsTest method setsLabelColor.

/**
 * MkLabels can set label color.
 * @throws Exception If some problem inside
 */
@Test
public void setsLabelColor() throws Exception {
    final Repo repo = new MkGithub().randomRepo();
    final String color = "f0f0f0";
    final String name = "task";
    repo.labels().create(name, color);
    MatcherAssert.assertThat(new Label.Smart(repo.labels().get(name)).color(), Matchers.equalTo(color));
}
Also used : Repo(com.jcabi.github.Repo) Test(org.junit.Test)

Example 50 with Repo

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

the class MkLabelsTest method deletesLabels.

/**
 * MkLabels can delete labels.
 * @throws Exception If some problem inside
 */
@Test
public void deletesLabels() throws Exception {
    final Repo repo = new MkGithub().randomRepo();
    final Labels labels = repo.labels();
    final String name = "label-0";
    labels.create(name, "e1e1e1");
    final Issue issue = repo.issues().create("hey, you!", "");
    issue.labels().add(Collections.singletonList(name));
    labels.delete(name);
    MatcherAssert.assertThat(repo.labels().iterate(), Matchers.emptyIterable());
    MatcherAssert.assertThat(issue.labels().iterate(), Matchers.emptyIterable());
}
Also used : Issue(com.jcabi.github.Issue) Repo(com.jcabi.github.Repo) Labels(com.jcabi.github.Labels) 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