Guillaume Nodet created CAMEL-25149:
---------------------------------------
Summary: camel-jdbc/camel-sql: add end-to-end credential rotation
integration test
Key: CAMEL-25149
URL: https://issues.apache.org/jira/browse/CAMEL-25149
Project: Camel
Issue Type: Test
Components: camel-jdbc, camel-sql
Reporter: Guillaume Nodet
Follow-up from PR #26845 (CAMEL-24638).
The current tests in CAMEL-24638 verify that pool eviction works correctly
using real HikariCP and Agroal pools against h2 (physical connection
replacement via {{unwrap(Connection.class)}} + {{assertNotSame}}). However,
there is no end-to-end test that actually rotates credentials and verifies the
full flow.
An integration test should:
# Start a pool with credential A (e.g. PostgreSQL via Testcontainers)
# Open and return connections to verify the pool works
# Change the database password to credential B via an admin connection
# Trigger Camel's context reload / secret rotation notification
# Acquire a new connection through a Camel route and verify it authenticates
with credential B
# Verify {{pg_backend_pid()}} differs from the original connections (proving
the pool opened a fresh connection)
This should be tested for both HikariCP and Agroal pools.
Note: this requires a Testcontainers-based setup with PostgreSQL, which adds CI
time. The current PR covers the reflection path and eviction behavior; this
ticket tracks the additional end-to-end validation.
See also:
[camel-quarkus#9252|https://github.com/apache/camel-quarkus/issues/9252] for
GraalVM native reflection registration of the reflection-based eviction classes.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)