### Question:
AbstractWisdomMojo extends AbstractMojo { public File getWisdomRootDirectory() { File wisdom; if (wisdomDirectory == null) { wisdom = new File(buildDirectory, Constants.WISDOM_DIRECTORY_NAME); } else { this.getLog().debug("Using Wisdom Directory : " + wisdomDirectory.getAbsolutePath()); wisdom = wisdomDirectory; } if (wisdom.mkdirs()) { this.getLog().debug(wisdom.getAbsolutePath() + " directory created."); } return wisdom; }  File getWisdomRootDirectory(); String getNodeDistributionRootUrl(); String getNpmRegistryRootUrl(); NodeManager getNodeManager(); void setNodeManager(NodeManager manager); File getInternalAssetsDirectory(); File getInternalAssetOutputDirectory(); File getExternalAssetsDirectory(); File getExternalAssetsOutputDirectory(); String getNodeVersion(); String getNPMVersion(); @Parameter(defaultValue = "${project}", readonly = true)
    public MavenProject project; @Parameter(defaultValue = "${basedir}", required = true, readonly = true)
    public File basedir; @Parameter(defaultValue = "${project.build.directory}", required = true, readonly = true)
    public File buildDirectory; @Parameter(defaultValue = "${session}", readonly = true )
    public MavenSession session; @Component
    public MavenProjectHelper projectHelper; @Parameter(defaultValue = "${plugin.artifacts}")
    public List<Artifact> pluginDependencies; @Parameter(defaultValue = "${plugin}")
    public PluginDescriptor plugin; @Component
    public BuildPluginManager pluginManager; @Component
    public RepositorySystem repoSystem; @Parameter(defaultValue = "${repositorySystemSession}", readonly = true)
    public RepositorySystemSession repoSession; @Parameter(defaultValue = "${project.remoteProjectRepositories}", readonly = true)
    public List<RemoteRepository> remoteRepos; @Parameter(defaultValue = "${wisdomDirectory}")
    public File wisdomDirectory; @Component(role = SettingsDecrypter.class)
    public SettingsDecrypter decrypter; @Parameter(defaultValue = "${java.home}", required = true, readonly = true)
    public File javaHome; }### Answer:
@Test public void testGetWisdomRootDirectoryWhenWisdomDirectoryIsNotSet() throws Exception { DummyMojo mojo = new DummyMojo(); mojo.basedir = new File("target/dummy"); mojo.buildDirectory = new File(mojo.basedir, "target"); File expected = new File(mojo.basedir, "target/wisdom"); assertThat(mojo.getWisdomRootDirectory()).isEqualTo(expected); }
@Test public void testGetWisdomRootDirectoryWhenWisdomDirectoryIsSet() throws Exception { DummyMojo mojo = new DummyMojo(); mojo.basedir = new File("target/dummy"); mojo.buildDirectory = new File(mojo.basedir, "target"); mojo.wisdomDirectory = new File(mojo.basedir, "target/wisdom2"); assertThat(mojo.getWisdomRootDirectory()).isEqualTo(mojo.wisdomDirectory); }