@Test
public void testOpsScheduleMissingRequiredParam() throws Exception {
int platformId = findIdOfARealPlatform();
Operation draft = getADraftOperation(platformId, discoveryDefinitionId);
int draftId = draft.getId();
// explicitly remove the param from the draft for
// the test
Map<String, Object> params = draft.getParams();
if (params.containsKey("detailedDiscovery")) {
params.remove("detailedDiscovery");
}
// Update to put the new version in the server
// We don't want to submit, so the server does not
// validate and we should get a 200 back
draft.setReadyToSubmit(false);
given()
.contentType(ContentType.JSON)
.pathParam("id",draftId)
.body(draft)
.expect()
.statusCode(200)
.log().ifError()
.when()
.put("/operation/{id}");
// update to schedule, lacking the required param
draft.setReadyToSubmit(true);
given()
.contentType(ContentType.JSON)
.pathParam("id",draftId)
.body(draft)