public class NodeFilterValidationTest {
- private static final String UI_CONSTRAINT_STATIC = "Prop1: {equal: 'value'}";
+ private static final String EMPTY_STR = "";
+ private static final String UI_CONSTRAINT_STATIC = "Prop1: {equal: 'value'}";
private static final String INNER_SERVICE = "innerService";
private static final String PROPERTY_NAME = "Prop1";
private static final String VALUE = "value";
Either<Boolean, ResponseFormat> either =
nodeFilterValidator.validateFilter(service, INNER_SERVICE,
Collections.singletonList(UI_CONSTRAINT_STATIC.replace(VALUE, "true")),
- NodeFilterConstraintAction.ADD, NodeFilterConstraintType.PROPERTIES);
+ NodeFilterConstraintAction.ADD, NodeFilterConstraintType.PROPERTIES, EMPTY_STR);
assertTrue(either.isRight());
either =
nodeFilterValidator.validateFilter(service, INNER_SERVICE,
Collections.singletonList(UI_CONSTRAINT_STATIC.replace(VALUE, "true")),
- NodeFilterConstraintAction.ADD, NodeFilterConstraintType.CAPABILITIES);
+ NodeFilterConstraintAction.ADD, NodeFilterConstraintType.CAPABILITIES, EMPTY_STR);
assertTrue(either.isRight());
}
nodeFilterValidator.validateFilter(service, INNER_SERVICE,
Collections.singletonList(UI_CONSTRAINT_STATIC.replace(VALUE, "true")
.replace("equal", "greater_than")),
- NodeFilterConstraintAction.ADD, NodeFilterConstraintType.PROPERTIES);
+ NodeFilterConstraintAction.ADD, NodeFilterConstraintType.PROPERTIES, EMPTY_STR);
Assert.assertFalse(either.isLeft());
}
Either<Boolean, ResponseFormat> either =
nodeFilterValidator.validateFilter(service, INNER_SERVICE,
Collections.singletonList(UI_CONSTRAINT_STATIC.replace(VALUE, "trues")),
- NodeFilterConstraintAction.ADD, NodeFilterConstraintType.PROPERTIES);
+ NodeFilterConstraintAction.ADD, NodeFilterConstraintType.PROPERTIES, EMPTY_STR);
Assert.assertFalse(either.isLeft());
}
nodeFilterValidator.validateFilter(service, INNER_SERVICE,
Collections.singletonList(UI_CONSTRAINT_STATIC.replace(VALUE, "true")
.replace("equal", "greater_than")),
- NodeFilterConstraintAction.ADD, NodeFilterConstraintType.PROPERTIES);
+ NodeFilterConstraintAction.ADD, NodeFilterConstraintType.PROPERTIES, EMPTY_STR);
Assert.assertTrue(either.isLeft());
}
Either<Boolean, ResponseFormat> either =
nodeFilterValidator.validateFilter(service, INNER_SERVICE,
Collections.singletonList(UI_CONSTRAINT_STATIC.replace(VALUE, "1")),
- NodeFilterConstraintAction.ADD, NodeFilterConstraintType.PROPERTIES);
+ NodeFilterConstraintAction.ADD, NodeFilterConstraintType.PROPERTIES, EMPTY_STR);
Assert.assertTrue(either.isLeft());
}
Either<Boolean, ResponseFormat> either =
nodeFilterValidator.validateFilter(service, INNER_SERVICE,
Collections.singletonList(UI_CONSTRAINT_STATIC.replace(VALUE, "1.0")),
- NodeFilterConstraintAction.ADD, NodeFilterConstraintType.PROPERTIES);
+ NodeFilterConstraintAction.ADD, NodeFilterConstraintType.PROPERTIES, EMPTY_STR);
Assert.assertTrue(either.isRight());
}
Either<Boolean, ResponseFormat> either =
nodeFilterValidator.validateFilter(service, INNER_SERVICE,
Collections.singletonList(UI_CONSTRAINT_STATIC.replace(VALUE, "1.0")),
- NodeFilterConstraintAction.ADD, NodeFilterConstraintType.PROPERTIES);
+ NodeFilterConstraintAction.ADD, NodeFilterConstraintType.PROPERTIES, EMPTY_STR);
Assert.assertTrue(either.isLeft());
}
Either<Boolean, ResponseFormat> either =
nodeFilterValidator.validateFilter(service, INNER_SERVICE,
Collections.singletonList(UI_CONSTRAINT_STATIC), NodeFilterConstraintAction.ADD,
- NodeFilterConstraintType.PROPERTIES);
+ NodeFilterConstraintType.PROPERTIES, EMPTY_STR);
Assert.assertTrue(either.isRight());
}
Either<Boolean, ResponseFormat> either =
nodeFilterValidator.validateFilter(service, INNER_SERVICE,
Collections.singletonList(UI_CONSTRAINT_STATIC), NodeFilterConstraintAction.ADD,
- NodeFilterConstraintType.PROPERTIES);
+ NodeFilterConstraintType.PROPERTIES, EMPTY_STR);
Assert.assertTrue(either.isLeft());
}
Either<Boolean, ResponseFormat> either =
nodeFilterValidator.validateFilter(service, COMPONENT1_ID, Collections.singletonList("Prop1:\n"
+ " equal: { get_property :[component2, Prop1]}\n"), NodeFilterConstraintAction.ADD,
- NodeFilterConstraintType.PROPERTIES);
+ NodeFilterConstraintType.PROPERTIES, EMPTY_STR);
Assert.assertTrue(either.isLeft());
}
Either<Boolean, ResponseFormat> either =
nodeFilterValidator.validateFilter(service, COMPONENT1_ID, Collections.singletonList("Prop1:\n"
+ " equal: { get_property : [SELF, Prop1]}\n"), NodeFilterConstraintAction.ADD,
- NodeFilterConstraintType.PROPERTIES);
+ NodeFilterConstraintType.PROPERTIES, EMPTY_STR);
Assert.assertTrue(either.isLeft());
}
Either<Boolean, ResponseFormat> either =
nodeFilterValidator.validateFilter(service, COMPONENT1_ID, Collections.singletonList("Prop1:\n"
+ " equal: { get_property : [component2, Prop1]}\n"), NodeFilterConstraintAction.ADD,
- NodeFilterConstraintType.PROPERTIES);
+ NodeFilterConstraintType.PROPERTIES, EMPTY_STR);
Assert.assertFalse(either.isLeft());
}
Either<Boolean, ResponseFormat> either =
nodeFilterValidator.validateFilter(service, COMPONENT1_ID, Collections.singletonList("Prop1:\n"
+ " equal: { get_property : [parentservice, Prop1]}\n"), NodeFilterConstraintAction.ADD,
- NodeFilterConstraintType.PROPERTIES);
+ NodeFilterConstraintType.PROPERTIES, EMPTY_STR);
Assert.assertFalse(either.isLeft());
}
Either<Boolean, ResponseFormat> either =
nodeFilterValidator.validateFilter(service, COMPONENT1_ID, Collections.singletonList("Prop1:\n"
+ " equal: { get_property : [parentservice, Prop1]}\n"), NodeFilterConstraintAction.ADD,
- NodeFilterConstraintType.PROPERTIES);
+ NodeFilterConstraintType.PROPERTIES, EMPTY_STR);
Assert.assertFalse(either.isLeft());
}
Either<Boolean, ResponseFormat> either =
nodeFilterValidator.validateFilter(service, COMPONENT1_ID, Collections.singletonList("Prop1:\n"
+ " equal: { get_property : [parentservice, Prop1]}\n"), NodeFilterConstraintAction.ADD,
- NodeFilterConstraintType.PROPERTIES);
+ NodeFilterConstraintType.PROPERTIES, EMPTY_STR);
Assert.assertFalse(either.isLeft());
}
Either<Boolean, ResponseFormat> either =
nodeFilterValidator.validateFilter(service, COMPONENT1_ID, Collections.singletonList("Prop1:\n"
+ " equal: { get_property : [parentservice, Prop1]}\n"), NodeFilterConstraintAction.ADD,
- NodeFilterConstraintType.PROPERTIES);
+ NodeFilterConstraintType.PROPERTIES, EMPTY_STR);
Assert.assertFalse(either.isLeft());
}