Use ImagePredicates.idEquals, instead of writing idEquals from scratch

This commit is contained in:
Richard Downer 2012-01-09 19:48:49 +02:00
parent 3f6997361d
commit 48c2d21149
1 changed files with 2 additions and 6 deletions

View File

@ -39,6 +39,7 @@ import org.jclouds.compute.ComputeServiceContextFactory;
import org.jclouds.compute.RunNodesException; import org.jclouds.compute.RunNodesException;
import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.compute.domain.NodeMetadata;
import org.jclouds.compute.domain.Template; import org.jclouds.compute.domain.Template;
import org.jclouds.compute.predicates.ImagePredicates;
import org.jclouds.ec2.EC2AsyncClient; import org.jclouds.ec2.EC2AsyncClient;
import org.jclouds.ec2.EC2Client; import org.jclouds.ec2.EC2Client;
import org.jclouds.ec2.domain.BlockDevice; import org.jclouds.ec2.domain.BlockDevice;
@ -188,12 +189,7 @@ public class AMIClientLiveTest extends BaseVersionedServiceLiveTest {
// Detailed check: filter for the AMI ID // Detailed check: filter for the AMI ID
Iterable<? extends org.jclouds.compute.domain.Image> filtered = Iterables.filter(after, Iterable<? extends org.jclouds.compute.domain.Image> filtered = Iterables.filter(after,
new Predicate<org.jclouds.compute.domain.Image>() { ImagePredicates.idEquals(imageRegistered.getRegion() + "/" + imageRegisteredId));
@Override
public boolean apply(@Nullable org.jclouds.compute.domain.Image i) {
return i != null && i.getId().equals(imageRegistered.getRegion() + "/" + imageRegisteredId);
}
});
assertEquals(Iterables.size(filtered), 1); assertEquals(Iterables.size(filtered), 1);
} }