Polish "Fix syntax errors in docs"
Closes gh-17835
This commit is contained in:
@@ -7933,27 +7933,11 @@ for assertions, as follows:
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.springframework.boot.test.rule.OutputCapture;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class MyTest {
|
||||
|
||||
@Rule
|
||||
public OutputCapture capture = new OutputCapture();
|
||||
|
||||
@Test
|
||||
public void testName() throws Exception {
|
||||
System.out.println("Hello World!");
|
||||
assertThat(capture.toString(), containsString("World");
|
||||
}
|
||||
|
||||
}
|
||||
include::{test-examples}/test/rule/OutputCaptureTests.java[tag=test]
|
||||
----
|
||||
|
||||
|
||||
|
||||
[[boot-features-rest-templates-test-utility]]
|
||||
==== TestRestTemplate
|
||||
|
||||
|
||||
Reference in New Issue
Block a user