From 737a8e03b057584fce110ddb6f560dd60ce9bdf5 Mon Sep 17 00:00:00 2001 From: KrupaNagabhushan Date: Mon, 15 Aug 2022 15:23:47 +0100 Subject: Fix wrongly generated tosca implementation Issue-ID: SDC-4130 Signed-off-by: KrupaNagabhushan Change-Id: I23ea03fded3d82006b98b0d42be928ac38513276 --- .../openecomp/sdc/be/model/jsonjanusgraph/utils/ModelConverter.java | 5 +++-- .../sdc/be/model/jsonjanusgraph/utils/ModelConverterTest.java | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'catalog-model/src') 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 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 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()); -- cgit 1.2.3-korg