* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2018 European Software Marketing Ltd.
+ * Copyright © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2019 European Software Marketing Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.junit.Test;
import org.mockito.Mockito;
import org.onap.aai.babel.xml.generator.data.WidgetConfigurationUtil;
+import org.onap.aai.babel.xml.generator.data.WidgetMapping;
import org.onap.aai.babel.xml.generator.model.Resource;
import org.onap.aai.babel.xml.generator.model.Widget.Type;
import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
}
/**
- *
* Add a CR (a type of Resource which is not a Providing Service) to a Resource Model.
*/
@Test(expected = IllegalArgumentException.class)
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));
+ }
+
/**
* Process a dummy Group object for a Service Resource.
*/
* sdc-tosca parser.
*
* @param name
- * name of the NodeTemplate
+ * name of the NodeTemplate
* @param type
- * type of the NodeTemplate
+ * type of the NodeTemplate
* @return a new NodeTemplate object
*/
private NodeTemplate buildNodeTemplate(String name, String type) {