@Test public void fails_on_non_existing_import() { thrown.expect(RuntimeException.class); thrown.expectMessage("Import location cannot be resolved: changelog/includes/that/is_gonna_fail.xml"); resolver.resolveImports( "changelog/includes/invalid_include.xml", changelogLoader ); }
public Node resolveImports(String changelog, ChangelogLoader changelogLoader) { try (InputStream stream = changelogLoader.load(changelog)) { if (stream == null) { throw new RuntimeException("Import location cannot be resolved: " + changelog); } return resolve(changelog, document(stream), changelogLoader); } catch (IOException e) { throw propagate(e); } }
ImportResolver { public Node resolveImports(String changelog, ChangelogLoader changelogLoader) { try (InputStream stream = changelogLoader.load(changelog)) { if (stream == null) { throw new RuntimeException("Import location cannot be resolved: " + changelog); } return resolve(changelog, document(stream), changelogLoader); } catch (IOException e) { throw propagate(e); } } }
ImportResolver { public Node resolveImports(String changelog, ChangelogLoader changelogLoader) { try (InputStream stream = changelogLoader.load(changelog)) { if (stream == null) { throw new RuntimeException("Import location cannot be resolved: " + changelog); } return resolve(changelog, document(stream), changelogLoader); } catch (IOException e) { throw propagate(e); } } ImportResolver(); }
ImportResolver { public Node resolveImports(String changelog, ChangelogLoader changelogLoader) { try (InputStream stream = changelogLoader.load(changelog)) { if (stream == null) { throw new RuntimeException("Import location cannot be resolved: " + changelog); } return resolve(changelog, document(stream), changelogLoader); } catch (IOException e) { throw propagate(e); } } ImportResolver(); Node resolveImports(String changelog, ChangelogLoader changelogLoader); }
ImportResolver { public Node resolveImports(String changelog, ChangelogLoader changelogLoader) { try (InputStream stream = changelogLoader.load(changelog)) { if (stream == null) { throw new RuntimeException("Import location cannot be resolved: " + changelog); } return resolve(changelog, document(stream), changelogLoader); } catch (IOException e) { throw propagate(e); } } ImportResolver(); Node resolveImports(String changelog, ChangelogLoader changelogLoader);  }