* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.babel.csar.vnfcatalog;
import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.junit.Assert.assertThat;
extractArtifact("Duff.txt");
}
+ @Test
+ public void createVendorImageMappingsMoreThanOneVnfConfigurationExists() throws IOException {
+ try {
+ extractArtifact("catalog_csar_too_many_vnfConfigurations.csar");
+ } catch (Exception e) {
+ assertThat(e, is(instanceOf(ToscaToCatalogException.class)));
+ assertThat(e.getLocalizedMessage(),
+ is(equalTo("An error occurred trying to get the vnf catalog from a csar file. "
+ + "2 vnfConfigurations were found in the csar file and only one is allowed.")));
+ }
+ }
+
@Test
public void createVendorImageMappingsNoVnfConfigurationExists() throws IOException, ToscaToCatalogException {
assertThat(extractArtifact("noVnfConfiguration.csar"), is(nullValue()));