Package com.jcabi.http.request

Examples of com.jcabi.http.request.FakeRequest


     * @throws Exception if there is any error
     */
    @Test
    public void getRawTemplateByName() throws Exception {
        final RtGitignores gitignores = new RtGitignores(
            new RtGithub(new FakeRequest().withBody("# Object files"))
        );
        MatcherAssert.assertThat(
            gitignores.template("C#"),
            Matchers.startsWith("# Object")
        );
View Full Code Here


     */
    @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")
View Full Code Here

     */
    @Test
    public void canCompareInstances() throws Exception {
        final RtOrganization less = new RtOrganization(
            new MkGithub(),
            new FakeRequest(),
            "abc"
        );
        final RtOrganization greater = new RtOrganization(
            new MkGithub(),
            new FakeRequest(),
            "def"
        );
        MatcherAssert.assertThat(
            less.compareTo(greater), Matchers.lessThan(0)
        );
View Full Code Here

     * @throws Exception If some problem inside
     */
    @Test
    public void cachesJsonData() throws Exception {
        final Comment origin = Mockito.mock(Comment.class);
        final Request request = new FakeRequest()
            .withBody("[{\"body\": \"hey you\"}]");
        final Comment comment = new Bulk<Comment>(
            new RtPagination<Comment>(
                request,
                new RtPagination.Mapping<Comment, JsonObject>() {
View Full Code Here

     *
     * @throws Exception if a problem occurs.
     */
    @Test
    public void retrievesRepos() throws Exception {
        final RtGithub github = new RtGithub(new FakeRequest());
        MatcherAssert.assertThat(
            github.repos(),
            Matchers.notNullValue()
        );
    }
View Full Code Here

     *
     * @throws Exception if a problem occurs.
     */
    @Test
    public void retrievesGists() throws Exception {
        final RtGithub github = new RtGithub(new FakeRequest());
        MatcherAssert.assertThat(
            github.gists(),
            Matchers.notNullValue()
        );
    }
View Full Code Here

     *
     * @throws Exception if a problem occurs.
     */
    @Test
    public void retrievesUsers() throws Exception {
        final RtGithub github = new RtGithub(new FakeRequest());
        MatcherAssert.assertThat(
            github.users(),
            Matchers.notNullValue()
        );
    }
View Full Code Here

     * @throws Exception if a problem occurs.
     */
    @Test
    public void retrievesMetaAsJson() throws Exception {
        final RtGithub github = new RtGithub(
            new FakeRequest().withBody("{\"meta\":\"blah\"}")
        );
        MatcherAssert.assertThat(
            github.meta().getString("meta"),
            Matchers.equalTo("blah")
        );
View Full Code Here

     * @throws Exception if a problem occurs.
     */
    @Test
    public void retrievesEmojisAsJson() throws Exception {
        final RtGithub github = new RtGithub(
            new FakeRequest().withBody("{\"emojis\":\"test\"}")
        );
        MatcherAssert.assertThat(
            github.meta().getString("emojis"),
            Matchers.equalTo("test")
        );
View Full Code Here

     *
     * @throws Exception if a problem occurs.
     */
    @Test
    public void retrievesMarkdown() throws Exception {
        final RtGithub github = new RtGithub(new FakeRequest());
        MatcherAssert.assertThat(
            github.markdown(),
            Matchers.notNullValue()
        );
    }
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.