### Question:
DefaultRemoteExecutor implements RemoteExecutor { @Override public CompletableFuture<KieCompilationResponse> buildAndInstall(String projectPath, String mavenRepoPath, String settingsXmlPath) { return internalBuild(projectPath, mavenRepoPath, settingsXmlPath, Boolean.FALSE, MavenCLIArgs.INSTALL); } DefaultRemoteExecutor(ExecutorService executorService); @Override CompletableFuture<KieCompilationResponse> build(String projectPath, String mavenRepoPath, String settingsXmlPath); @Override CompletableFuture<KieCompilationResponse> build(String projectPath, String mavenRepoPath, String settingsXmlPath, Boolean skipPrjDependenciesCreationList); @Override CompletableFuture<KieCompilationResponse> buildAndInstall(String projectPath, String mavenRepoPath, String settingsXmlPath); @Override CompletableFuture<KieCompilationResponse> buildAndInstall(String projectPath, String mavenRepoPath, String settingsXmlPath,
                                                                     Boolean skipPrjDependenciesCreationList); @Override CompletableFuture<KieCompilationResponse> buildSpecialized(String projectPath, String mavenRepoPath, String[] args); @Override CompletableFuture<KieCompilationResponse> buildSpecialized(String projectPath, String mavenRepoPath, String[] args,
                                                                      Boolean skipPrjDependenciesCreationList);  }### Answer:
@Test public void buildAndInstallNonExistentProject() throws Exception{ DefaultRemoteExecutor executor = new DefaultRemoteExecutor(executorService); CompletableFuture<KieCompilationResponse> futureRes = executor.buildAndInstall(tmpRoot.toAbsolutePath().toString(), mavenRepoPath, TestUtilMaven.getSettingsFile()); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isFalse(); }
@Test public void buildAndInstallSkipDepsNonExistentProject() throws Exception{ DefaultRemoteExecutor executor = new DefaultRemoteExecutor(executorService); CompletableFuture<KieCompilationResponse> futureRes = executor.buildAndInstall(tmpRoot.toAbsolutePath().toString(), mavenRepoPath, TestUtilMaven.getSettingsFile(), Boolean.FALSE); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isFalse(); assertThat(res.getDependencies()).isEmpty(); }
@Test public void buildAndInstallExistentProject() throws Exception{ DefaultRemoteExecutor executor = new DefaultRemoteExecutor(executorService); CompletableFuture<KieCompilationResponse> futureRes = executor.buildAndInstall(Paths.get(tmpRoot.toAbsolutePath()+"/dummy").toAbsolutePath().toString(), mavenRepoPath, TestUtilMaven.getSettingsFile()); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isTrue(); assertThat(res.getDependencies()).isNotEmpty(); assertThat(res.getDependencies().size()).isGreaterThan(0); }
@Test public void buildAndInstallSkipDepsExistentProject() throws Exception{ DefaultRemoteExecutor executor = new DefaultRemoteExecutor(executorService); CompletableFuture<KieCompilationResponse> futureRes = executor.buildAndInstall(Paths.get(tmpRoot.toAbsolutePath()+"/dummy").toAbsolutePath().toString(), mavenRepoPath, TestUtilMaven.getSettingsFile(), Boolean.TRUE); KieCompilationResponse res = futureRes.get(); assertThat(res.isSuccessful()).isTrue(); assertThat(res.getDependencies()).isEmpty(); }