+ /**
+ * Initialize the Generator with an invalid artifact generator properties file path.
+ *
+ * @throws IOException
+ */
+ @Test(expected = IllegalArgumentException.class)
+ public void testMissingPropertiesFile() throws IOException {
+ System.setProperty(ArtifactGeneratorToscaParser.PROPERTY_ARTIFACT_GENERATOR_CONFIG_FILE, "non-existent.file");
+ ArtifactGeneratorToscaParser.initWidgetConfiguration();
+ }
+
+ /**
+ * Initialize the Generator with an invalid mappings file path.
+ *
+ * @throws IOException
+ */
+ @Test(expected = IllegalArgumentException.class)
+ public void testMissingMappingsFile() throws IOException {
+ ArtifactGeneratorToscaParser.initToscaMappingsConfiguration("non-existent.file");
+ }
+
+ /**
+ * Initialize the Generator with no Widget Mappings content.
+ *
+ * @throws IOException
+ */
+ @Test(expected = IOException.class)
+ public void testMissingMappingsContent() throws IOException {
+ String invalidJson = new ArtifactTestUtils().getResourcePath(Resources.EMPTY_TOSCA_MAPPING_CONFIG);
+ ArtifactGeneratorToscaParser.initToscaMappingsConfiguration(invalidJson);
+ }
+
+ /**
+ * Initialize the Generator with invalid Widget Mappings content.
+ *
+ * @throws IOException
+ */
+ @Test(expected = IOException.class)
+ public void testInvalidMappingsContent() throws IOException {
+ String invalidJson = new ArtifactTestUtils().getResourcePath(Resources.INVALID_TOSCA_MAPPING_CONFIG);
+ ArtifactGeneratorToscaParser.initToscaMappingsConfiguration(invalidJson);
+ }
+