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

   Part of #3261: Citrus tests for the 12 Messaging Kamelets that had none. 
Each test starts its own broker with the generic `testcontainers: start: 
container:`. As in #3262, each route records the body type (`X-Body-Type`) and 
the `Content-Type` (`X-Content-Type`) that the Kamelet gives, for #3117.
   
   | Broker (image) | Kamelets |
   |---|---|
   | Artemis (`apache/activemq-artemis:2.44.0`), core and AMQP on 61616 | 
`jms-apache-artemis-source`, `jms-apache-artemis-sink`, `jms-amqp-10-source`, 
`jms-amqp-10-sink` |
   | IBM MQ (`icr.io/ibm-messaging/mq:10.0.1.0-r1`), `DEV.QUEUE.1` on 
`DEV.APP.SVRCONN` | `jms-ibm-mq-source`, `jms-ibm-mq-sink` |
   | RabbitMQ (`rabbitmq:4.3.6`), user `citrus` (`guest` only works from 
loopback) | `spring-rabbitmq-source`, `spring-rabbitmq-sink` |
   | Pulsar (`apachepulsar/pulsar:5.0.1`, standalone) | `pulsar-source`, 
`pulsar-sink` |
   | SMPPSim (`jookies/smppsim`) | `smpp-source`, `smpp-sink` |
   
   ### How the tests check
   - **Sources:** a helper route sends one message through the matching sink 
Kamelet. The source route posts what it gives to the Citrus HTTP server. The 
test checks the body, a custom header that went through the broker, and the 
headers the Kamelet documents: `JMSDestination` and `JMSPriority`; the RabbitMQ 
exchange, routing key and content type; the Pulsar `topic_name`, `key`, 
`properties` and `message_id`; the SMPP source and destination addresses.
   - **Sinks:** the body after the sink is checked to be unchanged. A second 
route reads the message back with the matching source and logs it, and the test 
checks that line. The JMS sinks are also checked for their documented defaults: 
priority 4, persistent.
   - **SMPP:** SMPPSim takes one SMPP connection at a time, so each SMPP test 
starts its own. The source test waits until the Kamelet is connected, then 
sends an SMS from a phone through SMPPSim's web form. The sink test reads the 
`submit_sm` from SMPPSim's log, retrying with `repeatOnError`, without 
`Thread.sleep`.
   - `Camel*` headers do not reach the HTTP server, so the routes copy the ones 
being checked into `X-*` headers.
   
   ### What the Kamelets give today
   - All sources give a `String` body, except `pulsar-source`, which gives 
`byte[]`, as its description says. None sets `Content-Type`.
   - The sinks leave the body unchanged. They do add `Camel*` headers, which 
their "the message is unchanged" does not mention: 
`CamelJMSDestinationProduced` on the JMS sinks, `CamelPulsarProducerMessageId` 
on `pulsar-sink`.
   - No Kamelet failed or behaved against its description.
   
   The IBM MQ and SMPPSim images are amd64 only. They ran under emulation on an 
arm64 Mac.
   
   ### Tests
   `MessagingIT` (new, with its own HTTP server, which waits up to 120 s for 
broker start-up): 12 of 12 pass, in two runs in a row. `./mvnw clean install` 
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