summaryrefslogtreecommitdiffstats
path: root/catalog-be/src
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogic.java10
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java1
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/ElementOperationMock.java5
3 files changed, 16 insertions, 0 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogic.java
index caea46aae8..176cdedc35 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ElementBusinessLogic.java
@@ -1303,4 +1303,14 @@ public class ElementBusinessLogic extends BaseBusinessLogic {
public boolean isBaseTypeRequired(final String categoryName) {
return elementOperation.isBaseTypeRequired(categoryName);
}
+
+ /**
+ * Fetches default baseType from the template.
+ *
+ * @param categoryName the category name
+ * @return defaultBaseType mapped to the corresponding category name.
+ */
+ public String getDefaultBaseType(final String categoryName) {
+ return elementOperation.getDefaultBaseType(categoryName);
+ }
}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java
index e949b13d1c..5e4085cf33 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ElementServlet.java
@@ -217,6 +217,7 @@ public class ElementServlet extends BeGenericServlet {
final Map<String, Object> baseTypesMap = new HashMap<>();
baseTypesMap.put("baseTypes", either.left().value());
baseTypesMap.put("required", elementBL.isBaseTypeRequired(categoryName));
+ baseTypesMap.put("defaultBaseType",elementBL.getDefaultBaseType(categoryName));
return buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), baseTypesMap);
}
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/ElementOperationMock.java b/catalog-be/src/test/java/org/openecomp/sdc/ElementOperationMock.java
index 1416707835..d9e6e8ec0d 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/ElementOperationMock.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/ElementOperationMock.java
@@ -292,4 +292,9 @@ public class ElementOperationMock implements IElementOperation {
return true;
}
+ @Override
+ public String getDefaultBaseType(String categoryName) {
+ return "";
+ }
+
}