Skip to content

Commit a42ae13

Browse files
committed
Reset outputstream in unit test docs.
1 parent e7de05c commit a42ae13

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

docs/core/metrics.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,16 +589,17 @@ class MetricsTestExample {
589589
Context lambdaContext;
590590

591591
private final PrintStream standardOut = System.out;
592-
private final ByteArrayOutputStream outputStreamCaptor = new ByteArrayOutputStream();
592+
private ByteArrayOutputStream outputStreamCaptor;
593593
private final ObjectMapper objectMapper = new ObjectMapper();
594594

595595
@BeforeEach
596596
void setUp() {
597+
outputStreamCaptor = new ByteArrayOutputStream();
597598
System.setOut(new PrintStream(outputStreamCaptor));
598599
}
599600

600601
@AfterEach
601-
void tearDown() {
602+
void tearDown() throws Exception {
602603
System.setOut(standardOut);
603604
}
604605

0 commit comments

Comments
 (0)