[ 
https://issues.apache.org/jira/browse/CAMEL-25149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18141106#comment-18141106
 ] 

Guillaume Nodet commented on CAMEL-25149:
-----------------------------------------

This issue is being investigated by a coding agent (on behalf of gnodet).

Analysis confirms no end-to-end PostgreSQL credential rotation test exists on 
main. The existing tests (JdbcComponentSecretRotationAwareTest, 
DataSourceHelperHikariIntegrationTest) use mocked DataSources or H2 in-memory, 
not real credential rotation against a live database. The camel-sql module 
already has the testcontainers PostgreSQL infrastructure 
(camel-test-infra-postgres) needed to implement this test.

A fix session has been dispatched to implement:
- JdbcCredentialRotationIT.java using PostgreSQL + HikariCP via Testcontainers
- SqlCredentialRotationIT.java for the SQL component
- Full flow: start pool with cred A, ALTER ROLE to cred B, trigger 
onSecretRotation(), verify new connections use cred B

_Note: This comment was generated by an AI coding agent and requires manual 
verification._

> 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
>            Assignee: Guillaume Nodet
>            Priority: Major
>
> 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
(v10.3.26#10030026)

Reply via email to