davsclaus opened a new pull request, #3271:
URL: https://github.com/apache/camel-kamelets/pull/3271
Part of #3261: Citrus tests for 17 File, Mail, S3-compatible and GitHub
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. Where a Kamelet takes a password, the tests use `s3cr&t+pw`, which
`RAW()` must pass whole. Where it reads or writes a file, the name has a space.
| Kamelet | How it is checked | Body after the Kamelet |
|---|---|---|
| `file-watch-source` | `events: CREATE`, and `antInclude: *.csv` skips a
`.txt` | `java.io.File` |
| `ftp-source`, `ftps-source` | Apache FtpServer inside the test JVM, plain
and explicit TLS | `ByteArrayInputStreamCache` |
| `ftp-sink`, `ftps-sink` | `passiveMode` and `tempPrefix`; the `file`
header loses its directory; the file is read back | `String` |
| `sftp-source` | `knownHostsUri` with the host keys of the container |
`byte[]` |
| `sftp-sink`, `scp-sink` | `chmod: 640`, checked in the container |
`String` |
| `ssh-source`, `ssh-sink` | Exit code 3 does not fail the message; the
stderr header is a stream | `String` / `ByteArrayInputStreamCache` |
| `mail-imap-source` | GreenMail over IMAPS; an email already read is
skipped; the `ce-*` headers | `String`, `text/plain; charset=us-ascii` |
| `ceph-source`, `ceph-sink` | Floci S3 with `forcePathStyle`. A key with a
space, `+` and `=`; a `CamelAwsS3OverrideBucketName` header is ignored by the
sink | `byte[]` / `String` |
| `minio-source`, `minio-sink` | The S3 API of Floci | `byte[]` / `String` |
| `github-commit-source`, `github-event-source` | A stand-in for the GitHub
API inside the test JVM (`GitHubApiStub`), set with
`camel.component.github2.apiUrl`. It fails the test on any request it has no
answer for | `InputStreamCache`, `application/json` |
### Test classes and setup
- New `FileIT` (packages `filewatch`, `ftp`, `ssh`) and `CloudIT` (`ceph`,
`minio`, `github`). `MailIT` gets an HTTP server for the source test. Each HTTP
server has its own name.
- The itest pom gets the test dependency
`org.apache.ftpserver:ftpserver-core:1.2.1`, the version Camel's own FTP tests
use. Passive FTP in Docker needs the passive ports mapped to the same host
ports, which the generic Citrus container cannot do.
- The FTPS certificate is made at test time with `keytool`.
### Kamelet bugs found
1. **`ssh-source` puts `pollCommand` into the endpoint address without
`RAW()`.** `echo "... 1+1"` ran as `... 1 1`, and a `&` would split the
address. The test uses a command without these characters. I will fix it in a
separate PR.
2. **`github-pullrequest-source`, `github-pullrequest-comment-source` and
`github-tag-source` do `marshal: json` on the objects of the GitHub library.**
Jackson calls every getter, and some getters call the GitHub API themselves.
- In the tag test, `GHUser.getFollowers()` sent `GET
/users/jane/followers`.
- Against the real GitHub, each message makes extra requests, and any one
that fails fails the message.
- These three are not tested here. They need a fix first, for example
marshalling only the fields the description names.
`ms-exchange-online-imap-oauth-source` is not covered: it needs Microsoft
OAuth.
### Images
`linuxserver/openssh-server:version-10.3_p1-r2` and
`greenmail/standalone:2.1.8`, plus the existing Floci. `mirror.gcr.io` serves
GreenMail. For OpenSSH, the mirror rate-limited my check, and this run of CI
will show whether it serves that tag.
### Tests
`FileIT`, `MailIT` and `CloudIT`: 18 of 18 pass (17 new tests and the
existing `mail-sink` test), 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]