+ /**
+ * Add a CR (a type of Resource which is not a Providing Service) to a Resource Model.
+ */
+ @Test(expected = IllegalArgumentException.class)
+ public void testAddResourceNotProvidingService() {
+ List<NodeTemplate> nodeTemplateList = Collections.singletonList(buildNodeTemplate("testCR", "CR"));
+ // Create any Resource to which the CR can be added
+ final Resource dummyResource = new Resource(Type.ALLOTTED_RESOURCE, true);
+ new ArtifactGeneratorToscaParser(null).processResourceModels(dummyResource, nodeTemplateList);
+ }
+
+ /**
+ * Initialize the Artifact Generator Widget Mapping config with incomplete data (no type).
+ *
+ * @throws IOException
+ */
+ @Test(expected = IOException.class)
+ public void testToscaMappingWithoutType() throws IOException {
+ WidgetMapping invalidMapping = new WidgetMapping();
+ invalidMapping.setType(null);
+ WidgetConfigurationUtil.setWidgetMappings(Collections.singletonList(invalidMapping));
+ }
+
+ /**
+ * Initialize the Artifact Generator Widget Mapping config with invalid data (type value).
+ *
+ * @throws IOException
+ */
+ @Test(expected = IOException.class)
+ public void testToscaMappingWithInvalidType() throws IOException {
+ WidgetMapping invalidMapping = new WidgetMapping();
+ invalidMapping.setType("invalid");
+ WidgetConfigurationUtil.setWidgetMappings(Collections.singletonList(invalidMapping));
+ }
+
+ /**
+ * Initialize the Artifact Generator Widget Mapping config with incomplete data (no widget name).
+ *
+ * @throws IOException
+ */
+ @Test(expected = IOException.class)
+ public void testToscaMappingWithoutWidget() throws IOException {
+ WidgetMapping invalidMapping = new WidgetMapping();
+ invalidMapping.setWidget(null);
+ WidgetConfigurationUtil.setWidgetMappings(Collections.singletonList(invalidMapping));
+ }
+