### Question:
DocumentationMojo extends AbstractMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { new ComponentDocumentationGenerator(classes, output, formatter) { @Override protected void warn(final String s) { getLog().warn(s); } }.execute(); }  @Override void execute();  }### Answer:
@Test public void documentAdoc() throws MojoFailureException, MojoExecutionException, IOException { final File out = new File("target/DocumentationMojoTest/output.adoc"); new DocumentationMojo() {{ classes = new File("target/test-classes/org/apache/batchee/tools/maven/"); output = out; }}.execute(); final FileInputStream fis = new FileInputStream(out); assertEquals( "= myChildComponent\n" + "\n" + "a child comp\n" + "\n" + "|===\n" + "|Name|Description\n" + "|config2|2\n" + "|configByDefault|this is an important config\n" + "|expl|this one is less important\n" + "|===\n" + "\n" + "= myComponent\n" + "\n" + "|===\n" + "|Name|Description\n" + "|configByDefault|this is an important config\n" + "|expl|this one is less important\n" + "|===\n" + "\n" + "= org.apache.batchee.tools.maven.batchlet.SimpleBatchlet\n" + "\n" + "|===\n" + "|Name|Description\n" + "|fail|-\n" + "|sleep|-\n" + "|===\n" + "\n", IOUtil.toString(fis)); fis.close(); }
@Test public void documentMd() throws MojoFailureException, MojoExecutionException, IOException { final File out = new File("target/DocumentationMojoTest/output.adoc"); new DocumentationMojo() {{ classes = new File("target/test-classes/org/apache/batchee/tools/maven/"); output = out; formatter = "md"; }}.execute(); final FileInputStream fis = new FileInputStream(out); assertEquals( "# myChildComponent\n" + "\n" + "a child comp\n" + "\n" + "* `config2`: 2\n" + "* `configByDefault`: this is an important config\n" + "* `expl`: this one is less important\n" + "\n" + "# myComponent\n" + "\n" + "* `configByDefault`: this is an important config\n" + "* `expl`: this one is less important\n" + "\n" + "# org.apache.batchee.tools.maven.batchlet.SimpleBatchlet\n" + "\n" + "* `fail`\n" + "* `sleep`\n" + "\n", IOUtil.toString(fis)); fis.close(); }