X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fonap%2Faai%2Fbabel%2Futil%2FArtifactTestUtils.java;h=fa0b78458b69163b95eafd4cf5a18ca060a79985;hb=refs%2Fchanges%2F87%2F74287%2F1;hp=3cbe194fb3650927d0e5e234740ea65b8f39ed49;hpb=0c9acb0e4e7ecde50c274ba60535fafc968f59ba;p=aai%2Fbabel.git diff --git a/src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java b/src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java index 3cbe194..fa0b784 100644 --- a/src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java +++ b/src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java @@ -51,6 +51,16 @@ public class ArtifactTestUtils { private static final String JSON_RESPONSES_FOLDER = "response/"; private static final String CSAR_INPUTS_FOLDER = "compressedArtifacts/"; + /** + * Specific test method for the YAML Extractor test. + * + * @param toscaFiles + * files extracted by the YamlExtractor + * @param ymlPayloadsToLoad + * the expected YAML files + * @throws IOException + * if an I/O exception occurs + */ public void performYmlAsserts(List toscaFiles, List ymlPayloadsToLoad) throws IOException { assertThat("An incorrect number of YAML files have been extracted", toscaFiles.size(), is(equalTo(ymlPayloadsToLoad.size()))); @@ -70,22 +80,20 @@ public class ArtifactTestUtils { } /** - * Compare 2 XML strings to see if they have the same content + * Compare two XML strings to see if they have the same content. * * @param string1 + * XML content * @param string2 - * @return true if similar + * XML content + * @return true if XML content is similar + * @throws IOException + * if an I/O exception occurs + * @throws SAXException + * if the XML parsing fails */ - public boolean compareXmlStrings(String string1, String string2) { - boolean similar = false; - - try { - similar = new Diff(string1, string2).similar(); - } catch (SAXException | IOException e) { // NOSONAR - similar = true; - } - - return similar; + public boolean compareXmlStrings(String string1, String string2) throws SAXException, IOException { + return new Diff(string1, string2).similar(); } public byte[] getCompressedArtifact(String resourceName) throws IOException {