diff --git a/src/test/java/org/xembly/XemblerTest.java b/src/test/java/org/xembly/XemblerTest.java index 8e91703d..62cad3ff 100644 --- a/src/test/java/org/xembly/XemblerTest.java +++ b/src/test/java/org/xembly/XemblerTest.java @@ -286,28 +286,31 @@ void checksYamlStories(final String story) { @SuppressWarnings("unchecked") private static XML outcomeOf(final String story) { - final Map yaml = new Yaml().load( - String.class.cast(story) + final Map yaml = new Yaml().load(story); + final Node before = new XMLDocument( + yaml.get("before").toString() + ).inner(); + return new XMLDocument( + new Xembler( + new Directives( + String.join( + "", + (Iterable) yaml.get("directives") + ) + ) + ).applyQuietly(before) ); - final Directives directives = new Directives(); - for (final String dir : (Iterable) yaml.get("directives")) { - directives.append(new Directives(dir)); - } - final XML xml = new XMLDocument(yaml.get("before").toString()); - new Xembler(directives).applyQuietly(xml.inner()); - return xml; } @SuppressWarnings("unchecked") private static Matcher matchersOf(final String story) { - final Map yaml = new Yaml().load( - String.class.cast(story) - ); return new AllOf<>( new ListOf<>( new Mapped<>( str -> new XPathMatcher<>(str, new XPathContext()), - (Collection) yaml.get("xpaths") + (Collection) new Yaml() + .>load(story) + .get("xpaths") ) ) );