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

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


        when(mockEntity.getContent()).thenReturn(IOUtils.toInputStream("This is not really json, is it?", "utf-8"));
        HttpResponse mockResponse = createMockResponse(mockEntity);
        Response response = new DefaultResponse(mockResponse, 12345);
       
        try {
            response.asJson();
            Assert.fail();
           
        } catch (RuntimeMappingException rme) {
            assertThat(rme.getMessage(), is("Can't parse JSON.  Bad content >> This is not real..."));
           
View Full Code Here


    public void getAcceptanceTestSeyrenConfig() {
        Response response = get(config());
        assertThat(response, hasStatusCode(200));
       
        // Base
        assertThat(response.asJson().size(), is(3));
        assertThat(response.asJson(), hasJsonPath("$.baseUrl", not(isEmptyOrNullString())));
        assertThat(response.asJson(), hasJsonPath("$.graphiteCarbonPickleEnabled", is(false)));
        assertThat(response.asJson(), hasJsonPath("$.graphsEnabled", is(true)));
    }
   
View Full Code Here

        Response response = get(config());
        assertThat(response, hasStatusCode(200));
       
        // Base
        assertThat(response.asJson().size(), is(3));
        assertThat(response.asJson(), hasJsonPath("$.baseUrl", not(isEmptyOrNullString())));
        assertThat(response.asJson(), hasJsonPath("$.graphiteCarbonPickleEnabled", is(false)));
        assertThat(response.asJson(), hasJsonPath("$.graphsEnabled", is(true)));
    }
   
}
View Full Code Here

        assertThat(response, hasStatusCode(200));
       
        // Base
        assertThat(response.asJson().size(), is(3));
        assertThat(response.asJson(), hasJsonPath("$.baseUrl", not(isEmptyOrNullString())));
        assertThat(response.asJson(), hasJsonPath("$.graphiteCarbonPickleEnabled", is(false)));
        assertThat(response.asJson(), hasJsonPath("$.graphsEnabled", is(true)));
    }
   
}
View Full Code Here

       
        // Base
        assertThat(response.asJson().size(), is(3));
        assertThat(response.asJson(), hasJsonPath("$.baseUrl", not(isEmptyOrNullString())));
        assertThat(response.asJson(), hasJsonPath("$.graphiteCarbonPickleEnabled", is(false)));
        assertThat(response.asJson(), hasJsonPath("$.graphsEnabled", is(true)));
    }
   
}
View Full Code Here

   
    @Test
    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)));
    }
   
View Full Code Here

    @Test
    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
View Full Code Here

    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

        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

   
    @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

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.