Examples of MkGithub


Examples of com.jcabi.github.mock.MkGithub

     * This method returns a Repo for testing.
     * @return Repo - a repo to be used for test.
     * @throws Exception - if anything goes wrong.
     */
    private static Repo repo() throws Exception {
        return new MkGithub("johnny").repos().create(
            Json.createObjectBuilder().add("name", "test").build()
        );
    }
View Full Code Here

Examples of com.jcabi.github.mock.MkGithub

        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(),
            new ApacheRequest(container.home())
        );
        try {
            MatcherAssert.assertThat(
                markdown.render(
View Full Code Here

Examples of com.jcabi.github.mock.MkGithub

        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(),
            new ApacheRequest(container.home())
        );
        try {
            MatcherAssert.assertThat(
                markdown.raw("Hello World!"),
View Full Code Here

Examples of com.jcabi.github.mock.MkGithub

                HttpURLConnection.HTTP_CREATED,
                "{\"id\":\"1\"}"
            )
        ).start();
        final Gists gists = new RtGists(
            new MkGithub(),
            new ApacheRequest(container.home())
        );
        try {
            MatcherAssert.assertThat(
                gists.create(Collections.singletonMap("test", ""), false),
View Full Code Here

Examples of com.jcabi.github.mock.MkGithub

    public void canRetrieveSpecificGist() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "testing")
        ).start();
        final Gists gists = new RtGists(
            new MkGithub(),
            new ApacheRequest(container.home())
        );
        try {
            MatcherAssert.assertThat(
                gists.get("gist"),
View Full Code Here

Examples of com.jcabi.github.mock.MkGithub

                HttpURLConnection.HTTP_OK,
                "[{\"id\":\"hello\"}]"
            )
        ).start();
        final Gists gists = new RtGists(
            new MkGithub(),
            new ApacheRequest(container.home())
        );
        try {
            MatcherAssert.assertThat(
                gists.iterate().iterator().next(),
View Full Code Here

Examples of com.jcabi.github.mock.MkGithub

                ""
            )
        )
            .start();
        final Gists gists = new RtGists(
            new MkGithub(),
            new ApacheRequest(container.home())
        );
        try {
            gists.remove("12234");
            final MkQuery query = container.take();
View Full Code Here

Examples of com.jcabi.github.mock.MkGithub

     * This method returns a Repo for testing.
     * @return Repo - a repo to be used for test.
     * @throws Exception - if anything goes wrong.
     */
    private static Repo repo() throws Exception {
        return new MkGithub().repos().create(
            Json.createObjectBuilder().add("name", "test").build()
        );
    }
View Full Code Here

Examples of com.jcabi.github.mock.MkGithub

     * @return Release to be used for test.
     * @throws Exception - if anything goes wrong.
     */
    private static Release release() throws Exception {
        final Release release = Mockito.mock(Release.class);
        final Repo repo = new MkGithub("john").repos().create(
            Json.createObjectBuilder().add("name", "test").build()
        );
        Mockito.doReturn(repo).when(release).repo();
        Mockito.doReturn(1).when(release).number();
        return release;
View Full Code Here

Examples of com.jcabi.github.mock.MkGithub

     * This method returns a Repo for testing.
     * @return Repo - a repo to be used for test.
     * @throws Exception - if anything goes wrong.
     */
    private static Repo repo() throws Exception {
        return new MkGithub().repos().create(
            Json.createObjectBuilder().add("name", "test").build()
        );
    }
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.