@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(); }
public Path install(BuildahConfiguration buildahConfiguration) throws IOException { final LocationResolver locationResolver = this.locationResolverChain.getLocationResolver(buildahConfiguration); return install(locationResolver.getBuildahName(), locationResolver.loadBuildahResource(), buildahConfiguration); }
InstallManager { public Path install(BuildahConfiguration buildahConfiguration) throws IOException { final LocationResolver locationResolver = this.locationResolverChain.getLocationResolver(buildahConfiguration); return install(locationResolver.getBuildahName(), locationResolver.loadBuildahResource(), buildahConfiguration); } }
InstallManager { public Path install(BuildahConfiguration buildahConfiguration) throws IOException { final LocationResolver locationResolver = this.locationResolverChain.getLocationResolver(buildahConfiguration); return install(locationResolver.getBuildahName(), locationResolver.loadBuildahResource(), buildahConfiguration); } InstallManager(); }
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); }
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);  }