aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be
diff options
context:
space:
mode:
authorMichaelMorris <michael.morris@est.tech>2022-05-26 13:53:17 +0100
committerVasyl Razinkov <vasyl.razinkov@est.tech>2022-05-27 15:37:54 +0000
commitc64297165be8ea0a07ba762dfcdb156e3f08e956 (patch)
tree0d252d10d8248f3702ce7e5e638f1ade03e00a42 /catalog-be
parent83815a0e0fbfefd5ac9922f7b58d584e16339a4b (diff)
Fix operation definition extended format handling
Signed-off-by: MichaelMorris <michael.morris@est.tech> Issue-ID: SDC-4024 Change-Id: I95d0b8274c7461120cc04456b5c93a96e9e86329
Diffstat (limited to 'catalog-be')
-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: