+ /**
+ * Test that an Exception is thrown when a Widget Type (such as ALLOTTED_RESOURCE) required by Babel is not present
+ * in the WidgetType dynamic enumeration.
+ *
+ * @throws SdcToscaParserException
+ * @throws IOException
+ * @throws XmlArtifactGenerationException
+ */
+ @Test(expected = IllegalArgumentException.class)
+ public void testParserWithIncompleteMappings()
+ throws SdcToscaParserException, IOException, XmlArtifactGenerationException {
+ testUtils.loadWidgetMappings();
+ testUtils.loadWidgetToUuidMappings();
+
+ AaiArtifactGenerator artifactGenerator = new AaiArtifactGenerator();
+ WidgetType.clearElements(); // Remove all WidgetTypes so that the generator fails
+
+ ISdcCsarHelper csarHelper = SdcToscaParserFactory.getInstance()
+ .getSdcCsarHelper(TestAaiArtifactGenerator.class.getClassLoader()
+ .getResource(ArtifactTestUtils.CSAR_INPUTS_FOLDER + CsarTest.VNF_VENDOR_CSAR.getName())
+ .getFile().toString());
+ artifactGenerator.generateAllArtifacts("1.0", csarHelper);
+ }
+