Examples of FakeRequest


Examples of com.jcabi.http.request.FakeRequest

    @Test
    public void checksIfHeHasAName() throws Exception {
        final User.Smart smart = new User.Smart(
            new RtUser(
                Mockito.mock(Github.class),
                new FakeRequest().withBody(
                    Json.createObjectBuilder()
                        .add("name", "octoc")
                        .build()
                        .toString()
                ),
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

    @Test
    public void checksIfHeHasNoName() throws Exception {
        final User.Smart smart = new User.Smart(
            new RtUser(
                Mockito.mock(Github.class),
                new FakeRequest().withBody(
                    Json.createObjectBuilder()
                        .build()
                        .toString()
                ),
                "octoc"
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     */
    @Test
    public void describeAsJson() throws Exception {
        final RtUser user = new RtUser(
            Mockito.mock(Github.class),
            new FakeRequest().withBody(
                Json.createObjectBuilder()
                    .add("name", "monalisa")
                    .add("email", "octocat@github.com")
                    .build()
                    .toString()
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     * RtUser can fetch emails.
     */
    @Test
    public void fetchesEmails() {
        final Github github = Mockito.mock(Github.class);
        Mockito.when(github.entry()).thenReturn(new FakeRequest());
        final User user = new RtUser(github, new FakeRequest());
        MatcherAssert.assertThat(user.emails(), Matchers.notNullValue());
    }
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     * RtUser can fetch organizations.
     */
    @Test
    public void fetchesOrganizations() {
        final Github github = Mockito.mock(Github.class);
        Mockito.when(github.entry()).thenReturn(new FakeRequest());
        final User user = new RtUser(github, new FakeRequest());
        MatcherAssert.assertThat(user.organizations(), Matchers.notNullValue());
    }
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     */
    private User.Smart userWith(final String property, final String value) {
        return new User.Smart(
            new RtUser(
                Mockito.mock(Github.class),
                new FakeRequest().withBody(
                    Json.createObjectBuilder()
                        .add(property, value)
                        .build()
                        .toString()
                ),
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

    @Test
    public void fetchesCommits() throws Exception {
        final String sha = "6dcb09b5b57875f334f61aebed695e2e4193db50";
        final CommitsComparison.Smart comparison = new CommitsComparison.Smart(
            new RtCommitsComparison(
                new FakeRequest().withBody(
                    Json.createObjectBuilder()
                        .add("base_commit", Json.createObjectBuilder())
                        .add(
                            "commits",
                            Json.createArrayBuilder()
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

    @Test
    public void fetchesFiles() throws Exception {
        final String filename = "file.txt";
        final CommitsComparison.Smart comparison = new CommitsComparison.Smart(
            new RtCommitsComparison(
                new FakeRequest().withBody(
                    Json.createObjectBuilder()
                        .add("base_commit", Json.createObjectBuilder())
                        .add("commits", Json.createArrayBuilder())
                        .add(
                            "files",
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

    @Test
    public void fetchesPullComment() throws Exception {
        final Pull pull = Mockito.mock(Pull.class);
        Mockito.doReturn(repo()).when(pull).repo();
        final RtPullComments comments =
            new RtPullComments(new FakeRequest(), pull);
        MatcherAssert.assertThat(
            comments.get(1),
            Matchers.notNullValue()
        );
    }
View Full Code Here

Examples of com.jcabi.http.request.FakeRequest

     * @throws Exception if a problem occurs.
     */
    @Test
    public void fetchContentAsJson() throws Exception {
        final RtContent content = new RtContent(
            new FakeRequest().withBody("{\"content\":\"json\"}"),
            this.repo(),
            "blah"
        );
        MatcherAssert.assertThat(
            content.json().getString("content"),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.