diff options
Diffstat (limited to 'catalog-model/src')
3 files changed, 3 insertions, 3 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/AbstractPropertyConstraint.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/AbstractPropertyConstraint.java index 8e09648804..59510c4c89 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/AbstractPropertyConstraint.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/AbstractPropertyConstraint.java @@ -36,7 +36,7 @@ public abstract class AbstractPropertyConstraint implements PropertyConstraint { @Override public void validate(PropertyDefinition property) throws ConstraintViolationException { - validate(ToscaType.isValidType(property.getType()), property.getValue()); + validate(ToscaType.isValidType(property.getType()), property.getValue() != null ? property.getValue() : property.getDefaultValue()); } protected void validate(ToscaType toscaType, String propertyTextValue) throws ConstraintViolationException { diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/ConstraintUtil.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/ConstraintUtil.java index 83b3ab82d8..c356970d60 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/ConstraintUtil.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/ConstraintUtil.java @@ -81,7 +81,7 @@ public final class ConstraintUtil { * @throws ConstraintValueDoNotMatchPropertyTypeException if the property type cannot be compared */ public static void checkComparableType(final ToscaType propertyType) throws ConstraintValueDoNotMatchPropertyTypeException { - if (!isComparableType(propertyType)) { + if (!isComparableType(propertyType) && !ToscaType.BOOLEAN.equals(propertyType)) { throw new ConstraintValueDoNotMatchPropertyTypeException("Constraint is invalid for property type <" + propertyType.getType() + ">"); } } diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/EqualConstraint.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/EqualConstraint.java index a565580d38..5e9e598475 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/EqualConstraint.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/EqualConstraint.java @@ -54,7 +54,7 @@ public class EqualConstraint extends AbstractComparablePropertyConstraint { public void initialize(ToscaType propertyType) throws ConstraintValueDoNotMatchPropertyTypeException { if (propertyType.isValidValue(String.valueOf(equal))) { typed = propertyType.convert(String.valueOf(equal)); - if (ConstraintUtil.isComparableType(propertyType)) { + if (ConstraintUtil.isComparableType(propertyType) || ToscaType.BOOLEAN.equals(propertyType)) { initialize(String.valueOf(equal), propertyType); } } else { |