Merge pull request #1816 from shapeblue/4.9-fix-npe-vmware

CLOUDSTACK-9564: Fix NPE due to intermittent test assertionThe test assertion on a pool object may return a null object, as objects
can be randomly expired/tombstoned. This will fix a NPE sometimes seen due
to recently merge for the fix for CLOUDSTACK-9564.

(we can merge this if Travis passes)

/cc @abhinandanprateek @murali-reddy

* pr/1816:
  CLOUDSTACK-9564: Fix NPE due to intermittent test assertion

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2016-12-06 11:55:53 +05:30
commit 8d506a624b
No known key found for this signature in database
GPG Key ID: 484248210EE3D884

View File

@ -114,7 +114,5 @@ public class VmwareContextPoolTest {
totalRegistrations += client.count();
}
Mockito.verify(vmwareContextPool, Mockito.atLeast(totalRegistrations)).registerContext(Mockito.any(VmwareContext.class));
Assert.assertEquals(vmwareContextPool.composePoolKey(vmwareAddress, vmwareUsername),
vmwareContextPool.getContext(vmwareAddress, vmwareUsername).getPoolKey());
}
}