Examples of MkGrizzlyContainer


Examples of com.jcabi.http.mock.MkGrizzlyContainer

     * RtGists can remove a gist by name.
     * @throws Exception - if something goes wrong.
     */
    @Test
    public void removesGistByName() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_NO_CONTENT,
                ""
            )
        )
View Full Code Here

Examples of com.jcabi.http.mock.MkGrizzlyContainer

     * @throws Exception if some problem inside
     */
    @Test
    public void getComment() throws Exception {
        final String body = "Just commenting";
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_OK,
                comment(body).toString()
            )
        ).start();
View Full Code Here

Examples of com.jcabi.http.mock.MkGrizzlyContainer

     * RtGistComments can iterate comments.
     * @throws Exception if there is any error
     */
    @Test
    public void iterateComments() throws Exception {
        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

        final String body = "new commenting";
        final MkAnswer answer = new MkAnswer.Simple(
            HttpURLConnection.HTTP_OK,
            comment(body).toString()
        );
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_CREATED,
                comment(body).toString()
            )
        ).next(answer).start();
View Full Code Here

Examples of com.jcabi.http.mock.MkGrizzlyContainer

     *
     * @throws Exception If some problem inside
     */
    @Test
    public void iteratesEvents() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_OK,
                Json.createArrayBuilder()
                    .add(event(Event.ASSIGNED))
                    .add(event(Event.MENTIONED))
View Full Code Here

Examples of com.jcabi.http.mock.MkGrizzlyContainer

     *
     * @throws Exception if there is any problem
     */
    @Test
    public void executePatchRequest() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_OK,
                event(Event.ASSIGNED).toString()
            )
        ).start();
View Full Code Here

Examples of com.jcabi.http.mock.MkGrizzlyContainer

    @Test
    public void createRepo() throws Exception {
        final String owner = "test-owner";
        final String name = "test-repo";
        final String response = response(owner, name).toString();
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_CREATED, response)
        ).next(new MkAnswer.Simple(HttpURLConnection.HTTP_OK, response))
            .start();
        final RtRepos repos = new RtRepos(
            Mockito.mock(Github.class),
View Full Code Here

Examples of com.jcabi.http.mock.MkGrizzlyContainer

     * @throws Exception if there is any error
     */
    @Test
    public void iterateRepos() throws Exception {
        final String identifier = "1";
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_OK,
                Json.createArrayBuilder()
                    .add(response("octocat", identifier))
                    .add(response("dummy", "2"))
View Full Code Here

Examples of com.jcabi.http.mock.MkGrizzlyContainer

     * RtRepos can remove a repo.
     * @throws Exception if some problem inside
     */
    @Test
    public void removeRepo() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_NO_CONTENT, "")
        ).start();
        final Repos repos = new RtRepos(
            Mockito.mock(Github.class),
            new ApacheRequest(container.home())
View Full Code Here

Examples of com.jcabi.http.mock.MkGrizzlyContainer

        final String organization = RandomStringUtils.randomAlphanumeric(10);
        final MkAnswer answer = new MkAnswer.Simple(
            HttpURLConnection.HTTP_OK,
            fork(organization).toString()
        );
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_ACCEPTED,
                fork(organization).toString()
            )
        ).next(answer).start();
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.