}
private void saveAndAssertJobUpdate(final String updateId, final Optional<String> lockToken)
throws Exception {
final IJobUpdate update = IJobUpdate.build(new JobUpdate()
.setSummary(new JobUpdateSummary()
.setUpdateId(updateId)
.setJobKey(JOB_KEY.newBuilder())
.setUser("user"))
.setInstructions(new JobUpdateInstructions()
.setDesiredState(new InstanceTaskConfig()
.setTask(new TaskConfig())
.setInstances(ImmutableSet.of(new Range(0, 3))))
.setInitialState(ImmutableSet.of(new InstanceTaskConfig()
.setTask(new TaskConfig())
.setInstances(ImmutableSet.of(new Range(0, 3)))))
.setSettings(new JobUpdateSettings())));
new MutationFixture() {
@Override
protected void setupExpectations() throws Exception {
storageUtil.expectWriteOperation();
storageUtil.jobUpdateStore.saveJobUpdate(update, lockToken);
streamMatcher.expectTransaction(
Op.saveJobUpdate(new SaveJobUpdate(update.newBuilder(), lockToken.orNull())))
.andReturn(position);
}
@Override
protected void performMutations(MutableStoreProvider storeProvider) {