### Question:
MarkdownMojo extends AbstractWisdomWatcherMojo implements Constants { public void execute() throws MojoExecutionException { if (extensions == null || extensions.isEmpty()) { extensions = ImmutableList.of("md", "markdown"); } if (instance == null) { instance = new PegDownProcessor(Extensions.ALL); } try { for (File f : getResources(extensions)) { process(f); } } catch (IOException e) { throw new MojoExecutionException("Error while processing a Markdown file", e); } }  void execute(); void process(File input); @Override boolean accept(File file); @Override boolean fileCreated(File file); @Override boolean fileUpdated(File file); @Override boolean fileDeleted(File file); static final String OUTPUT_EXTENSION; }### Answer:
@Test public void testInitializationWithNoFiles() throws MojoExecutionException { MarkdownMojo mojo = new MarkdownMojo(); mojo.basedir = basedir; mojo.buildDirectory = new File(mojo.basedir, "target"); mojo.execute(); assertThat(mojo.instance).isNotNull(); }
@Test public void testInitializationWithUnfilteredInternalAndExternalFilesUsingRegularExtensions() throws MojoExecutionException, IOException { MarkdownMojo mojo = new MarkdownMojo(); mojo.basedir = basedir; mojo.buildDirectory = new File(mojo.basedir, "target"); FileUtils.copyFile(new File("src/test/resources/hello.md"), new File(basedir, "src/main/resources/assets/doc/hello.md")); FileUtils.copyFile(new File("src/test/resources/hello.md"), new File(basedir, "src/main/assets/doc/hello.md")); mojo.execute(); final File internal = new File(mojo.getInternalAssetOutputDirectory(), "doc/hello.html"); final File external = new File(mojo.getExternalAssetsOutputDirectory(), "doc/hello.html"); assertThat(internal).isFile(); assertThat(external).isFile(); assertThat(FileUtils.readFileToString(internal)).contains("<h1>Hello, " + "Wisdom!</h1>").contains("href=\"http: assertThat(FileUtils.readFileToString(external)).contains("<h1>Hello, " + "Wisdom!</h1>").contains("href=\"http: }
@Test public void testInitializationWithFilteredInternalAndExternalFilesUsingRegularExtensions() throws MojoExecutionException, IOException { MarkdownMojo mojo = new MarkdownMojo(); mojo.basedir = basedir; mojo.buildDirectory = new File(mojo.basedir, "target"); FileUtils.copyFile(new File("src/test/resources/hello.md"), new File(basedir, "src/main/resources/assets/doc/hello.md")); FileUtils.copyFile(new File("src/test/resources/hello.md"), new File(basedir, "target/classes/assets/doc/hello.md")); FileUtils.copyFile(new File("src/test/resources/hello.md"), new File(basedir, "src/main/assets/doc/hello.md")); FileUtils.copyFile(new File("src/test/resources/hello.md"), new File(basedir, "target/wisdom/assets/doc/hello.md")); mojo.execute(); final File internal = new File(mojo.getInternalAssetOutputDirectory(), "doc/hello.html"); final File external = new File(mojo.getExternalAssetsOutputDirectory(), "doc/hello.html"); assertThat(internal).isFile(); assertThat(external).isFile(); assertThat(FileUtils.readFileToString(internal)).contains("<h1>Hello, " + "Wisdom!</h1>").contains("href=\"http: assertThat(FileUtils.readFileToString(external)).contains("<h1>Hello, " + "Wisdom!</h1>").contains("href=\"http: }