Examples of MockHttpServerResponse


Examples of org.apache.wink.client.MockHttpServer.MockHttpServerResponse

        });
        assertEquals(RECEIVED_MESSAGE, tg.getT());
    }

    public void testInvoke() {
        MockHttpServerResponse response1 = new MockHttpServerResponse();
        response1.setMockResponseCode(200);
        MockHttpServerResponse response2 = new MockHttpServerResponse();
        response2.setMockResponseCode(200);
        server.setMockHttpServerResponses(response1, response2);
        RestClient client = getRestClient();
        Resource resource = client.resource(serviceURL);

        String string = resource.invoke("GET", String.class, null);
View Full Code Here

Examples of org.apache.wink.client.MockHttpServer.MockHttpServerResponse

        } catch (IllegalArgumentException e) {
        }
    }

    public void testResourceGet() {
        MockHttpServerResponse response1 = new MockHttpServerResponse();
        response1.setMockResponseCode(200);
        MockHttpServerResponse response2 = new MockHttpServerResponse();
        response2.setMockResponseCode(200);
        MockHttpServerResponse response3 = new MockHttpServerResponse();
        response3.setMockResponseCode(200);
        server.setMockHttpServerResponses(response1, response2, response3);
        RestClient client = getRestClient();
        Resource resource = client.resource(serviceURL);

        String string = resource.get(String.class);
View Full Code Here

Examples of org.apache.wink.client.MockHttpServer.MockHttpServerResponse

        });
        assertEquals(RECEIVED_MESSAGE, tg.getT());
    }

    public void testResourcePut() throws IOException {
        MockHttpServerResponse response1 = new MockHttpServerResponse();
        response1.setMockResponseCode(200);
        MockHttpServerResponse response2 = new MockHttpServerResponse();
        response2.setMockResponseCode(200);
        MockHttpServerResponse response3 = new MockHttpServerResponse();
        response3.setMockResponseCode(200);
        server.setMockHttpServerResponses(response1, response2, response3);
        RestClient client = getRestClient();
        Resource resource = client.resource(serviceURL + "/testResourcePut");
        String response =
            resource.contentType("text/plain").accept("text/plain").put(String.class, SENT_MESSAGE);
View Full Code Here

Examples of org.apache.wink.client.MockHttpServer.MockHttpServerResponse

        assertEquals(RECEIVED_MESSAGE, tg.getT());

    }

    public void testResourcePost() throws IOException {
        MockHttpServerResponse response1 = new MockHttpServerResponse();
        response1.setMockResponseCode(200);
        MockHttpServerResponse response2 = new MockHttpServerResponse();
        response2.setMockResponseCode(200);
        MockHttpServerResponse response3 = new MockHttpServerResponse();
        response3.setMockResponseCode(200);
        server.setMockHttpServerResponses(response1, response2, response3);
        RestClient client = getRestClient();
        Resource resource = client.resource(serviceURL + "/testResourcePost");
        String response =
            resource.contentType("text/plain").accept("text/plain")
View Full Code Here

Examples of org.apache.wink.client.MockHttpServer.MockHttpServerResponse

        }, SENT_MESSAGE);
        assertEquals(RECEIVED_MESSAGE, tg.getT());
    }

    public void testResourceDelete() {
        MockHttpServerResponse response1 = new MockHttpServerResponse();
        response1.setMockResponseCode(200);
        MockHttpServerResponse response2 = new MockHttpServerResponse();
        response2.setMockResponseCode(200);
        MockHttpServerResponse response3 = new MockHttpServerResponse();
        response3.setMockResponseCode(200);
        server.setMockHttpServerResponses(response1, response2, response3);
        RestClient client = getRestClient();
        Resource resource = client.resource(serviceURL);
        String response = resource.accept(MediaType.TEXT_PLAIN_TYPE).delete(String.class);
        assertEquals(RECEIVED_MESSAGE, response);
View Full Code Here

Examples of org.apache.wink.client.MockHttpServer.MockHttpServerResponse

        });
        assertEquals(RECEIVED_MESSAGE, tg.getT());
    }

    public void testInvoke() {
        MockHttpServerResponse response1 = new MockHttpServerResponse();
        response1.setMockResponseCode(200);
        MockHttpServerResponse response2 = new MockHttpServerResponse();
        response2.setMockResponseCode(200);
        server.setMockHttpServerResponses(response1, response2);
        RestClient client = getRestClient();
        Resource resource = client.resource(serviceURL);

        String string = resource.invoke("GET", String.class, null);
View Full Code Here

Examples of org.apache.wink.client.MockHttpServer.MockHttpServerResponse

    }

    public void testHeadersConcat() throws IOException {
        MockHttpServer server = new MockHttpServer(34567);

        MockHttpServerResponse response1 = new MockHttpServerResponse();
        response1.setMockResponseCode(200);
        MockHttpServerResponse response2 = new MockHttpServerResponse();
        response2.setMockResponseCode(200);
        MockHttpServerResponse response3 = new MockHttpServerResponse();
        response3.setMockResponseCode(200);
        MockHttpServerResponse response4 = new MockHttpServerResponse();
        response4.setMockResponseCode(200);

        server.setMockHttpServerResponses(response1, response2, response3, response4);

        server.startServer();
        // single
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.