### Question:
PathAssembler { public LocalDistribution getDistribution( WrapperConfiguration configuration ) { String baseName = getDistName( configuration.getDistribution() ); String rootDirName = removeExtension( baseName ); Path distDir = getBaseDir( configuration.getDistributionBase() ) .resolve( configuration.getDistributionPath() ) .resolve( rootDirName ); Path distZip = getBaseDir( configuration.getZipBase() ) .resolve( configuration.getZipPath() ) .resolve( rootDirName ) .resolve( baseName ); return new LocalDistribution( distDir, distZip ); } PathAssembler();  PathAssembler( Path mavenUserHome ); LocalDistribution getDistribution( WrapperConfiguration configuration ); static final String MAVEN_USER_HOME_STRING; static final String PROJECT_STRING; }### Answer:
@Test public void distributionDirWithMavenUserHomeBase() throws Exception { configuration.setDistribution( new URI( "http: Path distributionDir = pathAssembler.getDistribution( configuration ).getDistributionDir(); assertThat( distributionDir, is( Paths.get( TEST_MAVEN_USER_HOME, "/somePath/maven-0.9-bin" ) ) ); }
@Test public void distributionDirWithProjectBase() throws Exception { configuration.setDistributionBase( PathAssembler.PROJECT_STRING ); configuration.setDistribution( new URI( "http: Path distributionDir = pathAssembler.getDistribution( configuration ).getDistributionDir(); assertThat( distributionDir, equalTo( Paths.get( currentDirPath(), "/somePath/maven-0.9-bin" ) ) ); }
@Test public void distributionDirWithUnknownBase() throws Exception { configuration.setDistribution( new URI( "http: configuration.setDistributionBase( "unknownBase" ); RuntimeException e = assertThrows( RuntimeException.class, () -> pathAssembler.getDistribution( configuration ) ); assertEquals( "Base: unknownBase is unknown", e.getMessage() ); }
@Test public void distZipWithMavenUserHomeBase() throws Exception { configuration.setDistribution( new URI( "http: Path dist = pathAssembler.getDistribution( configuration ).getZipFile(); assertThat( dist.getFileName().toString(), equalTo( "maven-1.0.zip" ) ); assertThat( dist.getParent(), equalTo( Paths.get( TEST_MAVEN_USER_HOME, "/somePath/maven-1.0" ) ) ); }
@Test public void distZipWithProjectBase() throws Exception { configuration.setZipBase( PathAssembler.PROJECT_STRING ); configuration.setDistribution( new URI( "http: Path dist = pathAssembler.getDistribution( configuration ).getZipFile(); assertThat( dist.getFileName().toString(), equalTo( "maven-1.0.zip" ) ); assertThat( dist.getParent(), equalTo( Paths.get( currentDirPath(), "/somePath/maven-1.0" ) ) ); }