.setJobKey(JOB.newBuilder())
.setUpdateId(UPDATE_ID));
}
private static IJobUpdate makeJobUpdate(IInstanceTaskConfig... configs) {
JobUpdate builder = new JobUpdate()
.setSummary(makeUpdateSummary().newBuilder())
.setInstructions(new JobUpdateInstructions()
.setDesiredState(new InstanceTaskConfig()
.setTask(NEW_CONFIG.newBuilder())
.setInstances(ImmutableSet.of(new Range(0, 2))))
.setSettings(new JobUpdateSettings()
.setUpdateGroupSize(1)
.setRollbackOnFailure(true)
.setMaxWaitToInstanceRunningMs(RUNNING_TIMEOUT.as(Time.MILLISECONDS).intValue())
.setMinWaitInInstanceRunningMs(WATCH_TIMEOUT.as(Time.MILLISECONDS).intValue())
.setUpdateOnlyTheseInstances(ImmutableSet.<Range>of())));
for (IInstanceTaskConfig config : configs) {
builder.getInstructions().addToInitialState(config.newBuilder());
}
return IJobUpdate.build(builder);
}