Skip to content

Commit

Permalink
Suppress echoing to console in the ProcessManagerTest
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Pinčuk <alexander.v.pinchuk@gmail.com>
  • Loading branch information
avpinchuk committed Jun 13, 2023
1 parent c805d45 commit 6e515a8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ private List<String> hugeInput() {
@DisabledOnOs(WINDOWS)
void testCommandExecution() {
ProcessManager pm = new ProcessManager("sh", "-c", "echo hello; sleep 1");
pm.setEcho(false);
int exitCode = assertDoesNotThrow(pm::execute);
assertAll(
() -> assertEquals(0, exitCode),
Expand All @@ -102,6 +103,7 @@ void testCommandExecution() {
void testSetEnvironment() {
String value = String.valueOf(System.currentTimeMillis());
ProcessManager pm = new ProcessManager("sh", "-c", "echo ${PM_TEST_ENV_VAR}; sleep 1");
pm.setEcho(false);
pm.setEnvironment("PM_TEST_ENV_VAR", value);
int exitCode = assertDoesNotThrow(pm::execute);
assertAll(
Expand All @@ -117,6 +119,7 @@ void testSetStdinLines() {
List<String> inputLines = Arrays.asList("line1", "line2", "line3");
String expectedOutput = String.join("\n", inputLines) + "\n";
ProcessManager pm = new ProcessManager("cat");
pm.setEcho(false);
pm.setStdinLines(inputLines);
int exitCode = assertDoesNotThrow(pm::execute);
assertAll(
Expand Down

0 comments on commit 6e515a8

Please sign in to comment.