diff options
Diffstat (limited to 'src/test/java/org/onap/aai/babel/csar/vnfcatalog/VnfVendorImageExtractorTest.java')
-rw-r--r-- | src/test/java/org/onap/aai/babel/csar/vnfcatalog/VnfVendorImageExtractorTest.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/java/org/onap/aai/babel/csar/vnfcatalog/VnfVendorImageExtractorTest.java b/src/test/java/org/onap/aai/babel/csar/vnfcatalog/VnfVendorImageExtractorTest.java index de5ea3f..49784c1 100644 --- a/src/test/java/org/onap/aai/babel/csar/vnfcatalog/VnfVendorImageExtractorTest.java +++ b/src/test/java/org/onap/aai/babel/csar/vnfcatalog/VnfVendorImageExtractorTest.java @@ -18,9 +18,11 @@ * 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; @@ -57,6 +59,18 @@ public class VnfVendorImageExtractorTest { } @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())); } |