Package com.jcabi.http.mock

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


            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(
            new ApacheRequest(container.home()), issue, 10
        );
        try {
            comment.remove();
            final MkQuery query = container.take();
            MatcherAssert.assertThat(
View Full Code Here


            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(
            new ApacheRequest(container.home()), issue, 10
        );
        try {
            final JsonObject json = comment.json();
            MatcherAssert.assertThat(
                json.getString("body"),
View Full Code Here

            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "")
        ).start();
        final Repo repo = repo();
        final Issue issue = repo.issues().create("testing5", "issue5");
        final RtComment comment = new RtComment(
            new ApacheRequest(container.home()), issue, 10
        );
        final JsonObject jsonPatch = Json.createObjectBuilder()
            .add("title", "test comment").build();
        try {
            comment.patch(jsonPatch);
View Full Code Here

            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "")
        ).start();
        final Repo repo = repo();
        final Issue issue = repo.issues().create("testing6", "issue6");
        final RtComment comment = new RtComment(
            new ApacheRequest(container.home()), issue, 10
        );
        try {
            final String stringComment = comment.toString();
            MatcherAssert.assertThat(
                stringComment, Matchers.not(Matchers.isEmptyOrNullString())
View Full Code Here

            )
        ).start();
        try {
            final Organizations orgs = new RtOrganizations(
                new MkGithub(),
                new ApacheRequest(container.home()),
                Mockito.mock(User.class)
            );
            MatcherAssert.assertThat(
                orgs.iterate(),
                Matchers.<Organization>iterableWithSize(3)
View Full Code Here

            )
        ).start();
        try {
            final Organizations orgs = new RtOrganizations(
                new MkGithub(),
                new ApacheRequest(container.home()),
                Mockito.mock(User.class)
            );
            final String username = "octopus";
            MatcherAssert.assertThat(
                orgs.iterate(username),
View Full Code Here

            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "")
        ).start();
        try {
            final Organizations orgs = new RtOrganizations(
                new MkGithub(),
                new ApacheRequest(container.home()),
                Mockito.mock(User.class)
            );
            MatcherAssert.assertThat(
                orgs.get("org"),
                Matchers.notNullValue()
View Full Code Here

                    .add(RtAssigneesTest.json("dummy"))
                    .build().toString()
            )
        ).start();
        final Assignees users = new RtAssignees(
            new JdkRequest(container.home()),
            this.repo()
        );
        MatcherAssert.assertThat(
            users.iterate(),
            Matchers.<User>iterableWithSize(2)
View Full Code Here

                    .add(RtAssigneesTest.json("dummy"))
                    .build().toString()
            )
        ).start();
        final Assignees users = new RtAssignees(
            new JdkRequest(container.home()),
            this.repo()
        );
        MatcherAssert.assertThat(
            users.check("octocat2"),
            Matchers.equalTo(true)
View Full Code Here

                    .add(RtAssigneesTest.json("dummy"))
                    .build().toString()
            )
        ).start();
        final Assignees users = new RtAssignees(
            new JdkRequest(container.home()),
            this.repo()
        );
        MatcherAssert.assertThat(
            users.check("octocat33"),
            Matchers.equalTo(false)
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.