Created
September 23, 2021 14:03
-
-
Save samuelteixeiras/c604e97d79de46f92c1d6349dd6af164 to your computer and use it in GitHub Desktop.
WeekOneExercisesTest3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); | |
private final ByteArrayOutputStream errContent = new ByteArrayOutputStream(); | |
private final PrintStream originalOut = System.out; | |
private final PrintStream originalErr = System.err; | |
@Before | |
public void setUpStreams() { | |
System.setOut(new PrintStream(outContent)); | |
System.setErr(new PrintStream(errContent)); | |
} | |
@After | |
public void restoreStreams() { | |
System.setOut(originalOut); | |
System.setErr(originalErr); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment