Package com.jcabi.http.request

Examples of com.jcabi.http.request.FakeRequest


     *
     * @throws Exception if a problem occurs.
     */
    @Test
    public void fetchesComments() throws Exception {
        final RtIssue issue = new RtIssue(new FakeRequest(), this.repo(), 1);
        MatcherAssert.assertThat(
            issue.comments(),
            Matchers.notNullValue()
        );
    }
View Full Code Here


     *
     * @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()
        );
    }
View Full Code Here

     *
     * @throws Exception if a problem occurs.
     */
    @Test
    public void fetchesEvents() throws Exception {
        final RtIssue issue = new RtIssue(new FakeRequest(), this.repo(), 1);
        MatcherAssert.assertThat(
            issue.events(),
            Matchers.notNullValue()
        );
    }
View Full Code Here

     * @throws Exception if a problem occurs.
     */
    @Test
    public void fetchIssueAsJson() throws Exception {
        final RtIssue issue = new RtIssue(
            new FakeRequest().withBody("{\"issue\":\"json\"}"),
            this.repo(),
            1
        );
        MatcherAssert.assertThat(
            issue.json().getString("issue"),
View Full Code Here

     *
     * @throws Exception when a problem occurs.
     */
    @Test
    public void canCompareInstances() throws Exception {
        final RtIssue less = new RtIssue(new FakeRequest(), this.repo(), 1);
        final RtIssue greater = new RtIssue(new FakeRequest(), this.repo(), 2);
        MatcherAssert.assertThat(
            less.compareTo(greater), Matchers.lessThan(0)
        );
        MatcherAssert.assertThat(
            greater.compareTo(less), Matchers.greaterThan(0)
View Full Code Here

     * @throws Exception if some problem inside
     */
    @Test
    public void canFetchEmptyListOfReleases() throws Exception {
        final Releases releases = new RtReleases(
            new FakeRequest().withBody("[]"),
            RtReleasesTest.repo()
        );
        MatcherAssert.assertThat(
            releases.iterate(),
            Matchers.emptyIterable()
View Full Code Here

     */
    @Test
    public void canFetchNonEmptyListOfReleases() {
        final int number = 1;
        final Releases releases = new RtReleases(
            new FakeRequest().withBody(
                Json.createArrayBuilder().add(
                    Json.createObjectBuilder()
                        .add("id", number)
                        .add("tag_name", "v1.0.0")
                        .add("name", "v1.0.0")
View Full Code Here

     * @throws IOException If some problem inside
     */
    @Test
    public void canFetchSingleRelease() throws IOException {
        final Releases releases = new RtReleases(
            new FakeRequest(), RtReleasesTest.repo()
        );
        MatcherAssert.assertThat(releases.get(1), Matchers.notNullValue());
    }
View Full Code Here

     * @checkstyle MultipleStringLiterals (25 lines)
     */
    @Test
    public void fetchesJson() throws Exception {
        final CommitsComparison comparison = new RtCommitsComparison(
            new FakeRequest().withBody(
                Json.createObjectBuilder()
                    .add("base_commit", Json.createObjectBuilder())
                    .add("commits", Json.createArrayBuilder())
                    .add("files", Json.createArrayBuilder())
                    .build().toString()
View Full Code Here

     * @throws Exception if a problem occurs.
     */
    @Test
    public void canRepresentAsJson() throws Exception {
        final RtReleaseAsset asset = new RtReleaseAsset(
            new FakeRequest().withBody("{\"asset\":\"release\"}"),
            release(),
            1
        );
        MatcherAssert.assertThat(
            asset.json().getString("asset"),
View Full Code Here

TOP

Related Classes of com.jcabi.http.request.FakeRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.