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