public void testGetAggregateForResource77DataPoints() throws Exception {
addDataToSchedule(1);
JsonPath jp =
given()
.header(acceptJson)
.pathParam("resourceId", _platformId)
.queryParam("includeDataPoints",true)
.queryParam("dataPoints",77)
.expect()
.statusCode(200)
.body("scheduleId", hasItem(numericScheduleId))
.body("[0].dataPoints", iterableWithSize(77))
.body("[0].numDataPoints",is(77))
.log().everything()
.when()
.get("/metric/data/resource/{resourceId}")
.jsonPath();
List<Map<String,Object>> map = jp.getList("");
for (Map<String,Object> entry : map) {
if (((Integer)entry.get("scheduleId")) == numericScheduleId) {
// assert entry.get("avg").equals(1.5f) : "Expected an avg of 1.5, but was " + entry.get("avg");
assert entry.get("min").equals(1.5f) : "Expected an min of 1.5, but was " + entry.get("min");