diff options
author | mark.j.leonard <mark.j.leonard@gmail.com> | 2018-08-07 17:26:14 +0100 |
---|---|---|
committer | mark.j.leonard <mark.j.leonard@gmail.com> | 2018-08-07 17:26:14 +0100 |
commit | 8ef1cdfadf5d8c112ea1cc6a99f61ed21fb986de (patch) | |
tree | e2b57d7fb91087b3fd1d74fae0eaa1ae6bfd0d95 /src/test | |
parent | a2c5714eabfb87d4a59f106e418c967b599c4212 (diff) |
Add test CSAR file for missing Service metadata
Change-Id: I4138d1d60fe234949264f3c2d2e2156681e9075c
Issue-ID: AAI-1448
Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/org/onap/aai/babel/service/CsarToXmlConverterTest.java | 13 | ||||
-rw-r--r-- | src/test/resources/compressedArtifacts/service-MissingMetadataTest.csar | bin | 0 -> 38741 bytes |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/test/java/org/onap/aai/babel/service/CsarToXmlConverterTest.java b/src/test/java/org/onap/aai/babel/service/CsarToXmlConverterTest.java index 62e9265..9cfdf9b 100644 --- a/src/test/java/org/onap/aai/babel/service/CsarToXmlConverterTest.java +++ b/src/test/java/org/onap/aai/babel/service/CsarToXmlConverterTest.java @@ -18,6 +18,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package org.onap.aai.babel.service; import static org.junit.Assert.assertThat; @@ -43,7 +44,7 @@ import org.onap.aai.babel.util.ArtifactTestUtils; import org.onap.aai.babel.xml.generator.XmlArtifactGenerationException; /** - * Tests {@link CsarToXmlConverter} + * Tests {@link CsarToXmlConverter}. */ public class CsarToXmlConverterTest { @@ -61,6 +62,9 @@ public class CsarToXmlConverterTest { VALID_CSAR_FILE( "service-SdWanServiceTest-csar.csar" ), + MISSING_METADATA_CSAR( + "service-MissingMetadataTest.csar" + ), NO_YAML_FILES( "noYmlFilesArchive.zip" ), @@ -140,6 +144,13 @@ public class CsarToXmlConverterTest { } @Test + public void testServiceMetadataMissing() + throws IOException, XmlArtifactGenerationException, CsarConverterException { + converter.generateXmlFromCsar(CsarTest.MISSING_METADATA_CSAR.getContent(), + CsarTest.MISSING_METADATA_CSAR.getName(), SERVICE_VERSION); + } + + @Test public void generateXmlFromCsar() throws CsarConverterException, IOException, XmlArtifactGenerationException { Map<String, String> expectedXmlFiles = createExpectedXmlFiles(); List<BabelArtifact> generatedArtifacts = converter.generateXmlFromCsar(CsarTest.VALID_CSAR_FILE.getContent(), diff --git a/src/test/resources/compressedArtifacts/service-MissingMetadataTest.csar b/src/test/resources/compressedArtifacts/service-MissingMetadataTest.csar Binary files differnew file mode 100644 index 0000000..fbb2fa1 --- /dev/null +++ b/src/test/resources/compressedArtifacts/service-MissingMetadataTest.csar |