Package com.jcabi.http.mock

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


                    .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


                    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

        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

    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

                    .build().toString()
            )
        ).start();
        final Users users = new RtUsers(
            Mockito.mock(Github.class),
            new ApacheRequest(container.home())
        );
        MatcherAssert.assertThat(
            users.iterate(identifier),
            Matchers.<User>iterableWithSize(2)
        );
View Full Code Here

                RtUsersTest.json(login, "3").toString()
            )
        ).start();
        final Users users = new RtUsers(
            Mockito.mock(Github.class),
            new ApacheRequest(container.home())
        );
        MatcherAssert.assertThat(
            users.get(login).login(),
            Matchers.equalTo(login)
        );
View Full Code Here

                RtUsersTest.json(login, "4").toString()
            )
        ).start();
        final Users users = new RtUsers(
            Mockito.mock(Github.class),
            new ApacheRequest(container.home())
        );
        MatcherAssert.assertThat(
            users.self().login(),
            Matchers.equalTo(login)
        );
View Full Code Here

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

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

    public void removesReference() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_NO_CONTENT, "")
        ).start();
        final References refs = new RtReferences(
            new ApacheRequest(container.home()),
            repo()
        );
        refs.remove("heads/feature-a");
        try {
            MatcherAssert.assertThat(
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.