- Set<String> ymlPayloads = ymlPayloadsToLoad.stream().map(s -> {
- try {
- return loadResourceAsString(s);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }).collect(Collectors.toSet());
+ /**
+ * 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<Artifact> toscaFiles, List<String> ymlPayloadsToLoad) throws IOException {
+ assertThat("An incorrect number of YAML files have been extracted", toscaFiles.size(),
+ is(equalTo(ymlPayloadsToLoad.size())));
+
+ Map<String, String> ymlMap = new HashMap<>();
+ for (String filename : ymlPayloadsToLoad) {
+ ymlMap.put(filename, loadResourceAsString(filename));
+ }