*/
@Test
public void testPostRawDataRejectSome() throws Exception {
long now = System.currentTimeMillis();
MDataPoint dataPoint = new MDataPoint();
dataPoint.setScheduleId(numericScheduleId);
dataPoint.setTimeStamp(now);
dataPoint.setValue(1.5);
List<MDataPoint> points = new ArrayList<MDataPoint>(2);
points.add(dataPoint);
dataPoint = new MDataPoint();
dataPoint.setTimeStamp(now);
dataPoint.setValue(9999.0);
dataPoint.setScheduleId(99999);
points.add(dataPoint);
Response response = given()
.header(acceptJson)
.contentType(ContentType.JSON)
.body(points)
.expect()
.statusCode(201)
.log().ifError()
.when()
.post("/metric/data/raw");
Map<String, Object> map = response.as(Map.class);
assert map.size() > 0 : "No rejected data retrieved";
List<Map<String, Object>> rejected = (List<Map<String, Object>>) map.get("rejected");
assert rejected.size() == 1 : "Got unexpected count of rejected values";
MDataPoint point = new MDataPoint(rejected.get(0));
assert point.equals(dataPoint) : "Got unexpected rejected datapoint";
}