Add resttemplate-to-restclient module: RestTemplate deprecation on Spring Framework 7.1 / Boot 4.2.0 vs 4.1.3, method mapping, exchange() trap, bridge URI encoding, RestTestClient, OpenRewrite recipe run, with real transcripts
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b7M7FEdeEm3APj16Bu
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
# 04-exchange-trap (Spring Boot 4.2.0, JDK 25)
|
||||
RestTemplate.exchange(GET /students/99) -> throws NotFound
|
||||
RestClient.get()...retrieve().body(...) -> throws NotFound
|
||||
RestClient.get()...exchange((req, res) -> res.bodyTo(Student.class))
|
||||
-> throws: nothing; returned Student[id=null, name=null]
|
||||
RestClient.get()...exchange(...) on GET /boom -> no exception; handler saw 500 INTERNAL_SERVER_ERROR {"timestamp":"<time>","status":500,"error":"Internal Server Error","path":"/boom"}
|
||||
exchange(...) with an explicit isError() check -> IllegalStateException: HTTP 404 for /students/99
|
||||
Reference in New Issue
Block a user