}
@Test
public void putInvalidCallTimes() throws Exception {
List<CallTimeValueRest> list = new ArrayList<CallTimeValueRest>();
CallTimeValueRest c = CallTimeValueRest.defaultCallTimeValue("test");
list.add(c);
c.setCallDestination(null); // set invalid
given()
.header(acceptJson)
.contentType(ContentType.JSON)
.pathParam("id", callTimeScheduleId)
.body(list)
.expect()
.statusCode(406)
.log().ifError()
.when()
.put("/metric/data/{id}/callTime");
c.setCallDestination("test"); // set back to valid
c.setDuration(-1L);
given()
.header(acceptJson)
.contentType(ContentType.JSON)
.pathParam("id", callTimeScheduleId)
.body(list)
.expect()
.statusCode(406)
.log().ifError()
.when()
.put("/metric/data/{id}/callTime");
c.setDuration(1); // set back to valid
c.setBeginTime(1); // set invalid
given()
.header(acceptJson)
.contentType(ContentType.JSON)
.pathParam("id", callTimeScheduleId)