@Test
public void testGetResourcesWithPredicate() throws Exception {
ClusterDefinition clusterDefinition = new ClusterDefinition(new TestGSInstallerStateProvider());
GSInstallerResourceProvider provider = new GSInstallerHostProvider(clusterDefinition);
Predicate predicate = new PredicateBuilder().property(GSInstallerHostProvider.HOST_NAME_PROPERTY_ID).equals("ip-10-190-97-104.ec2.internal").toPredicate();
Set<Resource> resources = provider.getResources(PropertyHelper.getReadRequest(), predicate);
Assert.assertEquals(1, resources.size());
predicate = new PredicateBuilder().property(GSInstallerHostProvider.HOST_NAME_PROPERTY_ID).equals("ip-10-190-97-104.ec2.internal").or().
property(GSInstallerHostProvider.HOST_NAME_PROPERTY_ID).equals("ip-10-8-113-183.ec2.internal").toPredicate();
resources = provider.getResources(PropertyHelper.getReadRequest(), predicate);
Assert.assertEquals(2, resources.size());
predicate = new PredicateBuilder().property(GSInstallerHostProvider.HOST_NAME_PROPERTY_ID).equals("unknownHost").toPredicate();
resources = provider.getResources(PropertyHelper.getReadRequest(), predicate);
Assert.assertTrue(resources.isEmpty());
}