int definitionId = createEmptyAlertDefinition(false);
try {
// Now add a 1st condition
AlertCondition alertCondition = new AlertCondition("AVAILABILITY", "AVAIL_GOES_UP");
addConditionToDefinition(definitionId, alertCondition);
// Retrieve the definition with the added condition
AlertDefinition updatedDefinition =
given()
.pathParam("id",definitionId)
.queryParam("full",true)
.expect()
.statusCode(200)
.log().everything()
.when()
.get("/alert/definition/{id}")
.as(AlertDefinition.class);
int size = updatedDefinition.getConditions().size();
assert size ==1 : "Did not find 1 condition, but " + size;
// Now add a 2nd condition
AlertCondition secondCondition = new AlertCondition("AVAILABILITY", "AVAIL_GOES_DOWN");
addConditionToDefinition(definitionId, secondCondition);
// Retrieve the definition with the added condition
updatedDefinition =
given()