Examples of MkGrizzlyContainer


Examples of com.jcabi.http.mock.MkGrizzlyContainer

     */
    @Test
    public void iteratesRepoPullComments() throws Exception {
        final Pull pull = Mockito.mock(Pull.class);
        Mockito.doReturn(repo()).when(pull).repo();
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_OK,
                Json.createArrayBuilder()
                    .add(comment("comment 1"))
                    .add(comment("comment 2"))
View Full Code Here

Examples of com.jcabi.http.mock.MkGrizzlyContainer

     */
    @Test
    public void iteratesPullRequestComments() throws Exception {
        final Pull pull = Mockito.mock(Pull.class);
        Mockito.doReturn(repo()).when(pull).repo();
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_OK,
                Json.createArrayBuilder()
                    .add(comment("comment 3"))
                    .add(comment("comment 4"))
View Full Code Here

Examples of com.jcabi.http.mock.MkGrizzlyContainer

        final String body = "test-body";
        final String commit = "test-commit-id";
        final String path = "test-path";
        final int position = 4;
        final String response = pulls(body, commit, path, position).toString();
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_CREATED, response)
        ).next(new MkAnswer.Simple(HttpURLConnection.HTTP_OK, response))
            .start();
        final Pull pull = Mockito.mock(Pull.class);
        Mockito.doReturn(repo()).when(pull).repo();
View Full Code Here

Examples of com.jcabi.http.mock.MkGrizzlyContainer

            .add("id", Tv.BILLION)
            .add("body", body)
            .add("in_reply_to", number)
            .build()
            .toString();
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_CREATED, response)
        ).next(new MkAnswer.Simple(HttpURLConnection.HTTP_OK, response))
            .start();
        final Pull pull = Mockito.mock(Pull.class);
        Mockito.doReturn(repo()).when(pull).repo();
View Full Code Here

Examples of com.jcabi.http.mock.MkGrizzlyContainer

     *
     * @throws Exception If something goes wrong.
     */
    @Test
    public void removesPullComment() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_NO_CONTENT, "")
        ).start();
        final Pull pull = Mockito.mock(Pull.class);
        Mockito.doReturn(repo()).when(pull).repo();
        final RtPullComments comments =
View Full Code Here

Examples of com.jcabi.http.mock.MkGrizzlyContainer

     *
     * @throws Exception if a problem occurs.
     */
    @Test
    public void patchWithJson() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "response")
        ).start();
        final RtContent content = new RtContent(
            new ApacheRequest(container.home()),
            this.repo(),
View Full Code Here

Examples of com.jcabi.http.mock.MkGrizzlyContainer

     * @throws Exception if a problem occurs.
     */
    @Test
    public void fetchesRawContent() throws Exception {
        final String raw = "the raw \u20ac";
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, raw)
        ).start();
        final InputStream stream = new RtContent(
            new ApacheRequest(container.home()),
            this.repo(),
View Full Code Here

Examples of com.jcabi.http.mock.MkGrizzlyContainer

     * @throws Exception If some problem inside
     */
    @Test
    public void addsEmails() throws Exception {
        final String email = "test1@email.com";
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_CREATED,
                String.format("[{\"email\":\"%s\"}]", email)
            )
        );
View Full Code Here

Examples of com.jcabi.http.mock.MkGrizzlyContainer

     *
     * @throws Exception If a problem occurs.
     */
    @Test
    public void returnsJsonOutput() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "{\"a\":\"b\"}")
                .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_HTML)
        ).start();
        final RtMarkdown markdown = new RtMarkdown(
            new MkGithub(),
View Full Code Here

Examples of com.jcabi.http.mock.MkGrizzlyContainer

     *
     * @throws Exception If a problem occurs.
     */
    @Test
    public void returnsRawOutput() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "Test Output")
                .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_HTML)
        ).start();
        final RtMarkdown markdown = new RtMarkdown(
            new MkGithub(),
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.