Fix invalid json being set on propertyConstraints 79/134579/3
authorJvD_Ericsson <jeff.van.dam@est.tech>
Wed, 17 May 2023 08:46:33 +0000 (09:46 +0100)
committerVasyl Razinkov <vasyl.razinkov@est.tech>
Fri, 26 May 2023 11:22:02 +0000 (11:22 +0000)
Issue-ID: SDC-4503
Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
Change-Id: Ic506ebb3f1358bb5e3f6b110c2df67bbb24fc901

catalog-model/src/main/java/org/openecomp/sdc/be/model/PropertyDefinition.java

index 5d78d37..6f54d72 100644 (file)
@@ -17,6 +17,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.openecomp.sdc.be.model;
 
 import static org.openecomp.sdc.be.dao.utils.CollectionUtils.safeGetList;
@@ -27,7 +28,9 @@ import com.google.gson.GsonBuilder;
 import java.lang.reflect.Type;
 import java.util.List;
 import java.util.stream.Collectors;
+import lombok.Getter;
 import lombok.NoArgsConstructor;
+import lombok.Setter;
 import org.apache.commons.collections.CollectionUtils;
 import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
 import org.openecomp.sdc.be.model.operations.impl.PropertyOperation;
@@ -36,15 +39,8 @@ import org.openecomp.sdc.be.model.operations.impl.PropertyOperation;
 public class PropertyDefinition extends PropertyDataDefinition implements IOperationParameter, IComplexDefaultValue, ToscaPropertyData {
 
     private List<PropertyConstraint> constraints;
-
-    public String getToscaSubPath() {
-        return toscaSubPath;
-    }
-
-    public void setToscaSubPath(String toscaSubPath) {
-        this.toscaSubPath = toscaSubPath;
-    }
-
+    @Getter
+    @Setter
     private String toscaSubPath;
 
     public PropertyDefinition(PropertyDataDefinition p) {
@@ -62,7 +58,7 @@ public class PropertyDefinition extends PropertyDataDefinition implements IOpera
 
     public List<PropertyConstraint> getConstraints() {
         if (CollectionUtils.isEmpty(constraints)) {
-            constraints = deserializePropertyConstraints(findConstraints());
+            setConstraints(deserializePropertyConstraints(findConstraints()));
         }
         return constraints;
     }