+ for (Artifact artifact : toscaFiles) {
+ String fileName = artifact.getName().replaceFirst("Definitions/", "ymlFiles/");
+ String expectedYaml = ymlMap.get(fileName);
+ assertThat("Missing expected content for " + fileName, expectedYaml, is(not(nullValue())));
+ assertThat("The content of " + fileName + " must match the expected content",
+ convertToString(artifact.getPayload()).replaceAll("\\r\\n?", "\n"), is(equalTo(expectedYaml)));
+ }
+ }
+
+ /**
+ * Compare two XML strings to see if they have the same content.
+ *
+ * @param string1
+ * XML content
+ * @param string2
+ * 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) throws SAXException, IOException {
+ return new Diff(string1, string2).similar();