This module is a runnable onboarding example. It demonstrates the core Riptide API through the Spring Boot starter path, with complete imports and a real test.
- Wiring an
Httpclient viariptide-spring-boot-starterand injecting it with@Qualifier - Routing a response on HTTP status series (
SUCCESSFUL,REDIRECTION) - Extracting the
Locationheader from a redirect response - Deserializing a JSON response body into a typed object
./mvnw test -pl riptide-example-basic -am| Class | Purpose |
|---|---|
BasicRoutingExample |
Main example class – shows the Http API surface |
BasicRoutingExampleTest |
JUnit 5 test – verifies redirect routing and body deserialization |
| Class | Purpose |
|---|---|
Http |
Entry point — call .get(), .post(), etc. to build requests |
Navigators |
Factory for navigators: series(), status(), contentType(), etc. |
Bindings |
Factory for route bindings: on(SUCCESSFUL), anySeries(), etc. |
| Artifact | Why |
|---|---|
riptide-spring-boot-starter |
Starter-based Http client wiring and auto-configuration |
spring-boot-starter-test |
Spring Boot test support for the runnable example |
okhttp3:mockwebserver |
Mock HTTP server for tests |
The test uses @SpringBootTest with RiptideAutoConfiguration and JacksonAutoConfiguration
imported explicitly. The base-url for the example client is supplied dynamically via
@DynamicPropertySource so it points to the local MockWebServer port chosen at runtime.
The Http bean is then injected with @Autowired @Qualifier("example").
A @Qualifier("example") HttpClientCustomizer bean disables automatic redirect following so
that 302 Found responses remain visible to the routing callback — this keeps the
Location header extraction example consistent with actual route behavior. In production you
would typically let the HTTP client follow redirects automatically, or handle them explicitly
in your routing tree if you need to inspect intermediate responses.