assertResponse(INVALID_REQUEST, thrift.startJobUpdate(request, SESSION));
}
@Test
public void testStartUpdateFailsQuotaCheck() throws Exception {
JobUpdateRequest request = buildJobUpdateRequest(populatedTask());
expectAuth(ROLE, true);
expect(cronJobManager.hasJob(JOB_KEY)).andReturn(false);
expect(uuidGenerator.createNew()).andReturn(UU_ID);
IScheduledTask oldTask = buildScheduledTask(0, 5);
storageUtil.expectTaskFetch(Query.unscoped().byJob(JOB_KEY).active(), oldTask);
expect(taskIdGenerator.generate(ITaskConfig.build(request.getTaskConfig()), 6))
.andReturn(TASK_ID);
ITaskConfig config = ITaskConfig.build(request.getTaskConfig());
IJobUpdate update = buildJobUpdate(6, config, ImmutableMap.of(
oldTask.getAssignedTask().getTask(), ImmutableSet.of(new Range(0, 0))));
expect(quotaManager.checkJobUpdate(update)).andReturn(NOT_ENOUGH_QUOTA);