Skip to content

Commit 81818e0

Browse files
committed
refactor: supress some test output
1 parent acfe570 commit 81818e0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/test/java/RobotTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
22

3+
import java.io.OutputStream;
4+
import java.io.PrintStream;
35
import java.time.Duration;
46
import java.util.concurrent.ExecutorService;
57
import java.util.concurrent.Executors;
@@ -28,6 +30,11 @@ void test_Robot() {
2830
final Duration timeout = Duration.ofMillis(5000);
2931
final ExecutorService executor = Executors.newSingleThreadExecutor();
3032
final Future<?> future = executor.submit(() -> {
33+
final PrintStream nullstream = new PrintStream(new OutputStream() {
34+
public void write(int b) {}
35+
});
36+
System.setOut(nullstream);
37+
System.setErr(nullstream);
3138
robot.startCompetition();
3239
});
3340

0 commit comments

Comments
 (0)