- ArtifactGeneratorToscaParser parser = new ArtifactGeneratorToscaParser(null);
- parser.processServiceTosca(null, Collections.emptyMap(), nodeTemplateList);
- parser.processResourceToscas(nodeTemplateList, null);
+ new ArtifactGeneratorToscaParser(null).processResourceModels(new Resource(Type.ALLOTTED_RESOURCE, true),
+ nodeTemplateList);
+ }
+
+ /**
+ * 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);
+ }
+
+ /**
+ * Initialise the Artifact Generator Widget Mapping config with incomplete data.
+ */
+ @Test(expected = IllegalArgumentException.class)
+ public void testToscaMappingWithoutType() {
+ WidgetMapping invalidMapping = new WidgetMapping();
+ invalidMapping.setType(null);
+ WidgetConfigurationUtil.setWidgetMappings(Collections.singletonList(invalidMapping));
+ }
+
+ /**
+ * Initialise the Artifact Generator Widget Mapping config with incomplete data.
+ */
+ @Test(expected = IllegalArgumentException.class)
+ public void testToscaMappingWithoutWidget() {
+ WidgetMapping invalidMapping = new WidgetMapping();
+ invalidMapping.setWidget(null);
+ WidgetConfigurationUtil.setWidgetMappings(Collections.singletonList(invalidMapping));