When new spring-boot-starter-restclient used along with spring-boot-starter-test gives compilation error. If spring-boot-starter-test removed from the dependencies application works fine.
Sample with compilation error - https://github.com/anbusampath/2025-07-22-declarative-interface-clients-in-spring-boot-4
Sample without spring-boot-starter-test - https://github.com/anbusampath/2025-07-22-declarative-interface-clients-in-spring-boot-4/tree/without-spring-boot-starter-test
I guess exclusion from spring-boot-starter-test impacting the transtive dependency of spring-boot-starter-restclient.
Comment From: wilkinsona
Thanks for reporting this. https://github.com/spring-projects/spring-boot/commit/108ca64989d87a46e62b2de88acc1a9f3b9727f8 introduced the problem. That change was later refined in https://github.com/spring-projects/spring-boot/commit/1758f509bce9d4f5b32a9bd1c8428738cc1ae751. I'm not sure what we can do instead, but we'll have to do something.