ProjectDirectoryUpdater { public void updateBuildDirectory(String buildDirectory) { checkArgument(buildDirectory != null, "The project build directory must not be null"); project.getBuild().setDirectory(buildDirectory); updateBuildOutputDirectory(buildDirectory); updateBuildTestOputputDirectory(buildDirectory); updateReportingOutputDirectory(buildDirectory); } ProjectDirectoryUpdater(MavenProject project); void updateBuildDirectory(String buildDirectory); void updateBuildOutputDirectory(String buildDirectory); void updateBuildTestOputputDirectory(String buildDirectory); void updateReportingOutputDirectory(String buildDirectory);  }
@Test(expected = IllegalArgumentException.class) public void updateBuildDirectoryNullDirectory() { projectDirectoryUpdater.updateBuildDirectory(null); }
@Test public void updateBuildDirectory() { projectDirectoryUpdater.updateBuildDirectory(DEFAULT_BUILD_DIRECTORY); verify(mavenProjectMock, times(3)).getModel(); verify(modelMock, times(2)).getBuild(); verify(modelMock, times(1)).getReporting(); verify(buildMock, times(1)).setDirectory(DEFAULT_BUILD_DIRECTORY); verify(buildMock, times(1)).setOutputDirectory(Paths.get(DEFAULT_BUILD_DIRECTORY, "classes").toString()); verify(buildMock, times(1)).setTestOutputDirectory(Paths.get(DEFAULT_BUILD_DIRECTORY, "test-classes").toString()); verify(reportingMock, times(1)).setOutputDirectory(Paths.get(DEFAULT_BUILD_DIRECTORY, "site").toString()); }