}
@Test(dependsOnMethods = "resolveImageAndInstanceType")
public void testAllocateIpAddress() throws Exception {
Offering offering = Iterables.find(connection.listAddressOfferings(), new Predicate<Offering>() {
@Override
public boolean apply(Offering arg0) {
return arg0.getLocation().equals(location.getId());
}
});
try {
ip = connection.allocateAddressInLocation(location.getId(), offering.getId());
System.out.println(ip);
assertEquals(ip.getIP(), null);
// wait up to 30 seconds for this to become "free"
new RetryablePredicate<Address>(new AddressFree(connection), 30, 2, TimeUnit.SECONDS).apply(ip);
refreshIpAndReturnAllAddresses();