assertOkResponse(thrift.addInstances(config, LOCK.newBuilder(), SESSION));
}
@Test
public void testAddInstancesWithNullLock() throws Exception {
AddInstancesConfig config = createInstanceConfig(defaultTask(true));
expectAuth(ROLE, true);
expect(cronJobManager.hasJob(JOB_KEY)).andReturn(false);
lockManager.validateIfLocked(LOCK_KEY, Optional.<ILock>absent());
scheduler.addInstances(
eq(JOB_KEY),
eq(ImmutableSet.copyOf(config.getInstanceIds())),
anyObject(ITaskConfig.class));
control.replay();
assertOkResponse(thrift.addInstances(config, null, SESSION));
}