Package com.jcabi.http.mock

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, "{\"body\":\"hj\"}")
        ).start();
        final RtJson json = new RtJson(new ApacheRequest(container.home()));
        json.patch(
            Json.createObjectBuilder()
View Full Code Here


     * This tests that the remove() method is working fine.
     * @throws Exception - in case something goes wrong.
     */
    @Test
    public void removesComment() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_NO_CONTENT, "")
        ).start();
        final Repo repo = repo();
        final Issue issue = repo.issues().create("testing3", "issue3");
        final RtComment comment = new RtComment(
View Full Code Here

     * @throws Exception - if something goes wrong.
     */
    @Test
    public void returnsItsJSon() throws Exception {
        final String body = "{\"body\":\"test5\"}";
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, body)
        ).start();
        final Repo repo = repo();
        final Issue issue = repo.issues().create("testing4", "issue4");
        final RtComment comment = new RtComment(
View Full Code Here

     * RtComment can patch a comment.
     * @throws Exception - if anything goes wrong.
     */
    @Test
    public void patchesComment() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "")
        ).start();
        final Repo repo = repo();
        final Issue issue = repo.issues().create("testing5", "issue5");
        final RtComment comment = new RtComment(
View Full Code Here

     * This tests that the toString() method is working fine.
     * @throws Exception - if anything goes wrong.
     */
    @Test
    public void givesToString() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "")
        ).start();
        final Repo repo = repo();
        final Issue issue = repo.issues().create("testing6", "issue6");
        final RtComment comment = new RtComment(
View Full Code Here

     * @throws Exception If a problem occurs
     * @checkstyle MagicNumberCheck (25 lines)
     */
    @Test
    public void retrievesOrganizations() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_OK,
                Json.createArrayBuilder()
                    .add(org(1, "org1"))
                    .add(org(2, "org2"))
View Full Code Here

     *
     * @throws Exception If a problem occurs
     */
    @Test
    public void canIterateOrganizationsForUnauthUser() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_OK,
                Json.createArrayBuilder()
                    .add(org(Tv.THREE, "org11"))
                    .add(org(Tv.FOUR, "org12"))
View Full Code Here

     *
     * @throws Exception if a problem occurs
     */
    @Test
    public void fetchesSingleOrganization() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "")
        ).start();
        try {
            final Organizations orgs = new RtOrganizations(
                new MkGithub(),
View Full Code Here

     * RtAssignees can iterate over assignees.
     * @throws Exception Exception If some problem inside
     */
    @Test
    public void iteratesAssignees() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_OK,
                Json.createArrayBuilder()
                    .add(RtAssigneesTest.json("octocat"))
                    .add(RtAssigneesTest.json("dummy"))
View Full Code Here

     * RtAssignees can check if user is assignee for this repo.
     * @throws Exception Exception If some problem inside
     */
    @Test
    public void checkUserIsAssigneeForRepo() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(
                HttpURLConnection.HTTP_NO_CONTENT,
                Json.createArrayBuilder()
                    .add(RtAssigneesTest.json("octocat2"))
                    .add(RtAssigneesTest.json("dummy"))
View Full Code Here

TOP

Related Classes of com.jcabi.http.mock.MkGrizzlyContainer

Copyright © 2018 www.massapicom. 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.