diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/system/CapturedOutput.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/system/CapturedOutput.java index 166cb70e7b..22561e71d7 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/system/CapturedOutput.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/system/CapturedOutput.java @@ -18,9 +18,9 @@ package org.springframework.boot.test.system; /** * Provides access to {@link System#out System.out} and {@link System#err System.err} - * output that has been captured by the {@link OutputCaptureExtension}. Can be used to - * apply assertions either using AssertJ or standard JUnit assertions. For example: - *
+ * output that has been captured by the {@link OutputCaptureExtension} or
+ * {@link OutputCaptureRule}. Can be used to apply assertions either using AssertJ or
+ * standard JUnit assertions. For example:
* assertThat(output).contains("started"); // Checks all output
* assertThat(output.getErr()).contains("failed"); // Only checks System.err
* assertThat(output.getOut()).contains("ok"); // Only checks System.put
diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/system/OutputCaptureExtension.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/system/OutputCaptureExtension.java
index 4138c3908b..e1f508e528 100644
--- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/system/OutputCaptureExtension.java
+++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/system/OutputCaptureExtension.java
@@ -33,7 +33,7 @@ import org.junit.jupiter.api.extension.ParameterResolver;
* parameter resolution} for a {@link CapturedOutput} instance which can be used to assert
* that the correct output was written.
*
- * To use with {@link ExtendWith @ExtendWith}, inject the {@link CapturedOutput} as an
+ * To use, add {@link ExtendWith @ExtendWith} and inject the {@link CapturedOutput} as an
* argument to your test class constructor or test method:
*
*
diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/system/OutputCaptureRule.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/system/OutputCaptureRule.java
index 9dcb6698e3..4eccfebd27 100644
--- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/system/OutputCaptureRule.java
+++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/system/OutputCaptureRule.java
@@ -83,7 +83,7 @@ public class OutputCaptureRule implements TestRule, CapturedOutput {
/**
* Resets the current capture session, clearing its captured output.
- * @deprecated since 2.2 with no replacement
+ * @deprecated since 2.2.0 with no replacement
*/
@Deprecated
public void reset() {
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/system/CapturedOutput.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/system/CapturedOutput.java
index b3e4800c24..974bce786b 100644
--- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/system/CapturedOutput.java
+++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/system/CapturedOutput.java
@@ -17,20 +17,13 @@
package org.springframework.boot.testsupport.system;
/**
- * Provides access to {@link System#out System.out} and {@link System#err System.err}
- * output that has been capture by the {@link OutputCaptureExtension}. Can be used to
- * apply assertions either using AssertJ or standard JUnit assertions. For example:
- *
- * assertThat(output).contains("started"); // Checks all output
- * assertThat(output.getErr()).contains("failed"); // Only checks System.err
- * assertThat(output.getOut()).contains("ok"); // Only checks System.put
- *
+ * Internal test class providing access to {@link System#out System.out} and
+ * {@link System#err System.err} output that has been captured.
*
* @author Madhura Bhave
* @author Phillip Webb
* @author Andy Wilkinson
* @since 2.2.0
- * @see OutputCaptureExtension
*/
public interface CapturedOutput extends CharSequence {
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/system/OutputCapture.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/system/OutputCapture.java
index 2b52cde617..654a62e2cd 100644
--- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/system/OutputCapture.java
+++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/system/OutputCapture.java
@@ -35,8 +35,6 @@ import org.springframework.util.Assert;
* @author Madhura Bhave
* @author Phillip Webb
* @author Andy Wilkinson
- * @see OutputCaptureExtension
- * @see OutputCaptureRule
*/
class OutputCapture implements CapturedOutput {
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/system/OutputCaptureExtension.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/system/OutputCaptureExtension.java
index a85929b4e0..2eed7f73c2 100644
--- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/system/OutputCaptureExtension.java
+++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/system/OutputCaptureExtension.java
@@ -20,7 +20,6 @@ import org.junit.jupiter.api.extension.AfterAllCallback;
import org.junit.jupiter.api.extension.AfterEachCallback;
import org.junit.jupiter.api.extension.BeforeAllCallback;
import org.junit.jupiter.api.extension.BeforeEachCallback;
-import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.ParameterContext;
import org.junit.jupiter.api.extension.ParameterResolutionException;
@@ -28,31 +27,12 @@ import org.junit.jupiter.api.extension.ParameterResolver;
/**
* Internal JUnit 5 {@code @Extension} to capture {@link System#out System.out} and
- * {@link System#err System.err}. Can be used on a test class via
- * {@link ExtendWith @ExtendWith}. This extension provides {@link ParameterResolver
- * parameter resolution} for a {@link CapturedOutput} instance which can be used to assert
- * that the correct output was written.
- *
- * To use with {@link ExtendWith @ExtendWith}, inject the {@link CapturedOutput} as an
- * argument to your test class constructor or test method:
- *
- *
- * @ExtendWith(OutputCaptureExtension.class)
- * class MyTest {
- *
- * @Test
- * void test(CapturedOutput output) {
- * assertThat(output).contains("ok");
- * }
- *
- * }
- *
+ * {@link System#err System.err}.
*
* @author Madhura Bhave
* @author Phillip Webb
* @author Andy Wilkinson
* @since 2.2.0
- * @see CapturedOutput
*/
public class OutputCaptureExtension
implements BeforeAllCallback, AfterAllCallback, BeforeEachCallback, AfterEachCallback, ParameterResolver {