Skip to content

Commit c8ac94b

Browse files
committed
Polish contribution
Closes spring-projectsgh-8490
1 parent a6f0da8 commit c8ac94b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

spring-boot-test/src/main/java/org/springframework/boot/test/rule/OutputCapture.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2016 the original author or authors.
2+
* Copyright 2012-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -91,6 +91,9 @@ protected void releaseOutput() {
9191
this.copy = null;
9292
}
9393

94+
/**
95+
* Discard all currently accumulated output.
96+
*/
9497
public void reset() {
9598
this.copy.reset();
9699
}

spring-boot-test/src/test/java/org/springframework/boot/test/rule/OutputCaptureTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public class OutputCaptureTests {
3434
@Test
3535
public void toStringShouldReturnAllCapturedOutput() throws Exception {
3636
System.out.println("Hello World");
37-
3837
assertThat(this.outputCapture.toString()).contains("Hello World");
3938
}
4039

@@ -43,7 +42,6 @@ public void reset() throws Exception {
4342
System.out.println("Hello");
4443
this.outputCapture.reset();
4544
System.out.println("World");
46-
4745
assertThat(this.outputCapture.toString()).doesNotContain("Hello")
4846
.contains("World");
4947
}

0 commit comments

Comments
 (0)