Add custom-validation, etag-caching, restclient-basic-auth: Boot 4.1 API pass

Three companion modules verifying and rewriting the Boot 4.1.1 / Framework
7.0.9 story for three older articles: the javax->jakarta.validation namespace
fix plus Jakarta Validation 3.1 record-validation clarification, ETag/
conditional-request APIs re-verified unchanged plus the starter rename, and
RestTemplate Basic Auth rebuilt on RestClient with the exchange() trap called
out. 19 real passing tests generate every transcript quoted from the three
companion articles.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EQNA6DJ9VgCtW6zhCE8Xud
This commit is contained in:
Claude
2026-09-19 10:17:09 +00:00
parent 03bdf7ee87
commit e4b5636f7c
75 changed files with 2374 additions and 0 deletions
@@ -0,0 +1,5 @@
// RestClient.Builder builder = ...;
// RestClient client = builder.defaultHeaders(h -> h.setBasicAuth("admin", "password123")).build();
// client.get().uri(baseUrl + "/api/hello").retrieve().body(String.class);
Response: Hello, you have accessed a secured endpoint!
@@ -0,0 +1,6 @@
// RestClient.Builder builder = ...;
// RestClient client = builder.requestInterceptor(
// new BasicAuthenticationInterceptor("admin", "password123")).build();
// client.get().uri(baseUrl + "/api/hello").retrieve().body(String.class);
Response: Hello, you have accessed a secured endpoint!
@@ -0,0 +1,8 @@
// RestClient client = builder.build(); // no basic auth
// client.get().uri(baseUrl + "/api/hello").retrieve().body(String.class);
Thrown: org.springframework.web.client.HttpClientErrorException$Unauthorized
Status: 401 UNAUTHORIZED
# retrieve() throws HttpClientErrorException on 4xx by default -- same default as
# RestTemplate, unlike RestClient's own exchange() method, which disables that default.
@@ -0,0 +1,2 @@
Thrown: org.springframework.web.client.HttpClientErrorException$Unauthorized
Status: 401 UNAUTHORIZED