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

   ## Summary
   
   Fixes three bugs in camel-fhir:
   
   - **`FhirOperation.onInstance()` wrongly called `onInstanceVersion()`**: the 
`onInstance` method was delegating to `onInstanceVersion()`, which includes the 
resource version in the URL. FHIR servers that do not support versioned 
operations reject these requests. Now correctly calls `onInstance()`.
   
   - **`FhirRead.resourceById()` treated `throwError=false` the same as 
`throwError=true`**: the condition checked `throwError != null` instead of 
`Boolean.TRUE.equals(throwError)`, so passing `false` still triggered 
`throwNotModifiedException()`.
   
   - **`FhirHelper.createClient()` mutated a user-supplied `FhirContext`**: 
when users provided their own `FhirContext`, the helper overwrote its 
`RestfulClientFactory` settings (timeouts, proxy, etc.) and performance 
options. Now creates a separate `ApacheRestfulClientFactory` so the shared 
context is not modified. Also fixes auth interceptor precedence: when both 
`username` and `accessToken` were set, both `BasicAuth` and `BearerToken` 
interceptors were registered; now `accessToken` takes precedence.
   
   ## Test plan
   
   - [x] `FhirOperationOnInstanceTest` — verifies `onInstance()` calls 
`onInstance()` (not `onInstanceVersion()`)
   - [x] `FhirReadThrowErrorTest` — verifies `throwError=false` does not throw, 
`throwError=true` does
   - [x] `FhirBugFixesTest` — verifies shared `FhirContext` is not mutated, and 
auth interceptor precedence
   - [x] Updated `FhirConfigurationIT` interceptor count (5 instead of 6, since 
basic+bearer are no longer both registered)
   - [x] All 7 new tests pass locally
   
   _Claude Code on behalf of Guillaume Nodet_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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