Search in sources :

Example 1 with Issue

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

the class MkIssuesTest method createsNewIssueWithCorrectAuthor.

/**
 * MkIssues can create a new issue with correct author.
 * @throws Exception If some problem inside
 */
@Test
public void createsNewIssueWithCorrectAuthor() throws Exception {
    final Repo repo = new MkGithub().randomRepo();
    final Issue.Smart issue = new Issue.Smart(repo.issues().create("hello", "the body"));
    MatcherAssert.assertThat(issue.author().login(), Matchers.equalTo(repo.github().users().self().login()));
}
Also used : Issue(com.jcabi.github.Issue) Repo(com.jcabi.github.Repo) Test(org.junit.Test)

Example 2 with Issue

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

the class MkIssueTest method canRememberItsAuthor.

/**
 * MkIssue can remember it's author.
 * @throws Exception when a problem occurs.
 */
@Test
public void canRememberItsAuthor() throws Exception {
    final MkGithub first = new MkGithub("first");
    final Github second = first.relogin("second");
    final Repo repo = first.randomRepo();
    final int number = second.repos().get(repo.coordinates()).issues().create("", "").number();
    final Issue issue = first.repos().get(repo.coordinates()).issues().get(number);
    MatcherAssert.assertThat(new Issue.Smart(issue).author().login(), Matchers.is("second"));
}
Also used : Issue(com.jcabi.github.Issue) Repo(com.jcabi.github.Repo) Github(com.jcabi.github.Github) Test(org.junit.Test)

Example 3 with Issue

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

the class MkIssueTest method changesBody.

/**
 * MkIssue can change body.
 * @throws Exception If some problem inside
 */
@Test
public void changesBody() throws Exception {
    final Issue issue = this.issue();
    new Issue.Smart(issue).body("hey, body works?");
    MatcherAssert.assertThat(new Issue.Smart(issue).body(), Matchers.startsWith("hey, b"));
}
Also used : Issue(com.jcabi.github.Issue) Test(org.junit.Test)

Example 4 with Issue

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

the class MkIssueTest method changesTitle.

/**
 * MkIssue can change title.
 * @throws Exception If some problem inside
 */
@Test
public void changesTitle() throws Exception {
    final Issue issue = this.issue();
    new Issue.Smart(issue).title("hey, works?");
    MatcherAssert.assertThat(new Issue.Smart(issue).title(), Matchers.startsWith("hey, "));
}
Also used : Issue(com.jcabi.github.Issue) Test(org.junit.Test)

Example 5 with Issue

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

the class MkIssueTest method pointsToAnEmptyPullRequest.

/**
 * MkIssue can point to an absent pull request.
 * @throws Exception If some problem inside
 */
@Test
public void pointsToAnEmptyPullRequest() throws Exception {
    final Issue issue = this.issue();
    MatcherAssert.assertThat(new Issue.Smart(issue).isPull(), Matchers.is(false));
}
Also used : Issue(com.jcabi.github.Issue) 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