use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtRepoTest method fetchesGit.
/**
* RtRepo can fetch Git.
*/
@Test
public void fetchesGit() {
final Repo repo = RtRepoTest.repo(new FakeRequest());
MatcherAssert.assertThat(repo.git(), Matchers.notNullValue());
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtRepoTest method identifiesItself.
/**
* RtRepo can identify itself.
* @throws Exception If some problem inside
*/
@Test
public void identifiesItself() throws Exception {
final Coordinates coords = new Coordinates.Simple("me", "me-branch");
final Repo repo = new RtRepo(Mockito.mock(Github.class), new FakeRequest(), coords);
MatcherAssert.assertThat(repo.coordinates(), Matchers.sameInstance(coords));
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtOrganizationTest method canFetchIssueAsJson.
/**
* RtOrganization should be able to describe itself in JSON format.
*
* @throws Exception if a problem occurs.
*/
@Test
public void canFetchIssueAsJson() throws Exception {
final RtOrganization org = new RtOrganization(new MkGithub(), new FakeRequest().withBody("{\"organization\":\"json\"}"), "testJson");
MatcherAssert.assertThat(org.json().getString("organization"), Matchers.equalTo("json"));
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtPullTest method canCompareInstances.
/**
* RtPull should be able to compare different instances.
*
* @throws Exception when a problem occurs.
*/
@Test
public void canCompareInstances() throws Exception {
final RtPull less = new RtPull(new FakeRequest(), this.repo(), 1);
final RtPull greater = new RtPull(new FakeRequest(), this.repo(), 2);
MatcherAssert.assertThat(less.compareTo(greater), Matchers.lessThan(0));
MatcherAssert.assertThat(greater.compareTo(less), Matchers.greaterThan(0));
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtStatusesTest method fetchesCommit.
/**
* RtStatuses can fetch its commit.
* @throws IOException If there is an I/O problem.
*/
@Test
public void fetchesCommit() throws IOException {
final Commit original = new MkGithub().randomRepo().git().commits().get("5e8d65e0dbfab0716db16493e03a0baba480625a");
MatcherAssert.assertThat(new RtStatuses(new FakeRequest(), original).commit(), Matchers.equalTo(original));
}
Aggregations