XmlConfigurationDaoImpl implements ConfigurationDao { @Override public void save() throws IOException { try (OutputStream out = new FileOutputStream(getConfigFile().toFile())) { xstream.toXML(rootNode, out); } } @Inject  XmlConfigurationDaoImpl(@Named("localHolmesDataDir") final String localHolmesDataDir); @Override List<ConfigurationNode> getNodes(final RootNode rootNode); @Override ConfigurationNode getNode(final RootNode rootNode, final String nodeId); @Override Optional<ConfigurationNode> findNode(final RootNode rootNode, final String excludedNodeId, final String label, final String path); @Override void save(); @Override T getParameter(final ConfigurationParameter<T> parameter); @Override void setParameter(final ConfigurationParameter<T> parameter, final T value);  }
@Test public void testXmlConfigurationSaveConfig() throws IOException { String configDir = new File(this.getClass().getResource("/configuration").getPath()).getAbsolutePath(); XmlConfigurationDaoImpl configuration = new XmlConfigurationDaoImpl(configDir); configuration.save(); }