summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java/org
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/src/main/java/org
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/src/main/java/org')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InterfaceDefinitionHandler.java19
1 files changed, 12 insertions, 7 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;