aboutsummaryrefslogtreecommitdiffstats
path: root/models-tosca
diff options
context:
space:
mode:
Diffstat (limited to 'models-tosca')
-rw-r--r--models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProvider.java10
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTypeTest.java2
2 files changed, 7 insertions, 5 deletions
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProvider.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProvider.java
index 0fae304c3..cd73ae599 100644
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProvider.java
+++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProvider.java
@@ -368,15 +368,17 @@ public class AuthorativeToscaProvider {
/**
* Return the contents of a list of concepts as a list of maps of concepts.
*
- * @param comceptList the concept list
- * @return the concept map
+ * @param conceptList the concept list
+ * @return the list of concept map
*/
private <T extends ToscaEntity> List<Map<String, T>> asConceptMap(List<T> conceptList) {
- Map<String, T> conceptMap = new LinkedHashMap<>();
+ List<Map<String, T>> toscaEntityMapList = new ArrayList<>();
for (T concept : conceptList) {
+ Map<String, T> conceptMap = new LinkedHashMap<>();
conceptMap.put(concept.getName(), concept);
+ toscaEntityMapList.add(conceptMap);
}
- return Collections.singletonList(conceptMap);
+ return toscaEntityMapList;
}
}
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTypeTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTypeTest.java
index ded2cdee2..4ae56149a 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTypeTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTypeTest.java
@@ -207,7 +207,7 @@ public class AuthorativeToscaProviderPolicyTypeTest {
ToscaServiceTemplate gotServiceTemplate =
new AuthorativeToscaProvider().getFilteredPolicyTypes(pfDao, ToscaPolicyTypeFilter.builder().build());
- ToscaPolicyType gotPolicyType = gotServiceTemplate.getPolicyTypes().get(0).get(policyTypeKey.getName());
+ ToscaPolicyType gotPolicyType = gotServiceTemplate.getPolicyTypes().get(1).get(policyTypeKey.getName());
assertEquals(true, beforePolicyType.getName().equals(gotPolicyType.getName()));
assertEquals(0, ObjectUtils.compare(beforePolicyType.getDescription(), gotPolicyType.getDescription()));