From ea82f58b351ccbe166fc8c86ba8243e16ed89f11 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sun, 23 Oct 2016 06:38:46 -0700 Subject: [PATCH] Avoid improper equality comparisons Found via error-prone. --- .../arm/features/VirtualMachineApiLiveTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VirtualMachineApiLiveTest.java b/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VirtualMachineApiLiveTest.java index 35ccd89aa7..a11ff711db 100644 --- a/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VirtualMachineApiLiveTest.java +++ b/providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VirtualMachineApiLiveTest.java @@ -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() { @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")