Package com.thoughtworks.inproctester.resteasy

Examples of com.thoughtworks.inproctester.resteasy.InProcessClientExecutor


        httpAppTester.stop();
    }

    @Test
    public void shouldAddResource() throws Exception {
        ClientRequest request = new ClientRequest("http://localhost/", new InProcessClientExecutor(httpAppTester));
        JsonNode testResource = objectMapper.readValue("{\"name\":\"test\"}", JsonNode.class);
        ClientResponse<JsonNode> createResponse = request.body(MediaType.APPLICATION_JSON, testResource).post(JsonNode.class);

        Assert.assertEquals(201, createResponse.getStatus());
        JsonNode entity = createResponse.getEntity();
View Full Code Here


//        Assert.assertEquals(testResource, testResourceFromServer);
    }

    @Test
    public void shouldGetResource() throws Exception {
        ClientRequest request = new ClientRequest("http://localhost/", new InProcessClientExecutor(httpAppTester));
        JsonNode testResource = objectMapper.readValue("{\"name\":\"test\"}", JsonNode.class);
        ClientResponse<JsonNode> response = request.body(MediaType.APPLICATION_JSON, testResource).post(JsonNode.class);

        request = new ClientRequest(response.getLocation().getHref(), new InProcessClientExecutor(httpAppTester));
        response = request.accept(MediaType.APPLICATION_JSON).get(JsonNode.class);

        Assert.assertEquals(200, response.getStatus());
        JsonNode entity = response.getEntity();
        Assert.assertEquals(testResource, entity);
View Full Code Here

TOP

Related Classes of com.thoughtworks.inproctester.resteasy.InProcessClientExecutor

Copyright © 2018 www.massapicom. 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.