@Test public void runProcessAndWait_ReturnsExpectedResults_OnFailingCommandExecution() throws IOException { Path tmpDir = Paths.get(System.getProperty("java.io.tmpdir")); String[] command = new String[] {"git", "status"}; ProcessRunner.ExecutionResult executionResult = ProcessRunner.run(command) .bufferOutput(true).workingDirectory(tmpDir.toFile()).runAndWait(); assertTrue(executionResult.getExitCode() != 0); assertTrue(executionResult.getBufferedStandardOutput().isEmpty()); assertEquals("fatal: Not a git repository (or any of the parent directories): .git", executionResult.getBufferedStandardError().get(0)); }
public static ExecutionBuilder run(String... command) { return new ExecutionBuilder(new ProcessBuilder().command(command)); }
ProcessRunner { public static ExecutionBuilder run(String... command) { return new ExecutionBuilder(new ProcessBuilder().command(command)); } }
ProcessRunner { public static ExecutionBuilder run(String... command) { return new ExecutionBuilder(new ProcessBuilder().command(command)); }  }
ProcessRunner { public static ExecutionBuilder run(String... command) { return new ExecutionBuilder(new ProcessBuilder().command(command)); }  static ExecutionBuilder run(String... command); }
ProcessRunner { public static ExecutionBuilder run(String... command) { return new ExecutionBuilder(new ProcessBuilder().command(command)); }  static ExecutionBuilder run(String... command);  }