Examples of MkGithub


Examples of com.jcabi.github.mock.MkGithub

            new MkGrizzlyContainer().next(first).next(second).next(third)
                .start();
        final MkContainer gistContainer = new MkGrizzlyContainer().start();
        final RtGist gist =
            new RtGist(
                new MkGithub(),
                new ApacheRequest(gistContainer.home()), "someName"
            );
        final RtGistComment comment = new RtGistComment(
            new ApacheRequest(container.home()), gist, identifier
        );
View Full Code Here

Examples of com.jcabi.github.mock.MkGithub

        final int identifier = 1;
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_NO_CONTENT, "")
        ).start();
        final RtGist gist = new RtGist(
            new MkGithub(),
            new FakeRequest().withStatus(HttpURLConnection.HTTP_NO_CONTENT),
            "gistName"
        );
        final RtGistComment comment = new RtGistComment(
            new ApacheRequest(container.home()), gist, identifier
View Full Code Here

Examples of com.jcabi.github.mock.MkGithub

                "{\"files\":{\"hello\":{\"raw_url\":\"world\"}}}"
            )
        ).next(new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "success!"))
            .start();
        final RtGist gist = new RtGist(
            new MkGithub(),
            new ApacheRequest(container.home()),
            "test"
        );
        try {
            MatcherAssert.assertThat(
View Full Code Here

Examples of com.jcabi.github.mock.MkGithub

    public void writesFileContents() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "testFileWrite")
        ).start();
        final RtGist gist = new RtGist(
            new MkGithub(),
            new ApacheRequest(container.home()),
            "testWrite"
        );
        gist.write("testFile", "testContent");
        try {
View Full Code Here

Examples of com.jcabi.github.mock.MkGithub

        container.next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, fileContent)
        );
        container.start();
        final Gist gist = new RtGist(
            new MkGithub(),
            new ApacheRequest(container.home()),
            "test"
        );
        final String content = gist.read("hello");
        final Gist forkedGist = gist.fork();
View Full Code Here

Examples of com.jcabi.github.mock.MkGithub

                "{\"files\":{\"something\":{\"filename\":\"not null\"}}}"
            )
        ).start();
        final Gist.Smart smart = new Gist.Smart(
            new RtGist(
                new MkGithub(),
                new ApacheRequest(container.home()),
                "testGetFiles"
            )
        );
        try {
View Full Code Here

Examples of com.jcabi.github.mock.MkGithub

     */
    @Test
    public void canRepresentAsString() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().start();
        final RtGist gist = new RtGist(
            new MkGithub(),
            new ApacheRequest(container.home()),
            "testToString"
        );
        try {
            MatcherAssert.assertThat(
View Full Code Here

Examples of com.jcabi.github.mock.MkGithub

    public void canUnstarAGist() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_NO_CONTENT, "")
        ).start();
        final RtGist gist = new RtGist(
            new MkGithub(),
            new ApacheRequest(container.home()),
            "unstar"
        );
        gist.unstar();
        final MkQuery query = container.take();
View Full Code Here

Examples of com.jcabi.github.mock.MkGithub

        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "{\"msg\":\"hi\"}")
        ).start();
        try {
            final RtGist gist = new RtGist(
                new MkGithub(),
                new ApacheRequest(container.home()),
                "patch"
            );
            gist.patch(
                Json.createObjectBuilder()
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
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.