diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core')
-rw-r--r-- | openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/impl/ToscaConverterImplTest.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/impl/ToscaConverterImplTest.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/impl/ToscaConverterImplTest.java index 3e4e62a0d1..bcfc3d8eda 100644 --- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/impl/ToscaConverterImplTest.java +++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/impl/ToscaConverterImplTest.java @@ -40,6 +40,7 @@ import java.nio.file.NotDirectoryException; import java.util.*; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import static org.openecomp.core.converter.datatypes.Constants.globalStName; import static org.openecomp.core.converter.datatypes.Constants.mainStName; @@ -134,6 +135,23 @@ public class ToscaConverterImplTest { Assert.assertEquals(1, occurrences[1]); } + @Test + public void testPoliciesBeenConverted() throws IOException { + String inputFilesPath = BASE_DIR + "/convertPolicies/in"; + FileContentHandler fileContentHandler = + createFileContentHandlerFromInput(inputFilesPath); + ToscaServiceModel toscaServiceModel = toscaConverter.convert(fileContentHandler); + Optional<ServiceTemplate> st = toscaServiceModel.getServiceTemplate("MainServiceTemplate.yaml"); + + assertTrue(st.isPresent()); + + Map<String, PolicyDefinition> pds = st.get().getTopology_template().getPolicies(); + + assertEquals(2, pds.size()); + assertTrue(pds.containsKey("scaling_aspects")); + assertTrue(pds.containsKey("instantiation_levels")); + } + private Object[] buildOccurrences(String... bounds) { return buildOccurrences(Arrays.asList(bounds)); } |