This is a collection of examples using the new RestClient
in Spring Framework 6.1 & Spring Boot 3.2.
These are the topics that I would like to cover in this series:
RestClient
Instance (org.springframework.web.client) ✅
@RestClientTest
✅The RestClient
uses an underlying Http Client to make calls over HTTP. If you want to read more about this you can check
out the Spring Documentation. The
following video is a walkthrough of how to do that. The code for this is located in /src/main/resources/dev/danvega/rc/client/JdkClient.java
You can test your RestClient
code using the @RestClientTest
annotation.
Note
If you run into an issue writing tests with @RestClientTest
and you're using the JDK Http Client you might be running
into this https://github.com/spring-projects/spring-boot/issues/38832