Package com.jcabi.http.mock

Examples of com.jcabi.http.mock.MkContainer.home()


        final String rel = release(tag).toString();
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_CREATED, rel)
        ).next(new MkAnswer.Simple(HttpURLConnection.HTTP_OK, rel)).start();
        final RtReleases releases = new RtReleases(
            new JdkRequest(container.home()),
            repo()
        );
        final Release release = releases.create(tag);
        MatcherAssert.assertThat(
            container.take().method(),
View Full Code Here


                HttpURLConnection.HTTP_NO_CONTENT,
                ""
            )
        ).start();
        final Releases releases = new RtReleases(
            new ApacheRequest(container.home()),
            RtReleasesTest.repo()
        );
        try {
            releases.remove(1);
            final MkQuery query = container.take();
View Full Code Here

        final String body = pull(title).toString();
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_CREATED, body)
        ).next(new MkAnswer.Simple(HttpURLConnection.HTTP_OK, body)).start();
        final RtPulls pulls = new RtPulls(
            new ApacheRequest(container.home()),
            repo()
        );
        final Pull pull = pulls.create(title, "octocat", "master");
        MatcherAssert.assertThat(
            container.take().method(),
View Full Code Here

                HttpURLConnection.HTTP_OK,
                pull(title).toString()
            )
        ).start();
        final RtPulls pulls = new RtPulls(
            new ApacheRequest(container.home()),
            repo()
        );
        final Pull pull = pulls.get(Tv.BILLION);
        MatcherAssert.assertThat(
            new Pull.Smart(pull).title(),
View Full Code Here

                    .add(pull("Amazing new feature"))
                    .build().toString()
            )
        ).start();
        final RtPulls pulls = new RtPulls(
            new ApacheRequest(container.home()),
            repo()
        );
        MatcherAssert.assertThat(
            pulls.iterate(),
            Matchers.<Pull>iterableWithSize(2)
View Full Code Here

    public void patchesAsset() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "")
        ).start();
        final RtReleaseAsset asset = new RtReleaseAsset(
            new ApacheRequest(container.home()),
            release(),
            2
        );
        try {
            final JsonObject json = Json.createObjectBuilder()
View Full Code Here

    public void removesAsset() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_NO_CONTENT, "")
        ).start();
        final RtReleaseAsset asset = new RtReleaseAsset(
            new ApacheRequest(container.home()),
            release(),
            3
        );
        try {
            asset.remove();
View Full Code Here

    public void rawAsset() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "")
        ).start();
        final RtReleaseAsset asset = new RtReleaseAsset(
            new ApacheRequest(container.home()),
            release(),
            4
        );
        try {
            final InputStream stream = asset.raw();
View Full Code Here

    @Test
    public void sendHttpRequest() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "{\"body\":\"hi\"}")
        ).start();
        final RtJson json = new RtJson(new ApacheRequest(container.home()));
        MatcherAssert.assertThat(
            json.fetch().getString("body"),
            Matchers.equalTo("hi")
        );
        container.stop();
View Full Code Here

    @Test
    public void executePatchRequest() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "{\"body\":\"hj\"}")
        ).start();
        final RtJson json = new RtJson(new ApacheRequest(container.home()));
        json.patch(
            Json.createObjectBuilder()
                .add("content", "hi you!")
                .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.