aboutsummaryrefslogtreecommitdiffstats
path: root/common-be/src/main/java/org
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2022-07-25 10:41:31 +0100
committerMichael Morris <michael.morris@est.tech>2022-07-29 20:09:49 +0000
commit7be04e3e3bdc899c52ffea1f6e11731771903f93 (patch)
treef18c4579d22587a8efd904b62d8d1878b2de8a2b /common-be/src/main/java/org
parent3f9669fdae5f7c6cb1bfe34742df35dfe3a14aa7 (diff)
Centralize TOSCA function validation
The validation happening in the component instance properties, should also be applied for the Group instance properties and Policy instance properties. Fixes some other problems related to the TOSCA function. Change-Id: I4b69da57a8444b78c72561f49146d32c6911482e Issue-ID: SDC-4114 Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'common-be/src/main/java/org')
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
index f88514ac49..adfef9c426 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
@@ -173,11 +173,8 @@ public class PropertyDataDefinition extends ToscaDataDefinition {
}
public ToscaGetFunctionType getToscaGetFunctionType() {
- if (isToscaGetFunction()) {
- if (toscaFunction != null) {
- return ((ToscaGetFunctionDataDefinition) toscaFunction).getFunctionType();
- }
- return toscaGetFunctionType;
+ if (isToscaGetFunction() && toscaFunction != null) {
+ return ((ToscaGetFunctionDataDefinition) toscaFunction).getFunctionType();
}
return null;
@@ -337,10 +334,10 @@ public class PropertyDataDefinition extends ToscaDataDefinition {
@JsonIgnoreProperties
public boolean isToscaGetFunction() {
- return this.toscaGetFunctionType != null || (this.toscaFunction != null
+ return this.toscaFunction != null
&& (this.toscaFunction.getType() == ToscaFunctionType.GET_ATTRIBUTE
- || this.toscaFunction.getType() == ToscaFunctionType.GET_INPUT
- || this.toscaFunction.getType() == ToscaFunctionType.GET_PROPERTY));
+ || this.toscaFunction.getType() == ToscaFunctionType.GET_INPUT
+ || this.toscaFunction.getType() == ToscaFunctionType.GET_PROPERTY);
}
@JsonIgnoreProperties