Examples of asJson()


Examples of com.github.restdriver.serverdriver.http.response.Response.asJson()

    public void testGetAlertsReturnsOk() {
        Response response = get(alerts("1"));
        assertThat(response, hasStatusCode(200));
        assertThat(response.asJson(), hasJsonPath("$.values", hasSize(0)));
        assertThat(response.asJson(), hasJsonPath("$.items", is(20)));
        assertThat(response.asJson(), hasJsonPath("$.start", is(0)));
        assertThat(response.asJson(), hasJsonPath("$.total", is(0)));
    }
   
    @Test
    public void testGetAlertsInvalidStart() {
View Full Code Here

Examples of com.github.restdriver.serverdriver.http.response.Response.asJson()

        Response response = get(alerts("1"));
        assertThat(response, hasStatusCode(200));
        assertThat(response.asJson(), hasJsonPath("$.values", hasSize(0)));
        assertThat(response.asJson(), hasJsonPath("$.items", is(20)));
        assertThat(response.asJson(), hasJsonPath("$.start", is(0)));
        assertThat(response.asJson(), hasJsonPath("$.total", is(0)));
    }
   
    @Test
    public void testGetAlertsInvalidStart() {
        Response response = get(alerts("1").withParam("start", "-1"));
View Full Code Here

Examples of com.github.restdriver.serverdriver.http.response.Response.asJson()

   
    @Test
    public void testGetChecksReturnsOk() {
        Response response = get(checks());
        assertThat(response, hasStatusCode(200));
        assertThat(response.asJson(), hasJsonPath("$.values", hasSize(0)));
    }
   
    @Test
    public void testGetChecksReturnsResultsOk() {
        Response createResponse = createCheck("{ }");
View Full Code Here

Examples of com.github.restdriver.serverdriver.http.response.Response.asJson()

    @Test
    public void testGetChecksReturnsResultsOk() {
        Response createResponse = createCheck("{ }");
        Response response = get(checks());
        assertThat(response, hasStatusCode(200));
        assertThat(response.asJson(), hasJsonPath("$.values", hasSize(1)));
        deleteLocation(createResponse.getHeader("Location").getValue());
    }
   
    @Test
    public void testGetChecksByErrorStateReturnsOk() {
View Full Code Here

Examples of com.github.restdriver.serverdriver.http.response.Response.asJson()

    @Test
    public void testGetChecksByErrorStateReturnsOk() {
        Response createResponse = createCheck("{ \"state\" : \"ERROR\" }");
        Response response = get(checks().withParam("state", "ERROR"));
        assertThat(response, hasStatusCode(200));
        assertThat(response.asJson(), hasJsonPath("$.values", hasSize(1)));
        deleteLocation(createResponse.getHeader("Location").getValue());
    }
   
    @Test
    public void testGetChecksByWarnStateReturnsOk() {
View Full Code Here

Examples of com.github.restdriver.serverdriver.http.response.Response.asJson()

    @Test
    public void testGetChecksByWarnStateReturnsOk() {
        Response createResponse = createCheck("{ \"state\" : \"WARN\" }");
        Response response = get(checks().withParam("state", "WARN"));
        assertThat(response, hasStatusCode(200));
        assertThat(response.asJson(), hasJsonPath("$.values", hasSize(1)));
        deleteLocation(createResponse.getHeader("Location").getValue());
    }
   
    @Test
    public void testCreateCheckReturnsCreated() {
View Full Code Here

Examples of com.github.restdriver.serverdriver.http.response.Response.asJson()

    public void testShouldGetOneCheckByIsolatedNamePattern() {
        Set<String> locations =  createStubChecksForPatternMatching();

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

        cleanupChecks(locations);
    }
View Full Code Here

Examples of com.github.restdriver.serverdriver.http.response.Response.asJson()

    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

Examples of com.github.restdriver.serverdriver.http.response.Response.asJson()

    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

Examples of com.github.restdriver.serverdriver.http.response.Response.asJson()

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