* Initialize the Generator with an invalid artifact generator properties file path.
*
* @throws IOException
+ * if an error occurs reading the configuration properties
*/
@Test(expected = IllegalArgumentException.class)
public void testMissingPropertiesFile() throws IOException {
* Initialize the Generator with an invalid mappings file path.
*
* @throws IOException
+ * if the file content could not be read successfully
*/
@Test(expected = IllegalArgumentException.class)
public void testMissingMappingsFile() throws IOException {
* Initialize the Generator with no Widget Mappings content.
*
* @throws IOException
+ * if the file content could not be read successfully
*/
@Test(expected = IOException.class)
public void testMissingMappingsContent() throws IOException {
* Initialize the Generator with invalid Widget Mappings content.
*
* @throws IOException
+ * if the file content could not be read successfully
*/
@Test(expected = IOException.class)
public void testInvalidMappingsContent() throws IOException {
}
/**
- * Initialise the Artifact Generator Widget Mapping config with incomplete data.
+ * Initialize the Artifact Generator Widget Mapping config with incomplete data (no type).
+ *
+ * @throws IOException
*/
- @Test(expected = IllegalArgumentException.class)
- public void testToscaMappingWithoutType() {
+ @Test(expected = IOException.class)
+ public void testToscaMappingWithoutType() throws IOException {
WidgetMapping invalidMapping = new WidgetMapping();
invalidMapping.setType(null);
WidgetConfigurationUtil.setWidgetMappings(Collections.singletonList(invalidMapping));
}
/**
- * Initialise the Artifact Generator Widget Mapping config with incomplete data.
+ * Initialize the Artifact Generator Widget Mapping config with invalid data (type value).
+ *
+ * @throws IOException
*/
- @Test(expected = IllegalArgumentException.class)
- public void testToscaMappingWithoutWidget() {
+ @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));
}
-
+
/**
* Process a dummy Group object for a Service Resource.
*
* @throws XmlArtifactGenerationException
+ * if there is no configuration defined for a member Widget of an instance group
*/
@Test
public void testInstanceGroups() throws XmlArtifactGenerationException {