Examples of JdkRequest


Examples of com.jcabi.http.request.JdkRequest

            )
        ).start();
        final Gist gist = Mockito.mock(Gist.class);
        Mockito.doReturn("2").when(gist).identifier();
        final RtGistComments comments = new RtGistComments(
            new JdkRequest(container.home()),
            gist
        );
        MatcherAssert.assertThat(
            comments.iterate(),
            Matchers.<GistComment>iterableWithSize(2)
View Full Code Here

Examples of com.jcabi.http.request.JdkRequest

            )
        ).next(answer).start();
        final Gist gist = Mockito.mock(Gist.class);
        Mockito.doReturn("3").when(gist).identifier();
        final RtGistComments comments = new RtGistComments(
            new JdkRequest(container.home()),
            gist
        );
        final GistComment comment = comments.post(body);
        MatcherAssert.assertThat(
            container.take().method(),
View Full Code Here

Examples of com.jcabi.http.request.JdkRequest

        final Coordinates coordinates = new Coordinates.Simple(
            "test_user", "test_repo"
        );
        Mockito.doReturn(coordinates).when(owner).coordinates();
        final RtForks forks = new RtForks(
            new JdkRequest(container.home()),
            owner
        );
        final Fork fork = forks.create(organization);
        MatcherAssert.assertThat(
            container.take().method(),
View Full Code Here

Examples of com.jcabi.http.request.JdkRequest

    public void canFetchEmptyListOfHooks() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "[]")
        ).start();
        final Hooks hooks = new RtHooks(
            new JdkRequest(container.home()),
            RtHooksTest.repo()
        );
        try {
            MatcherAssert.assertThat(
                hooks.iterate(),
View Full Code Here

Examples of com.jcabi.http.request.JdkRequest

                    .add(hook("hook 2", Collections.<String, String>emptyMap()))
                    .build().toString()
            )
        ).start();
        final RtHooks hooks = new RtHooks(
            new JdkRequest(container.home()),
            RtHooksTest.repo()
        );
        MatcherAssert.assertThat(
            hooks.iterate(),
            Matchers.<Hook>iterableWithSize(2)
View Full Code Here

Examples of com.jcabi.http.request.JdkRequest

                    Collections.<String, String>emptyMap()
                ).toString()
            )
        ).start();
        final Hooks hooks = new RtHooks(
            new JdkRequest(container.home()),
            RtHooksTest.repo()
        );
        final Hook hook = hooks.get(1);
        MatcherAssert.assertThat(
            new Hook.Smart(hook).name(),
View Full Code Here

Examples of com.jcabi.http.request.JdkRequest

        final String body = RtHooksTest.hook(name, config).toString();
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_CREATED, body)
        ).next(new MkAnswer.Simple(HttpURLConnection.HTTP_OK, body)).start();
        final Hooks hooks = new RtHooks(
            new JdkRequest(container.home()),
            RtHooksTest.repo()
        );
        try {
            final Hook hook = hooks.create(name, config);
            MatcherAssert.assertThat(
View Full Code Here

Examples of com.jcabi.http.request.JdkRequest

    public void canDeleteHook() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_NO_CONTENT, "")
        ).start();
        final Hooks hooks = new RtHooks(
            new JdkRequest(container.home()),
            RtHooksTest.repo()
        );
        hooks.remove(1);
        try {
            final MkQuery query = container.take();
View Full Code Here

Examples of com.jcabi.http.request.JdkRequest

     * Ctor.
     * @param urn Owner URN
     * @param token Security token
     */
    public RtSttc(final URN urn, final String token) {
        this.request = new JdkRequest("http://www.stateful.co")
            .header("X-Sttc-URN", urn.toString())
            .header("X-Sttc-Token", token)
            .header(HttpHeaders.ACCEPT, MediaType.TEXT_XML)
            .header(HttpHeaders.USER_AGENT, "java-sdk.stateful.co");
    }
View Full Code Here

Examples of com.jcabi.http.request.JdkRequest

        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
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.