aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be
diff options
context:
space:
mode:
authorMichaelMorris <michael.morris@est.tech>2022-11-28 15:23:52 +0000
committerMichael Morris <michael.morris@est.tech>2022-11-28 17:30:34 +0000
commit15f3f0bb8e0cec965a9714e3681fbdee4b19b3c4 (patch)
tree5e931f1b399ac224f7f04501b739e86329c0fed9 /catalog-be
parentf55024beeebf3ce869d9312c985795767665a638 (diff)
Fix empty interfaces and operations
Signed-off-by: MichaelMorris <michael.morris@est.tech> Issue-ID: SDC-4281 Change-Id: I53bd54fea0aca3540dafebc9360fd305dd56128d
Diffstat (limited to 'catalog-be')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java
index 54e61da41a..3650422afc 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java
@@ -273,12 +273,16 @@ public class InterfacesOperationsConverter {
final Map<String, OperationDataDefinition> operations = interfaceDefinition.getOperations();
final Map<String, Object> toscaOperationMap = new HashMap<>();
for (final Entry<String, OperationDataDefinition> operationEntry : operations.entrySet()) {
- final ToscaLifecycleOperationDefinition toscaLifecycleOperationDefinition = new ToscaLifecycleOperationDefinition();
- handleInterfaceOperationImplementation(component, componentInstance, isAssociatedComponent, operationEntry.getValue(),
- toscaLifecycleOperationDefinition, dataTypes);
- toscaLifecycleOperationDefinition.setDescription(operationEntry.getValue().getDescription());
- fillToscaOperationInputs(operationEntry.getValue(), dataTypes, toscaLifecycleOperationDefinition);
- toscaOperationMap.put(operationEntry.getValue().getName(), toscaLifecycleOperationDefinition);
+ if (operationHasAnImplementation(operationEntry.getValue())) {
+ final ToscaLifecycleOperationDefinition toscaLifecycleOperationDefinition = new ToscaLifecycleOperationDefinition();
+ handleInterfaceOperationImplementation(component, componentInstance, isAssociatedComponent, operationEntry.getValue(),
+ toscaLifecycleOperationDefinition, dataTypes);
+ if (StringUtils.isNotEmpty(operationEntry.getValue().getDescription())) {
+ toscaLifecycleOperationDefinition.setDescription(operationEntry.getValue().getDescription());
+ }
+ fillToscaOperationInputs(operationEntry.getValue(), dataTypes, toscaLifecycleOperationDefinition);
+ toscaOperationMap.put(operationEntry.getValue().getName(), toscaLifecycleOperationDefinition);
+ }
}
toscaInterfaceDefinition.setOperations(toscaOperationMap);
final Map<String, Object> interfaceInputMap = createInterfaceInputMap(interfaceDefinition, dataTypes);
@@ -294,6 +298,10 @@ public class InterfacesOperationsConverter {
interfaceDefinitionAsMap.putAll(operationsMap);
toscaInterfaceDefinitions.put(getLastPartOfName(interfaceType), interfaceDefinitionAsMap);
}
+
+ private boolean operationHasAnImplementation(OperationDataDefinition operation) {
+ return operation.getImplementation() != null && StringUtils.isNotEmpty(operation.getImplementation().getArtifactName()) && !operation.getImplementation().getArtifactName().equals("''");
+ }
private void handleInterfaceOperationImplementation(final Component component, final ComponentInstance componentInstance,
final boolean isAssociatedComponent,