diff options
3 files changed, 5 insertions, 9 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/YamlTemplateParsingHandler.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/YamlTemplateParsingHandler.java index 01b62595b8..25d5c1f43e 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/YamlTemplateParsingHandler.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/YamlTemplateParsingHandler.java @@ -451,10 +451,7 @@ public class YamlTemplateParsingHandler { if (MapUtils.isEmpty(operationToscaMap) || !operationToscaMap.containsKey(IMPLEMENTATION.getElementName())) { return Optional.empty(); } - final Map<String, Object> implementationToscaMap = (Map<String, Object>) operationToscaMap.get(IMPLEMENTATION.getElementName()); - return Optional.ofNullable( - implementationToscaMap.computeIfPresent("toscaPresentation", (key, value) -> ((Map<String, Object>) value).get(NAME.getName())) - ); + return Optional.ofNullable(operationToscaMap.get(IMPLEMENTATION.getElementName())); } private List<PropertyAssignmentUi> getOperationsInputs(final Map<String, Object> operationToscaMap) { diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/utils/ModelConverter.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/utils/ModelConverter.java index cfc58671e4..a246a1a406 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/utils/ModelConverter.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/utils/ModelConverter.java @@ -429,7 +429,7 @@ public class ModelConverter { final OperationDataDefinition operationDataDefinition = operationEntry.getValue(); final ArtifactDataDefinition artifactDataDefinition = operationDataDefinition.getImplementation(); if (artifactDataDefinition != null) { - operationUi.setImplementation(artifactDataDefinition); + operationUi.setImplementation(artifactDataDefinition.getArtifactName()); } final ListDataDefinition<OperationInputDefinition> inputs = operationDataDefinition.getInputs(); if (inputs != null && !inputs.isEmpty()) { @@ -517,7 +517,8 @@ public class ModelConverter { final OperationDataDefinition operationDataDefinition = new OperationDataDefinition(); operationDataDefinition.setName(operation.getOperationType()); operationDataDefinition.setUniqueId(UUID.randomUUID().toString()); - final ArtifactDataDefinition artifactDataDefinition = (ArtifactDataDefinition) operation.getImplementation(); + final ArtifactDataDefinition artifactDataDefinition = new ArtifactDataDefinition(); + artifactDataDefinition.setArtifactName((String) operation.getImplementation()); operationDataDefinition.setImplementation(artifactDataDefinition); if (CollectionUtils.isNotEmpty(operation.getInputs())) { final ListDataDefinition<OperationInputDefinition> inputs = new ListDataDefinition<>(); diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/utils/ModelConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/utils/ModelConverterTest.java index 871a43016f..7ce77c2cb4 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/utils/ModelConverterTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/utils/ModelConverterTest.java @@ -303,9 +303,7 @@ public class ModelConverterTest { OperationUi operationUi = new OperationUi(); operationUi.setInterfaceType("tosca.interfaces.relationship.Configure"); operationUi.setOperationType("add_source"); - final ArtifactDataDefinition artifactDataDefinition = new ArtifactDataDefinition(); - artifactDataDefinition.setArtifactName("impl"); - operationUi.setImplementation(artifactDataDefinition); + operationUi.setImplementation("impl"); PropertyAssignmentUi propertyAssignmentUi = new PropertyAssignmentUi(); propertyAssignmentUi.setName("strInput1"); propertyAssignmentUi.setType(ToscaType.STRING.getType()); |