summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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