Improve documentation of when TestRestTemplate is auto-configured
Closes gh-6729
This commit is contained in:
parent
9e2dcbbe96
commit
5a1741e2e8
|
|
@ -5488,9 +5488,10 @@ public class MyTest {
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
If you are using the `@SpringBootTest` annotation, you can just inject a fully configured
|
If you are using the `@SpringBootTest` annotation with `WebEnvironment.RANDOM_PORT` or
|
||||||
`TestRestTemplate` and start using it. If necessary, additional customizations can be
|
`WebEnvironment.DEFINED_PORT`, you can just inject a fully configured `TestRestTemplate`
|
||||||
applied via the `RestTemplateBuilder` bean:
|
and start using it. If necessary, additional customizations can be applied via the
|
||||||
|
`RestTemplateBuilder` bean:
|
||||||
|
|
||||||
[source,java,indent=0]
|
[source,java,indent=0]
|
||||||
----
|
----
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,8 @@ import org.springframework.web.context.WebApplicationContext;
|
||||||
* {@link WebEnvironment#DEFINED_PORT defined} or {@link WebEnvironment#RANDOM_PORT
|
* {@link WebEnvironment#DEFINED_PORT defined} or {@link WebEnvironment#RANDOM_PORT
|
||||||
* random} port.</li>
|
* random} port.</li>
|
||||||
* <li>Registers a {@link org.springframework.boot.test.web.client.TestRestTemplate
|
* <li>Registers a {@link org.springframework.boot.test.web.client.TestRestTemplate
|
||||||
* TestRestTemplate} bean for use in web tests.</li>
|
* TestRestTemplate} bean for use in web tests that are using a fully running container
|
||||||
|
* </li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @author Phillip Webb
|
* @author Phillip Webb
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue