Package com.jcabi.http.mock

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


                HttpURLConnection.HTTP_OK,
                "[{\"ref\":\"refs/tags/feature-b\"}]"
            )
        ).start();
        final References refs = new RtReferences(
            new ApacheRequest(container.home()),
            repo()
        );
        try {
            MatcherAssert.assertThat(
                refs.tags(),
View Full Code Here


                HttpURLConnection.HTTP_OK,
                "[{\"ref\":\"refs/heads/feature-c\"}]"
            )
        ).start();
        final References refs = new RtReferences(
            new ApacheRequest(container.home()),
            repo()
        );
        try {
            MatcherAssert.assertThat(
                refs.heads(),
View Full Code Here

                HttpURLConnection.HTTP_OK,
                "{\"test\":\"events\"}"
            )
        ).start();
        final RtEvent event = new RtEvent(
            new ApacheRequest(container.home()),
            this.repo(),
            3
        );
        try {
            MatcherAssert.assertThat(
View Full Code Here

        final String jessy = "Jessy";
        final MkContainer container = new MkGrizzlyContainer().next(
            RtValuePaginationTest.simple(jeff, mark)
                .withHeader("Link", "</s?page=3&per_page=100>; rel=\"next\"")
        ).next(RtValuePaginationTest.simple(judy, jessy)).start();
        final Request request = new ApacheRequest(container.home());
        final RtValuePagination<JsonObject, JsonArray> page =
            new RtValuePagination<JsonObject, JsonArray>(
                request,
                new RtValuePagination.Mapping<JsonObject, JsonArray>() {
                    @Override
View Full Code Here

                HttpURLConnection.HTTP_OK,
                "[{\"commits\":\"test\"}]"
            )
        ).start();
        final RtPull pull = new RtPull(
            new ApacheRequest(container.home()),
            this.repo(),
            1
        );
        try {
            MatcherAssert.assertThat(
View Full Code Here

                HttpURLConnection.HTTP_OK,
                "[{\"file1\":\"testFile\"}]"
            )
        ).start();
        final RtPull pull = new RtPull(
            new ApacheRequest(container.home()),
            this.repo(),
            2
        );
        try {
            MatcherAssert.assertThat(
View Full Code Here

    public void executeMerge() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "testMerge")
        ).start();
        final RtPull pull = new RtPull(
            new ApacheRequest(container.home()),
            this.repo(),
            3
        );
        pull.merge("Test commit.");
        try {
View Full Code Here

    public void patchWithJson() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "response")
        ).start();
        final RtIssue issue = new RtIssue(
            new ApacheRequest(container.home()),
            this.repo(),
            1
        );
        issue.patch(
            Json.createObjectBuilder().add("patch", "test").build()
View Full Code Here

    public void jumpNextPage() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            RtPaginationTest.simple("Hi Jeff")
                .withHeader("Link", "</s?page=3&per_page=100>; rel=\"next\"")
        ).next(RtPaginationTest.simple("Hi Mark")).start();
        final Request request = new ApacheRequest(container.home());
        final RtPagination<JsonObject> page = new RtPagination<JsonObject>(
            request, new RtPagination.Mapping<JsonObject, JsonObject>() {
                @Override
                public JsonObject map(final JsonObject object) {
                    return object;
View Full Code Here

    @Test(expected = NoSuchElementException.class)
    public void throwsIfNoMoreElement() throws Exception {
        final MkContainer container = new MkGrizzlyContainer()
            .next(simple("Hi there")).start();
        try {
            final Request request = new ApacheRequest(container.home());
            final RtPagination<JsonObject> page = new RtPagination<JsonObject>(
                request, new RtPagination.Mapping<JsonObject, JsonObject>() {
                    @Override
                    public JsonObject map(final JsonObject object) {
                        return object;
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.