davsclaus opened a new pull request, #3270:
URL: https://github.com/apache/camel-kamelets/pull/3270
Part of #3261: Citrus tests for the nine Search, Cache and NoSQL 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.
| Kamelet | How it is checked | Body after the Kamelet | `Content-Type` |
|---|---|---|---|
| `elasticsearch-index-sink` | Elasticsearch 9.1.0, security off. Sends with
an `indexId` header, and with an `indexName` header that differs from the
option. `/orders/_doc/order-1` read back over REST shows that the header wins,
as documented | `String`, the document id | none |
| `opensearch-index-sink` | The same against OpenSearch 3.9.0, security
plugin off | `String`, the document id | none |
| `solr-sink` | `solr:9.10.1-slim` with a precreated core and `autocommit`.
A `select` finds the document | `SimpleOrderedMap`, the Solr response | none |
| `solr-source` | Two documents seeded over REST; the query matches one |
`InputStreamCache`, JSON with `response` | `application/json` |
| `infinispan-sink` | Infinispan 16.3 with a cache created over REST. The
value is read back with a plain `infinispan:` GET | none, as documented | none |
| `infinispan-source` | A second route puts an entry. Checks the
`infinispan-event-type`, `-key`, `-cache-name` and `-entry-version` headers,
and their `ce-*` copies | none | none |
| `redis-source` | `redis:7.4.12-alpine`. A Groovy script publishes inside
`repeatOnError` until Redis reports one subscriber, so the message is delivered
exactly once | `String` | none |
| `couchbase-sink` | The same container as the existing `couchbase-source`
test. A query shows that the document is stored as a JSON document, not a JSON
string | `Boolean` `true`, as documented | none |
| `mongodb-changes-stream-source` | Citrus `mongodb`, a one-member replica
set. Insert, update and delete, one at a time: the whole document, the whole
document read again, and `{"_id":"order-1"}` | `InputStreamCache` |
`application/json` |
### Test classes
- New `SearchIT` runs `elasticsearch`, `opensearch` and `solr`, and new
`InfinispanIT` runs `infinispan`.
- `RedisIT`, `CouchbaseIT` and `MongoIT` each get their own HTTP server for
the new tests in their packages.
- Each server has its own name, as the Citrus context is shared across IT
classes in one JVM.
Where the body is null (Infinispan), `X-Body-Type` uses `iif`, so the header
is still sent.
### Findings, no Kamelet bugs
- **The disabled `redis-sink` test**
(`redis-sink-route.citrus.it.yaml.disabled`) reads
`${CITRUS_TESTCONTAINERS_REDIS_SERVICE_PORT}`. The generic containers of Citrus
5.2 only set `CITRUS_TESTCONTAINERS_<NAME>_HOST` and `_PORT`, which is a more
likely cause of its failures than the one in 82caead04. The new `redis-source`
test uses `_PORT` and passes. The disabled file is left as it is, for a
follow-up.
- **Sources give headers they do not document:**
- `solr-source`: `CamelSolrOperation`, `CamelSolrQueryString` and
`CamelSolrCollection`.
- `redis-source`: `CamelRedis.Pattern`, as bytes.
- `infinispan-source`: the raw `CamelInfinispan*` headers.
- **Couchbase ports:** the Couchbase tests, old and new, bind the host ports
8091, 8093 and 11210, so two Couchbase runs on one machine collide.
The images are served by `mirror.gcr.io`, which CI uses, or come from their
own registry (`docker.elastic.co`, `quay.io`).
### Tests
`SearchIT`, `InfinispanIT`, `RedisIT`, `CouchbaseIT` and `MongoIT`: 12 of 12
pass (9 new tests and 3 existing ones), in two runs. With wrong expected
values, the Elasticsearch read-back and the `solr-sink` type check fail, as
they should. `./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]