oscerd opened a new pull request, #29243:
URL: https://github.com/apache/camel/pull/29243
## Description
`CosmosDbDatabaseOperations.createContainer` adds the leading `/` to the
partition key path when it is missing, but used
the normalized path only when an indexing policy is set. Without one, it
passed the path as it was given to
`createContainerIfNotExists`. So the `createContainer` operation, and the
producer and the consumer that create their
container (`createContainerIfNotExists=true`), sent a path such as
`partition` instead of `/partition`, as with the
examples of the component documentation (`constant("partition")`).
It is a regression of CAMEL-19902 (4.1.0), which added the indexing policy:
before it, the normalized path was always
passed. Found while running the integration tests on Floci AZ (CAMEL-26616),
which keeps the path as given and then
refuses every item write (`400 Invalid input: JSON Pointer expression must
start with '/': "partition"`).
The fix passes the normalized path in both branches.
`CosmosDbDatabaseOperationsTest.testCreateContainer` only checked
the mocked response, which is why the regression went unnoticed: it now also
checks the path given to the SDK, and it
fails without the fix (`TooFewActualInvocations`: the call with `path`
passes `path`, not `/path`).
## Testing
- camel-azure-cosmosdb: 59 unit tests pass; `CosmosDbDatabaseOperationsTest`
fails with the fix reverted.
- Full reactor build.
_Claude Code on behalf of Andrea Cosentino_
🤖 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]