@Test public void testGenerator() { docGenerator.generateDoc(pluginDocTree); ArgumentCaptor<String> pluginNameCaptor = ArgumentCaptor.forClass(String.class); ArgumentCaptor<String> docCaptor = ArgumentCaptor.forClass(String.class); verify(writerMock).writeDocFile(pluginNameCaptor.capture(), docCaptor.capture()); assertThat(pluginNameCaptor.getValue(), is("plugin1")); assertThat(docCaptor.getValue().length(), greaterThan(180)); assertThat(docCaptor.getValue().length(), lessThan(300)); assertThat(docCaptor.getValue().contains("\n==== cmd1"), is(true)); assertThat(docCaptor.getValue().contains("\n[cols=\"1a,5a\"]"), is(true)); assertThat(docCaptor.getValue().contains("This is Result 3"), is(true)); }
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);  }