Avoid improper equality comparisons

Found via error-prone.
This commit is contained in:
Andrew Gaul 2016-10-23 06:38:46 -07:00
parent d4eed40206
commit ea82f58b35
1 changed files with 4 additions and 3 deletions

View File

@ -16,6 +16,7 @@
*/
package org.jclouds.azurecompute.arm.features;
import static org.assertj.core.api.Assertions.assertThat;
import static org.jclouds.util.Predicates2.retry;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
@ -120,15 +121,15 @@ public class VirtualMachineApiLiveTest extends BaseAzureComputeApiLiveTest {
boolean jobDone = retry(new Predicate<String>() {
@Override
public boolean apply(String name) {
return !api().get(name).properties().provisioningState().equals("Creating");
return !api().get(name).properties().provisioningState().equals(VirtualMachineProperties.ProvisioningState.CREATING);
}
}, 60 * 20 * 1000).apply(vmName);
assertTrue(jobDone, "create operation did not complete in the configured timeout");
VirtualMachineProperties.ProvisioningState status = api().get(vmName).properties().provisioningState();
// Cannot be creating anymore. Should be succeeded or running but not failed.
assertTrue(!status.equals("Creating"));
assertTrue(!status.equals("Failed"));
assertThat(status).isNotEqualTo(VirtualMachineProperties.ProvisioningState.CREATING);
assertThat(status).isNotEqualTo(VirtualMachineProperties.ProvisioningState.FAILED);
}
@Test(dependsOnMethods = "testCreate")