- public void generateXmlFromCsar() throws CsarConverterException, IOException, XmlArtifactGenerationException {
- byte[] csarArchive =
- new ArtifactTestUtils().loadResource("compressedArtifacts/service-SdWanServiceTest-csar.csar");
-
- Map<String, String> expectedXmlFiles = createExpectedXmlFiles();
- List<BabelArtifact> generatedArtifacts =
- converter.generateXmlFromCsar(csarArchive, VERSION, "service-SdWanServiceTest-csar.csar");
-
- generatedArtifacts.forEach(ga -> {
- try {
-
- String x1 = expectedXmlFiles.get(ga.getName());
-
- String x2 = bytesToString(ga.getPayload());
-
- assertXMLEqual("The content of " + ga.getName() + " must match the expected content", x1, x2);
-
- } catch (SAXException | IOException e) {
- fail("There was an Exception parsing the XML: "+e.getMessage());
- }
- });
+ public void testServiceMetadataMissing()
+ throws IOException, XmlArtifactGenerationException, CsarConverterException {
+ converter.generateXmlFromCsar(CsarTest.MISSING_METADATA_CSAR.getContent(),
+ CsarTest.MISSING_METADATA_CSAR.getName(), SERVICE_VERSION);