diff options
author | 2020-06-23 09:15:48 +0100 | |
---|---|---|
committer | 2020-09-04 14:42:04 +0000 | |
commit | 032525a375681fb18cc498d8daed9d73faa21ec3 (patch) | |
tree | 20cf4c17f406b8d30c29ce904fe1f19ea4a2c989 /catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CategoriesImportManagerTest.java | |
parent | c16117e08b97da93da61be841c22f5759cdadd37 (diff) |
Support for Nested/Hierarchical Services
Change-Id: I478cf2e1f9cf96443a3e35bf22ac2c9d72bca8f1
Issue-ID: SDC-3145
Signed-off-by: MichaelMorris <michael.morris@est.tech>
Diffstat (limited to 'catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CategoriesImportManagerTest.java')
-rw-r--r-- | catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CategoriesImportManagerTest.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CategoriesImportManagerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CategoriesImportManagerTest.java index 4be50e81ae..1d96272716 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CategoriesImportManagerTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/CategoriesImportManagerTest.java @@ -43,7 +43,10 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; import java.util.Map; - +import java.util.Optional; +import java.util.stream.Stream; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.when; @@ -86,8 +89,21 @@ public class CategoriesImportManagerTest { public void importCategoriesTest() throws IOException { String ymlContent = getYmlContent(); Either<Map<String, List<CategoryDefinition>>, ResponseFormat> createCapabilityTypes = importManager.createCategories(ymlContent); - assertTrue(createCapabilityTypes.isLeft()); + + assertTrue(createCapabilityTypes.isLeft()); + final Map<String, List<CategoryDefinition>> categories = createCapabilityTypes.left().value(); + final Optional<CategoryDefinition> categoryVoIPCallControl = categories.get("services").stream().filter(category -> category.getName().equals("VoIP Call Control")).findAny(); + final Optional<CategoryDefinition> categoryWithServiceSubstitutionTrue = categories.get("services").stream().filter(category -> category.getName().equals("Category With Service Substitution True")).findAny(); + final Optional<CategoryDefinition> categoryWithServiceSubstitutionFalse = categories.get("services").stream().filter(category -> category.getName().equals("Category With Service Substitution False")).findAny(); + + + assertTrue(categoryVoIPCallControl.isPresent()); + assertFalse(categoryVoIPCallControl.get().isUseServiceSubstitutionForNestedServices()); + assertTrue(categoryWithServiceSubstitutionTrue.isPresent()); + assertTrue(categoryWithServiceSubstitutionTrue.get().isUseServiceSubstitutionForNestedServices()); + assertTrue(categoryWithServiceSubstitutionFalse.isPresent()); + assertFalse(categoryWithServiceSubstitutionFalse.get().isUseServiceSubstitutionForNestedServices()); } private String getYmlContent() throws IOException { |