use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtReleaseAssetsTest method listReleaseAssets.
/**
* RtRelease can list assets for a release.
*
* @throws Exception If something goes wrong.
*/
@Test
public void listReleaseAssets() throws Exception {
final ReleaseAssets assets = new RtReleaseAssets(new FakeRequest().withStatus(HttpURLConnection.HTTP_OK).withBody("[{\"id\":1},{\"id\":2}]"), release());
MatcherAssert.assertThat(assets.iterate(), Matchers.<ReleaseAsset>iterableWithSize(2));
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtSearchTest method canSearchForUsers.
/**
* RtSearch can search for users.
*
* @throws Exception if a problem occurs
*/
@Test
public void canSearchForUsers() throws Exception {
final String login = "test-user";
final Search search = new RtGithub(new FakeRequest().withBody(RtSearchTest.search(Json.createObjectBuilder().add("login", login).build()).toString())).search();
MatcherAssert.assertThat(search.users("test3", "joined", Search.Order.DESC).iterator().next().login(), Matchers.equalTo(login));
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtRepoTest method fetchContents.
/**
* RtRepo can fetch its contents.
*
* @throws Exception if a problem occurs.
*/
@Test
public void fetchContents() throws Exception {
final Repo repo = RtRepoTest.repo(new FakeRequest());
MatcherAssert.assertThat(repo.contents(), Matchers.notNullValue());
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtRepoTest method fetchesIssues.
/**
* RtRepo can fetch its issues.
*
* @throws Exception if a problem occurs.
*/
@Test
public void fetchesIssues() throws Exception {
final Repo repo = RtRepoTest.repo(new FakeRequest());
MatcherAssert.assertThat(repo.issues(), Matchers.notNullValue());
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtRepoTest method fetchHooks.
/**
* RtRepo can fetch its hooks.
*
* @throws Exception if a problem occurs.
*/
@Test
public void fetchHooks() throws Exception {
final Repo repo = RtRepoTest.repo(new FakeRequest());
MatcherAssert.assertThat(repo.hooks(), Matchers.notNullValue());
}
Aggregations