Examples of json()


Examples of com.jcabi.github.ReleaseAsset.json()

        final String type = "text/plain";
        final ReleaseAsset asset = release().assets().upload(
            "testJson".getBytes(), type, name
        );
        MatcherAssert.assertThat(
            asset.json().getString("content_type"),
            Matchers.is(type)
        );
        MatcherAssert.assertThat(
            asset.json().getString("name"),
            Matchers.is(name)
View Full Code Here

Examples of com.jcabi.github.ReleaseAsset.json()

        MatcherAssert.assertThat(
            asset.json().getString("content_type"),
            Matchers.is(type)
        );
        MatcherAssert.assertThat(
            asset.json().getString("name"),
            Matchers.is(name)
        );
    }

    /**
 
View Full Code Here

Examples of com.jcabi.github.ReleaseAsset.json()

        final ReleaseAsset asset = release().assets().upload(
            "testPatch".getBytes(), "text/plain", orig
        );
        final String attribute = "name";
        MatcherAssert.assertThat(
            asset.json().getString(attribute),
            Matchers.is(orig)
        );
        final String patched = "patched.txt";
        asset.patch(
            Json.createObjectBuilder().add(attribute, patched).build()
View Full Code Here

Examples of com.jcabi.github.ReleaseAsset.json()

        final String patched = "patched.txt";
        asset.patch(
            Json.createObjectBuilder().add(attribute, patched).build()
        );
        MatcherAssert.assertThat(
            asset.json().getString(attribute),
            Matchers.is(patched)
        );
    }

    /**
 
View Full Code Here

Examples of com.jcabi.github.RepoCommit.json()

            .add("committer", MkContentsTest.committer())
            .build();
        final RepoCommit commit = repo.contents().remove(json);
        MatcherAssert.assertThat(commit, Matchers.notNullValue());
        MatcherAssert.assertThat(
            commit.json().getString("message"),
            Matchers.equalTo("theDeleteMessage")
        );
    }

    /**
 
View Full Code Here

Examples of com.jcabi.github.RepoCommit.json()

            .add("committer", MkContentsTest.committer())
            .build();
        final RepoCommit commit = repo.contents().remove(json);
        MatcherAssert.assertThat(commit, Matchers.notNullValue());
        MatcherAssert.assertThat(
            commit.json().getString("message"),
            Matchers.equalTo("theDeleteMessage")
        );
    }

    /**
 
View Full Code Here

Examples of com.jcabi.github.UserEmails.json()

    public void canRepresentAsJson() throws Exception {
        final UserEmails emails = new MkGithub().users().get("jeff").emails();
        final String email = "jeff@something.net";
        emails.add(Collections.singleton(email));
        MatcherAssert.assertThat(
            emails.json().getString("email"),
            Matchers.is(email)
        );
    }

}
View Full Code Here

Examples of com.jcabi.http.response.JsonResponse.json()

        final JsonResponse resp = github.entry()
            .uri().path("/search/repositories")
            .queryParam("q", "java").back()
            .fetch()
            .as(JsonResponse.class);
        final List<JsonObject> items = resp.json().readObject()
            .getJsonArray("items")
            .getValuesAs(JsonObject.class);
        for (final JsonObject item : items) {
            System.out.println(
                String.format(
View Full Code Here

Examples of com.jcabi.http.response.JsonResponse.json()

    public void readNonUnicode() throws Exception {
        final Response resp = new FakeRequest()
            .withBody("{\"help\": \"\u001Fblah\u0001cwhoa\u0000!\"}").fetch();
        final JsonResponse response = new JsonResponse(resp);
        MatcherAssert.assertThat(
            response.json().readObject().getString("help"),
            Matchers.is("\u001Fblah\u0001cwhoa\u0000!")
        );
    }

    /**
 
View Full Code Here

Examples of org.apache.sling.testing.mock.sling.loader.ContentLoader.json()

        this.context = new SlingContextImpl();
        this.context.setResourceResolverType(ResourceResolverType.RESOURCERESOLVER_MOCK);
        this.context.setUp();

        ContentLoader contentLoader = this.context.load();
        contentLoader.json("/json-import-samples/content.json", "/content/sample/en");
    }

    @After
    public void tearDown() throws Exception {
        this.context.tearDown();
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.