Package com.jcabi.http.request

Examples of com.jcabi.http.request.FakeRequest


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


    @Test
    public void canCompareInstances() throws Exception {
        final Pull pull = Mockito.mock(Pull.class);
        Mockito.doReturn(repo()).when(pull).repo();
        final RtPullComment less =
            new RtPullComment(new FakeRequest(), pull, 1);
        final RtPullComment greater =
            new RtPullComment(new FakeRequest(), pull, 2);
        MatcherAssert.assertThat(
            less.compareTo(greater), Matchers.lessThan(0)
        );
        MatcherAssert.assertThat(
            greater.compareTo(less), Matchers.greaterThan(0)
View Full Code Here

     */
    @Test
    public void getTree() throws Exception {
        final String sha = "0abcd89jcabitest";
        final Trees trees = new RtTrees(
            new FakeRequest().withBody(
                Json.createObjectBuilder()
                    .add("sha", sha)
                    .build()
                    .toString()
            ),
View Full Code Here

     */
    @Test
    public void getTreeRec() throws Exception {
        final String sha = "0abcd89jcabitest";
        final Trees trees = new RtTrees(
            new FakeRequest().withBody(
                Json.createObjectBuilder()
                    .add("sha", sha)
                    .build()
                    .toString()
            ),
View Full Code Here

     */
    @Test
    public void canFetchOwnRepo() throws Exception {
        final Repo repo = repo();
        MatcherAssert.assertThat(
            new RtGit(new FakeRequest(), repo).repo(),
            Matchers.is(repo)
        );
    }
View Full Code Here

     * RtDeployKeys can fetch empty list of deploy keys.
     */
    @Test
    public void canFetchEmptyListOfDeployKeys() {
        final DeployKeys deployKeys = new RtDeployKeys(
            new FakeRequest().withBody("[]"),
            RtDeployKeysTest.repo()
        );
        MatcherAssert.assertThat(
            deployKeys.iterate(),
            Matchers.emptyIterable()
View Full Code Here

    @Test
    public void canFetchSingleDeployKey() throws IOException {
        final int number = 1;
        final DeployKeys keys = new RtDeployKeys(
            // @checkstyle MultipleStringLiterals (1 line)
            new FakeRequest().withBody(String.format("{\"id\":%d}", number)),
            RtDeployKeysTest.repo()
        );
        MatcherAssert.assertThat(
            // @checkstyle MultipleStringLiterals (1 line)
            keys.get(number).json().getInt("id"),
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.