### Question:
InstallManager { public Path install(BuildahConfiguration buildahConfiguration) throws IOException { final LocationResolver locationResolver = this.locationResolverChain.getLocationResolver(buildahConfiguration); return install(locationResolver.getBuildahName(), locationResolver.loadBuildahResource(), buildahConfiguration); } InstallManager(); Path install(BuildahConfiguration buildahConfiguration); Path install(String name, InputStream content, BuildahConfiguration buildahConfiguration); void uninstall(Path path);  }### Answer:
@Test public void should_install_file_with_executable_permission() throws IOException { when(locationResolverChain.getLocationResolver(any(BuildahConfiguration.class))).thenReturn(locationResolver); when(locationResolver.getBuildahName()).thenReturn("hellobuildah.txt"); when(locationResolver.loadBuildahResource()).thenReturn(new ByteArrayInputStream("binaries/hello.txt".getBytes())); InstallManager installManager = new InstallManager(); installManager.locationResolverChain = locationResolverChain; final Path installPath = installManager.install(new BuildahConfiguration()); assertThat(installPath) .exists() .isExecutable(); }
@Test public void should_install_file_in_concrete_location(@TempDir Path installationDir) throws IOException { when(locationResolverChain.getLocationResolver(any(BuildahConfiguration.class))).thenReturn(locationResolver); when(locationResolver.getBuildahName()).thenReturn("hellobuildah.txt"); when(locationResolver.loadBuildahResource()).thenReturn(new ByteArrayInputStream("binaries/hello.txt".getBytes())); InstallManager installManager = new InstallManager(); installManager.locationResolverChain = locationResolverChain; final BuildahConfiguration buildahConfiguration = new BuildahConfiguration(); buildahConfiguration.setInstallationDir(installationDir); final Path installPath = installManager.install(buildahConfiguration); assertThat(installPath).startsWith(installationDir); }