Files
spring-boot-demo/kotlin/docs/output/09-no-testresttemplate.txt
T

26 lines
1.2 KiB
Plaintext

Real, verified absence: Spring Boot 4.1.1's spring-boot-test module does not
ship org.springframework.boot.test.web.client.TestRestTemplate at all.
Resolved test-scope dependency tree (mvn dependency:tree), relevant slice:
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:4.1.1:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:4.1.1:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:4.1.1:test
...
[INFO] | +- org.springframework:spring-test:jar:7.0.9:test
Checked directly against the jar itself (not docs, not a blog post):
$ unzip -l spring-boot-test-4.1.1.jar | grep -i "resttemplate\|restclient\|webtestclient"
(no output -- none of those classes are in the jar)
Confirmed via javac/kotlinc failing to resolve it: a first draft of
BookControllerTest.kt that imported
org.springframework.boot.test.web.client.TestRestTemplate failed to compile with
"Unresolved reference 'TestRestTemplate'" and "Unresolved reference
'getForEntity'" -- not a missing dependency, a genuinely absent class.
This repository's tests use plain java.net.http.HttpClient against
@LocalServerPort instead. The direct replacement in Spring Framework 7 is
RestTestClient, covered in its own post.