use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtIssueTest method fetchesLabels.
/**
* RtIssue should be able to fetch its labels.
*
* @throws Exception if a problem occurs.
*/
@Test
public void fetchesLabels() throws Exception {
final RtIssue issue = new RtIssue(new FakeRequest(), this.repo(), 1);
MatcherAssert.assertThat(issue.labels(), Matchers.notNullValue());
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtBranchesTest method fetchesRepo.
/**
* RtBranches can fetch its repository.
* @throws IOException If there is any I/O problem
*/
@Test
public void fetchesRepo() throws IOException {
final Repo repo = new MkGithub().randomRepo();
final RtBranches branch = new RtBranches(new FakeRequest(), repo);
final Coordinates coords = branch.repo().coordinates();
MatcherAssert.assertThat(coords.user(), Matchers.equalTo(repo.coordinates().user()));
MatcherAssert.assertThat(coords.repo(), Matchers.equalTo(repo.coordinates().repo()));
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtCommentTest method returnsItsIssue.
/**
* RtComment can return its issue (owner).
* @throws Exception - if anything goes wrong.
*/
@Test
public void returnsItsIssue() throws Exception {
final Repo repo = new MkGithub().randomRepo();
final Issue issue = repo.issues().create("testing1", "issue1");
final RtComment comment = new RtComment(new FakeRequest(), issue, 1);
MatcherAssert.assertThat(comment.issue(), Matchers.is(issue));
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtCommentTest method returnsItsNumber.
/**
* RtComment can return its number.
* @throws Exception - in case something goes wrong.
*/
@Test
public void returnsItsNumber() throws Exception {
final Repo repo = new MkGithub().randomRepo();
final Issue issue = repo.issues().create("testing2", "issue2");
final int num = 10;
final RtComment comment = new RtComment(new FakeRequest(), issue, num);
MatcherAssert.assertThat(comment.number(), Matchers.is(num));
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtEventTest method canRetrieveOwnNumber.
/**
* RtEvent can retrieve its own number.
*
* @throws Exception if a problem occurs.
*/
@Test
public void canRetrieveOwnNumber() throws Exception {
final Repo repo = this.repo();
final RtEvent event = new RtEvent(new FakeRequest(), repo, 2);
MatcherAssert.assertThat(event.number(), Matchers.equalTo(2));
}
Aggregations