Package com.github.restdriver.serverdriver.http.response

Examples of com.github.restdriver.serverdriver.http.response.Response


    @Test
    public void testShouldGetAllChecksByMutualNamePattern() {
        Set<String> locations =  createStubChecksForPatternMatching();

        Response response = get(checks().withParam("fields", "name").withParam("regexes", "patternName"));
        assertThat(response, hasStatusCode(200));
        JsonNode responseJson = response.asJson();
        assertThat(responseJson, hasJsonPath("$.values", hasSize(3)));

        cleanupChecks(locations);
    }
View Full Code Here


    @Test
    public void testShouldGetMatchingChecksByRegexCharacterNamePattern() {
        Set<String> locations =  createStubChecksForPatternMatching();

        Response response = get(checks().withParam("fields", "name").withParam("regexes", "patternName\\d"));
        assertThat(response, hasStatusCode(200));
        JsonNode responseJson = response.asJson();
        assertThat(responseJson, hasJsonPath("$.values", hasSize(2)));

        cleanupChecks(locations);
    }
View Full Code Here

    @Test
    public void testShouldGetNoChecksByNonexistentNamePattern() {
        Set<String> locations =  createStubChecksForPatternMatching();

        Response response = get(checks().withParam("fields", "name").withParam("regexes", "doesnotexist"));
        assertThat(response, hasStatusCode(200));
        JsonNode responseJson = response.asJson();
        assertThat(responseJson, hasJsonPath("$.values", hasSize(0)));

        cleanupChecks(locations);
    }
View Full Code Here

            deleteLocation(location);
        }
    }

    private Response createCheck(String body) {
        Response response = post(checks(), body(body, "application/json"));
        assertThat(response, hasStatusCode(201));
        assertThat(response, hasHeader("Location"));
        return response;
    }
View Full Code Here

public class SubscriptionsAT {
   
    @Test
    public void testCreateSubscriptionReturnsCreated() {
        Header checkLocation = createCheck("{ }").getHeader("Location");
        Response response = createSubscription(checkLocation, "{ }");
        assertThat(response, hasStatusCode(201));
        deleteLocation(checkLocation.getValue());
    }
View Full Code Here

        assertThat(response, hasStatusCode(201));
        deleteLocation(checkLocation.getValue());
    }
   
    private Response createCheck(String body) {
        Response response = post(checks(), body(body, "application/json"));
        assertThat(response, hasStatusCode(201));
        assertThat(response, hasHeader("Location"));
        return response;
    }
View Full Code Here

        assertThat(response, hasHeader("Location"));
        return response;
    }
   
    private Response createSubscription(Header checkLocation, String body) {
        Response response = post(subscriptions(checkLocation), body(body, "application/json"));
        assertThat(response, hasStatusCode(201));
        assertThat(response, hasHeader("Location"));
        return response;
    }
View Full Code Here

TOP

Related Classes of com.github.restdriver.serverdriver.http.response.Response

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.