gnodet opened a new pull request, #29695:
URL: https://github.com/apache/camel/pull/29695

   ## Summary
   
   Adds two end-to-end integration test classes that verify the 
`onSecretRotation()` flow introduced in CAMEL-25149 for `JdbcComponent` and 
`SqlComponent`, against a real PostgreSQL container (via Testcontainers).
   
   ### `JdbcCredentialRotationIT`
   
   Two tests:
   - **`hikariCp_credentialRotation_newConnectionUsesNewPassword`** — creates a 
HikariCP pool with credential A, registers it in the Camel registry, routes 
`jdbc:rotationTestDs` to `direct:jdbc-query`, captures `pg_backend_pid()`, 
rotates the DB password to credential B via `ALTER ROLE`, updates 
`hikariDs.setPassword()`, calls `jdbcComponent.onSecretRotation()`, then 
asserts that the new PID differs (a fresh physical connection was opened).
   - **`agroal_credentialRotation_flushEvictsConnections`** — creates an Agroal 
pool, calls `onSecretRotation()`, then asserts that `metrics.flushCount()` 
increased (confirming `flush(GRACEFUL)` was called), and that the pool remains 
functional.
   
   ### `SqlCredentialRotationIT`
   
   Identical coverage for `SqlComponent`, routing via `sql:SELECT 
pg_backend_pid() AS pid?dataSource=#sqlRotationDs`.
   
   ### Dependencies added to `camel-jdbc`
   
   `camel-sql` already had these; added test-scope to `camel-jdbc`:
   - `com.zaxxer:HikariCP`
   - `io.agroal:agroal-api` / `agroal-pool`
   - `org.postgresql:postgresql`
   - `camel-test-infra-postgres`
   
   ## Test Results (local)
   
   ```
   Tests run: 2, Failures: 0, Errors: 0, Skipped: 0 — JdbcCredentialRotationIT
   Tests run: 2, Failures: 0, Errors: 0, Skipped: 0 — SqlCredentialRotationIT
   ```
   
   ---
   _Forgebot on behalf of gnodet_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to