|
@@ -27,7 +27,7 @@ import org.junit.Test;
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
|
|
+ * Equals predicate tests.
|
|
*/
|
|
*/
|
|
public class EqualsPredicateTest {
|
|
public class EqualsPredicateTest {
|
|
|
|
|
|
@@ -50,6 +50,19 @@ public class EqualsPredicateTest {
|
|
Assert.assertFalse(predicate.evaluate(resource));
|
|
Assert.assertFalse(predicate.evaluate(resource));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
+ public void testApplyNullValue() {
|
|
|
|
+ Resource resource = new ResourceImpl(Resource.Type.HostComponent);
|
|
|
|
+ String propertyId = PropertyHelper.getPropertyId("category1", "foo");
|
|
|
|
+ Predicate predicate = new EqualsPredicate<String>(propertyId, null);
|
|
|
|
+
|
|
|
|
+ resource.setProperty(propertyId, "monkey");
|
|
|
|
+ Assert.assertFalse(predicate.evaluate(resource));
|
|
|
|
+
|
|
|
|
+ resource.setProperty(propertyId, null);
|
|
|
|
+ Assert.assertTrue(predicate.evaluate(resource));
|
|
|
|
+ }
|
|
|
|
+
|
|
@Test
|
|
@Test
|
|
public void testGetProperties() {
|
|
public void testGetProperties() {
|
|
String propertyId = PropertyHelper.getPropertyId("category1", "foo");
|
|
String propertyId = PropertyHelper.getPropertyId("category1", "foo");
|