Thanks!

Out of curiosity, how did you catch these using error prone? AFAIK we
have it already configured [1] but I've never seen such errors
(although I have to say I have no idea how error-prone works, so I may
have missed them).


[1] https://github.com/jclouds/jclouds/blob/master/project/pom.xml#L741-L767

On 23 October 2016 at 15:39,  <g...@apache.org> wrote:
> Repository: jclouds-labs
> Updated Branches:
>   refs/heads/master e1670f5c9 -> 1063deafa
>
>
> Avoid improper equality comparisons
>
> Found via error-prone.
>
>
> Project: http://git-wip-us.apache.org/repos/asf/jclouds-labs/repo
> Commit: http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/1063deaf
> Tree: http://git-wip-us.apache.org/repos/asf/jclouds-labs/tree/1063deaf
> Diff: http://git-wip-us.apache.org/repos/asf/jclouds-labs/diff/1063deaf
>
> Branch: refs/heads/master
> Commit: 1063deafa4f118d3be39c495f3f93816e85b0389
> Parents: e1670f5
> Author: Andrew Gaul <g...@apache.org>
> Authored: Sun Oct 23 06:38:46 2016 -0700
> Committer: Andrew Gaul <g...@apache.org>
> Committed: Sun Oct 23 06:38:46 2016 -0700
>
> ----------------------------------------------------------------------
>  .../azurecompute/arm/features/VirtualMachineApiLiveTest.java  | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1063deaf/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VirtualMachineApiLiveTest.java
> ----------------------------------------------------------------------
> diff --git 
> a/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VirtualMachineApiLiveTest.java
>  
> b/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VirtualMachineApiLiveTest.java
> index 35ccd89..a11ff71 100644
> --- 
> a/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VirtualMachineApiLiveTest.java
> +++ 
> b/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<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")
>

Reply via email to