Search in sources :

Example 16 with Issue

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

Example 17 with Issue

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

the class MkPullsTest method canCreateAPull.

/**
 * MkPulls can create a pull.
 * It should create an issue first, and then pull with the same number
 * @throws Exception if some problem inside
 */
@Test
public void canCreateAPull() throws Exception {
    final Repo repo = new MkGithub().randomRepo();
    final Pull pull = repo.pulls().create("hello", "head-branch", "base-branch");
    final Issue.Smart issue = new Issue.Smart(repo.issues().get(pull.number()));
    MatcherAssert.assertThat(issue.title(), Matchers.is("hello"));
}
Also used : Pull(com.jcabi.github.Pull) Issue(com.jcabi.github.Issue) Repo(com.jcabi.github.Repo) Test(org.junit.Test)

Aggregations

Issue (com.jcabi.github.Issue)17 Test (org.junit.Test)16 Repo (com.jcabi.github.Repo)10 Comment (com.jcabi.github.Comment)2 Event (com.jcabi.github.Event)2 Github (com.jcabi.github.Github)1 IssueLabels (com.jcabi.github.IssueLabels)1 Labels (com.jcabi.github.Labels)1 Pull (com.jcabi.github.Pull)1 User (com.jcabi.github.User)1 Date (java.util.Date)1 ToString (lombok.ToString)1 CustomMatcher (org.hamcrest.CustomMatcher)1 Directives (org.xembly.Directives)1