aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichaelMorris <michael.morris@est.tech>2021-04-09 12:26:22 +0100
committerChristophe Closset <christophe.closset@intl.att.com>2021-04-12 08:38:40 +0000
commitae8fe8b1deb89995ff844f7019c3e570e9c8c948 (patch)
tree671664d5d462e428ee012dedcd5da7134e280c9c
parent45e2f0ae4c14ee24e696717c9d150a2ff0bdc872 (diff)
Fix default imports being amended
Signed-off-by: MichaelMorris <michael.morris@est.tech> Issue-ID: SDC-3552 Change-Id: Ibb5cfbba2075820c798eae1726953871140ddce5
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java4
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/be/config/Configuration.java4
2 files changed, 6 insertions, 2 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
index 10d2130792..d211a8bb76 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
@@ -200,7 +200,7 @@ public class ToscaExportHandler {
}
public Either<ToscaRepresentation, ToscaError> exportComponentInterface(final Component component, final boolean isAssociatedComponent) {
- final List<Map<String, Map<String, String>>> imports = getDefaultToscaImportConfig();
+ final List<Map<String, Map<String, String>>> imports = new ArrayList<>(getDefaultToscaImportConfig());
if (CollectionUtils.isEmpty(imports)) {
log.debug(FAILED_TO_GET_DEFAULT_IMPORTS_CONFIGURATION);
return Either.right(ToscaError.GENERAL_ERROR);
@@ -220,7 +220,7 @@ public class ToscaExportHandler {
toscaVersion = ((Resource) component).getToscaVersion();
}
ToscaTemplate toscaTemplate = new ToscaTemplate(toscaVersion != null ? toscaVersion : TOSCA_VERSION);
- toscaTemplate.setImports(new ArrayList<>(imports));
+ toscaTemplate.setImports(imports);
final Map<String, ToscaNodeType> nodeTypes = new HashMap<>();
final Either<ToscaTemplate, ToscaError> toscaTemplateRes = convertInterfaceNodeType(new HashMap<>(), component, toscaTemplate, nodeTypes,
isAssociatedComponent);
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/be/config/Configuration.java b/common-app-api/src/main/java/org/openecomp/sdc/be/config/Configuration.java
index e30f5f32fc..04ba19ef9a 100644
--- a/common-app-api/src/main/java/org/openecomp/sdc/be/config/Configuration.java
+++ b/common-app-api/src/main/java/org/openecomp/sdc/be/config/Configuration.java
@@ -165,6 +165,10 @@ public class Configuration extends BasicConfiguration {
public Map<String, Set<String>> getExcludedGroupTypesMapping() {
return safeGetCapsInsensitiveMap(excludedGroupTypesMapping);
}
+
+ public List<Map<String, Map<String, String>>> getDefaultImports(){
+ return Collections.unmodifiableList(defaultImports);
+ }
@Override
public String toString() {