davsclaus opened a new pull request, #3274:
URL: https://github.com/apache/camel-kamelets/pull/3274

   Part of #3261: Citrus tests for 21 Azure and Google Cloud Kamelets that had 
none. As in #3262, each route records the body type (`X-Body-Type`) and the 
`Content-Type` (`X-Content-Type`) the Kamelet gives, for #3117.
   
   ### Emulators
   | Service | Emulator | Kamelets |
   |---|---|---|
   | Pub/Sub, Cloud Storage, BigQuery | Floci GCP (`floci/floci-gcp:0.12.0`) | 
`google-pubsub-sink`, `google-pubsub-source`, `google-storage-sink`, 
`google-storage-source`, `google-storage-event-based-source`, 
`google-bigquery-sink` |
   | Blob, Queue, Data Lake | Floci Azure (`floci/floci-az:0.16.0`), and 
Azurite where needed | `azure-storage-blob-sink`, 
`azure-storage-blob-append-sink`, `azure-storage-blob-source`, 
`azure-storage-blob-event-based-source`, `azure-storage-queue-sink`, 
`azure-storage-queue-source`, `azure-storage-datalake-sink`, 
`azure-storage-datalake-source` |
   | Cosmos DB | Microsoft vNext emulator | `azure-cosmosdb-sink`, 
`azure-cosmosdb-source` |
   | Event Hubs | Microsoft Event Hubs emulator, with Azurite | 
`azure-eventhubs-sink`, `azure-eventhubs-source` |
   | Service Bus | Microsoft Service Bus emulator, with SQL Server | 
`azure-servicebus-sink`, `azure-servicebus-source` |
   | Functions | the Citrus HTTP server | `azure-functions-sink` |
   
   - **Clients:** small Java RouteBuilders under `resources/azure` and 
`resources/google`, given to `camel run` as resources, bind the SDK clients to 
the emulators.
   - **Multi-container emulators:** the Microsoft emulators that need a second 
container (Event Hubs, Service Bus) are started from Groovy with the 
Testcontainers API, on a private network, and stopped in `finally:`.
   - **Image size:** the Cosmos DB emulator and SQL Server are large (about 1.6 
and 1.7 GB), and `AzureIT` takes about 4.5 minutes.
   - **Mirror:** the Floci images are served by `mirror.gcr.io`. The Microsoft 
images come from `mcr.microsoft.com`, as the existing SQL Server images do.
   
   ### What the Kamelets give today
   None sets `Content-Type`, except `azure-cosmosdb-source` and 
`azure-functions-sink` (`application/json`).
   
   | Kamelet | Body after the Kamelet |
   |---|---|
   | `google-pubsub-source`, `azure-eventhubs-source`, 
`azure-servicebus-source`, `google-storage-event-based-source` | `byte[]` |
   | `google-storage-source`, `azure-storage-blob-source`, 
`azure-storage-blob-event-based-source`, `azure-storage-datalake-source`, 
`azure-cosmosdb-source` | `InputStreamCache` |
   | `azure-storage-queue-source` | `ByteArrayInputStreamCache` |
   | `azure-storage-blob-sink`, `-append-sink`, `azure-storage-queue-sink`, 
`azure-storage-datalake-sink` | `Boolean` `true` |
   | `google-storage-sink` | `Blob` |
   | `google-bigquery-sink` | a `List` of Maps |
   | `azure-cosmosdb-sink` | `LinkedHashMap` |
   | `google-pubsub-sink`, `azure-eventhubs-sink`, `azure-servicebus-sink` | 
`String`, unchanged |
   | `azure-functions-sink` | `byte[]`, the answer of the function |
   
   ### Not covered
   `azure-storage-files-sink` and `azure-storage-files-source`: no emulator 
serves Azure Files. Floci answers 501 for file shares, and Azurite has no Files 
service.
   
   ### Findings
   - **`azure-storage-datalake-source`** says the headers give the size, 
content type, ETag and last-modified time of the file. With the emulator, only 
`CamelAzureStorageDataLakeFileName` is set, and the component's consumer calls 
only `getFile`. This needs a check against real Azure before the description 
changes.
   - **`azure-cosmosdb-source`** says the JSON array comes "as bytes". It comes 
as a stream.
   - **`azure-storage-blob-event-based-source`** with `getBlob` does not set 
`CamelAzureStorageBlobBlobName` on the output.
   - **Emulator quirks, handled in the test code only:**
     - Floci leaves out a response header that the Azure SDK needs for Append 
Block.
     - Floci serves Data Lake only for the `{account}.dfs.core.windows.net` 
host.
   
   ### Tests
   `AzureIT` 15 of 15 and `GoogleCloudIT` 6 of 6 pass, in two runs. `./mvnw 
clean verify` from the root passes.
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 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