aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceDefinitionHandler.java19
-rw-r--r--catalog-be/src/test/resources/interfaceDefinition/interfaceDefinition-legacy.yaml8
2 files changed, 19 insertions, 8 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceDefinitionHandler.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceDefinitionHandler.java
index b60e31a513..029c32930e 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceDefinitionHandler.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceDefinitionHandler.java
@@ -231,7 +231,8 @@ public class InterfaceDefinitionHandler {
Map<String, Object> implDetails = (Map) ((Map)operationDefinitionMap.get(IMPLEMENTATION.getElementName())).get("primary");
if (implDetails.get("file") != null) {
- artifactDataDefinition.setArtifactName(implDetails.get("file").toString());
+ final String file = implDetails.get("file").toString();
+ artifactDataDefinition.setArtifactName(generateArtifactName(file));
}
if (implDetails.get("type") != null) {
artifactDataDefinition.setArtifactType(implDetails.get("type").toString());
@@ -256,16 +257,20 @@ public class InterfaceDefinitionHandler {
}
}
if (operationDefinitionMap.get(IMPLEMENTATION.getElementName()) instanceof String) {
- final String artifactName = (String) operationDefinitionMap.get(IMPLEMENTATION.getElementName());
- if (OperationArtifactUtil.artifactNameIsALiteralValue(artifactName)) {
- artifactDataDefinition.setArtifactName(artifactName);
- } else {
- artifactDataDefinition.setArtifactName(QUOTE + artifactName + QUOTE);
- }
+ final String implementation = (String) operationDefinitionMap.get(IMPLEMENTATION.getElementName());
+ artifactDataDefinition.setArtifactName(generateArtifactName(implementation));
}
return Optional.of(artifactDataDefinition);
}
+ private String generateArtifactName(final String name) {
+ if (OperationArtifactUtil.artifactNameIsALiteralValue(name)) {
+ return name;
+ } else {
+ return QUOTE + name + QUOTE;
+ }
+ }
+
private ToscaPropertyType getTypeFromObject(final Object value) {
if (value instanceof String) {
return ToscaPropertyType.STRING;
diff --git a/catalog-be/src/test/resources/interfaceDefinition/interfaceDefinition-legacy.yaml b/catalog-be/src/test/resources/interfaceDefinition/interfaceDefinition-legacy.yaml
index 2c4c1ec967..49de865f63 100644
--- a/catalog-be/src/test/resources/interfaceDefinition/interfaceDefinition-legacy.yaml
+++ b/catalog-be/src/test/resources/interfaceDefinition/interfaceDefinition-legacy.yaml
@@ -9,7 +9,13 @@ inputs:
type: org.openecomp.resource.datatypes.Action
type: tosca.interfaces.node.lifecycle.Standard
create:
- implementation: "camunda/serviceSelect"
+ implementation:
+ primary:
+ type: tosca.artifacts.asd.deploymentItem
+ file: camunda/serviceSelect
+ artifact_version: '1'
+ properties:
+ artifact_type: typeA
start:
implementation: "camunda/executeAction"
inputs: