Code review comment: This is practically the same, we can revert this.

Code before review:
public void canUpdateJobState() throws Exception {
String jobId = getStringIdWithUserNamePrefix("-Job-CanUpdateState");
PoolInformation poolInfo = new PoolInformation();
poolInfo.withPoolId(poolId);
batchClient.jobOperations().createJob(jobId, poolInfo);
try {
CloudJob job = batchClient.jobOperations().getJob(jobId);
Assert.assertEquals(JobState.ACTIVE, job.state());
JobUpdateParameter updateParam = new JobUpdateParameter();
Integer maxTaskRetryCount = 3;
Integer priority = 500;
updateParam.withPoolInfo(poolInfo).withPriority(priority).withConstraints(new JobConstraints().withMaxTaskRetryCount(maxTaskRetryCount));
batchClient.jobOperations().updateJob(jobId, updateParam);
job = batchClient.jobOperations().getJob(jobId);
Assert.assertEquals(priority, job.priority());
Assert.assertEquals(maxTaskRetryCount, job.constraints().maxTaskRetryCount());
batchClient.jobOperations().disableJob(jobId, DisableJobOption.REQUEUE.REQUEUE);
job = batchClient.jobOperations().getJob(jobId);
Assert.assertTrue(JobState.DISABLING == job.state() || JobState.DISABLED == job.state());
Thread.sleep(5 * 1000);
job = batchClient.jobOperations().getJob(jobId);
Assert.assertEquals(JobState.DISABLED, job.state());
Assert.assertEquals(OnAllTasksComplete.NO_ACTION, job.onAllTasksComplete());
batchClient.jobOperations().patchJob(jobId, OnAllTasksComplete.TERMINATE_JOB);
job = batchClient.jobOperations().getJob(jobId);
Assert.assertEquals(OnAllTasksComplete.TERMINATE_JOB, job.onAllTasksComplete());
batchClient.jobOperations().enableJob(jobId);
job = batchClient.jobOperations().getJob(jobId);
Assert.assertEquals(JobState.ACTIVE, job.state());
batchClient.jobOperations().terminateJob(jobId, "myreason");
job = batchClient.jobOperations().getJob(jobId);
Assert.assertTrue(JobState.TERMINATING == job.state() || JobState.COMPLETED == job.state());
Thread.sleep(2 * 1000);
job = batchClient.jobOperations().getJob(jobId);
Assert.assertEquals(JobState.COMPLETED, job.state());
}
finally {
try {
batchClient.jobOperations().deleteJob(jobId);
}
catch (Exception e) {
}
}
}

Line under review: Assert.assertTrue(JobState.DISABLING == job.state() || JobState.DISABLED == job.state());

Code after addressing the review:
public void canUpdateJobState() throws Exception {
String jobId = getStringIdWithUserNamePrefix("-Job-CanUpdateState");
PoolInformation poolInfo = new PoolInformation();
poolInfo.withPoolId(poolId);
batchClient.jobOperations().createJob(jobId, poolInfo);
try {
CloudJob job = batchClient.jobOperations().getJob(jobId);
Assert.assertEquals(JobState.ACTIVE, job.state());
JobUpdateParameter updateParam = new JobUpdateParameter();
Integer maxTaskRetryCount = 3;
Integer priority = 500;
updateParam.withPoolInfo(poolInfo).withPriority(priority).withConstraints(new JobConstraints().withMaxTaskRetryCount(maxTaskRetryCount));
batchClient.jobOperations().updateJob(jobId, updateParam);
job = batchClient.jobOperations().getJob(jobId);
Assert.assertEquals(priority, job.priority());
Assert.assertEquals(maxTaskRetryCount, job.constraints().maxTaskRetryCount());
batchClient.jobOperations().disableJob(jobId, DisableJobOption.REQUEUE.REQUEUE);
job = batchClient.jobOperations().getJob(jobId);
Assert.assertTrue(JobState.DISABLING == job.state() || JobState.DISABLED == job.state());
Thread.sleep(5 * 1000);
job = batchClient.jobOperations().getJob(jobId);
Assert.assertEquals(JobState.DISABLED, job.state());
Assert.assertEquals(OnAllTasksComplete.NO_ACTION, job.onAllTasksComplete());
batchClient.jobOperations().patchJob(jobId, OnAllTasksComplete.TERMINATE_JOB);
job = batchClient.jobOperations().getJob(jobId);
Assert.assertEquals(OnAllTasksComplete.TERMINATE_JOB, job.onAllTasksComplete());
batchClient.jobOperations().enableJob(jobId);
job = batchClient.jobOperations().getJob(jobId);
Assert.assertEquals(JobState.ACTIVE, job.state());
batchClient.jobOperations().terminateJob(jobId, "myreason");
job = batchClient.jobOperations().getJob(jobId);
Assert.assertTrue(JobState.TERMINATING == job.state() || JobState.COMPLETED == job.state());
Thread.sleep(2 * 1000);
job = batchClient.jobOperations().getJob(jobId);
Assert.assertEquals(JobState.COMPLETED, job.state());
}
finally {
try {
batchClient.jobOperations().deleteJob(jobId);
}
catch (Exception e) {
}
}
}