use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtRepoTest method fetchesPulls.
/**
* RtRepo can fetch its pulls.
*
* @throws Exception if a problem occurs.
*/
@Test
public void fetchesPulls() throws Exception {
final Repo repo = RtRepoTest.repo(new FakeRequest());
MatcherAssert.assertThat(repo.pulls(), Matchers.notNullValue());
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtRepoTest method fetchesBranches.
/**
* RtRepo can fetch its branches.
*
* @throws Exception if a problem occurs.
*/
@Test
public void fetchesBranches() throws Exception {
final Repo repo = RtRepoTest.repo(new FakeRequest());
MatcherAssert.assertThat(repo.branches(), Matchers.notNullValue());
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RtRepoTest method fetchCommits.
/**
* RtRepo can fetch commits.
*/
@Test
public void fetchCommits() {
final Repo repo = RtRepoTest.repo(new FakeRequest());
MatcherAssert.assertThat(repo.commits(), Matchers.notNullValue());
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class RetryCarefulWireTest method tolerateMissingRateLimitResetHeader.
/**
* RetryCarefulWire can tolerate the lack the X-RateLimit-Reset header.
* @throws IOException If some problem inside
*/
@Test
public void tolerateMissingRateLimitResetHeader() throws IOException {
final int threshold = 8;
// @checkstyle MagicNumber (1 lines)
new FakeRequest().withStatus(HttpURLConnection.HTTP_OK).withReason(OK).withHeader(REMAINING_HEADER, "7").through(RetryCarefulWire.class, threshold).fetch();
MatcherAssert.assertThat("Did not crash when X-RateLimit-Reset header was absent", true);
}
use of com.jcabi.http.request.FakeRequest in project jcabi-github by jcabi.
the class CarefulWireTest method tolerateMissingRateLimitResetHeader.
/**
* CarefulWire can tolerate the lack the X-RateLimit-Reset header.
* @throws IOException If some problem inside
*/
@Test
public void tolerateMissingRateLimitResetHeader() throws IOException {
final int threshold = 8;
// @checkstyle MagicNumber (1 lines)
new FakeRequest().withStatus(HttpURLConnection.HTTP_OK).withReason(OK).withHeader(REMAINING_HEADER, "7").through(CarefulWire.class, threshold).fetch();
MatcherAssert.assertThat("Did not crash when X-RateLimit-Reset header was absent", true);
}
Aggregations