diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/system/OutputCaptureRuleTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/system/OutputCaptureRuleTests.java index 616324fa6e..3c1ec217fd 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/system/OutputCaptureRuleTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/system/OutputCaptureRuleTests.java @@ -41,7 +41,6 @@ public class OutputCaptureRuleTests { public void getAllShouldReturnAllCapturedOutput() { System.out.println("Hello World"); System.err.println("Hello Error"); - assertThat(this.output.getAll()).contains("Hello World", "Hello Error"); } @@ -49,23 +48,22 @@ public class OutputCaptureRuleTests { public void getOutShouldOnlyReturnOutputCapturedFromSystemOut() { System.out.println("Hello World"); System.err.println("Hello Error"); - assertThat(this.output.getOut()).contains("Hello World"); assertThat(this.output.getOut()).doesNotContain("Hello Error"); } + @Test + public void getErrShouldOnlyReturnOutputCapturedFromSystemErr() { + System.out.println("Hello World"); + System.err.println("Hello Error"); + assertThat(this.output.getErr()).contains("Hello Error"); + assertThat(this.output.getErr()).doesNotContain("Hello World"); + } + @Test public void captureShouldBeAssertable() { System.out.println("Hello World"); assertThat(this.output).contains("Hello World"); } - @Test - public void getErrShouldOnlyReturnOutputCapturedFromSystemErr() { - System.out.println("Hello World"); - System.err.println("Hello Error"); - - assertThat(this.output.getErr()).contains("Hello Error"); - assertThat(this.output.getErr()).doesNotContain("Hello World"); - } }