aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authormark.j.leonard <mark.j.leonard@gmail.com>2018-08-07 17:26:14 +0100
committermark.j.leonard <mark.j.leonard@gmail.com>2018-08-07 17:26:14 +0100
commit8ef1cdfadf5d8c112ea1cc6a99f61ed21fb986de (patch)
treee2b57d7fb91087b3fd1d74fae0eaa1ae6bfd0d95 /src/test
parenta2c5714eabfb87d4a59f106e418c967b599c4212 (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.java13
-rw-r--r--src/test/resources/compressedArtifacts/service-MissingMetadataTest.csarbin0 -> 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
new file mode 100644
index 0000000..fbb2fa1
--- /dev/null
+++ b/src/test/resources/compressedArtifacts/service-MissingMetadataTest.csar
Binary files differ