@Test public void testGeneratorWithTwoPlugins() { pluginDocTree.addPlugin("plugin2", pluginDoc2); docGenerator.generateDoc(pluginDocTree); verify(writerMock, times(2)).writeDocFile(any(String.class), any(String.class)); }
public void generateDoc(PluginDocTree pluginDocTree) { for (String pluginName : pluginDocTree.getPluginNames()) { StringTemplate pluginDocST = getPluginDoc(pluginName, pluginDocTree.getPlugin(pluginName), pluginDocTree.getCommands(pluginName)); docFileWriter.writeDocFile(pluginName, pluginDocST.toString()); } }
DocGenerator { public void generateDoc(PluginDocTree pluginDocTree) { for (String pluginName : pluginDocTree.getPluginNames()) { StringTemplate pluginDocST = getPluginDoc(pluginName, pluginDocTree.getPlugin(pluginName), pluginDocTree.getCommands(pluginName)); docFileWriter.writeDocFile(pluginName, pluginDocST.toString()); } } }
DocGenerator { public void generateDoc(PluginDocTree pluginDocTree) { for (String pluginName : pluginDocTree.getPluginNames()) { StringTemplate pluginDocST = getPluginDoc(pluginName, pluginDocTree.getPlugin(pluginName), pluginDocTree.getCommands(pluginName)); docFileWriter.writeDocFile(pluginName, pluginDocST.toString()); } } DocGenerator(DocFileWriter docFileWriter); }
DocGenerator { public void generateDoc(PluginDocTree pluginDocTree) { for (String pluginName : pluginDocTree.getPluginNames()) { StringTemplate pluginDocST = getPluginDoc(pluginName, pluginDocTree.getPlugin(pluginName), pluginDocTree.getCommands(pluginName)); docFileWriter.writeDocFile(pluginName, pluginDocST.toString()); } } DocGenerator(DocFileWriter docFileWriter); void generateDoc(PluginDocTree pluginDocTree); }
DocGenerator { public void generateDoc(PluginDocTree pluginDocTree) { for (String pluginName : pluginDocTree.getPluginNames()) { StringTemplate pluginDocST = getPluginDoc(pluginName, pluginDocTree.getPlugin(pluginName), pluginDocTree.getCommands(pluginName)); docFileWriter.writeDocFile(pluginName, pluginDocST.toString()); } } DocGenerator(DocFileWriter docFileWriter); void generateDoc(PluginDocTree pluginDocTree);  }