Skip to content

Add test coverage for Gmail DataType Transformers : update-message-labels and draft#8625

Open
JinyuChen97 wants to merge 1 commit intoapache:mainfrom
JinyuChen97:camel-quarkus-8531
Open

Add test coverage for Gmail DataType Transformers : update-message-labels and draft#8625
JinyuChen97 wants to merge 1 commit intoapache:mainfrom
JinyuChen97:camel-quarkus-8531

Conversation

@JinyuChen97
Copy link
Copy Markdown
Contributor

Add test coverage for Gmail DataType Transformers : update-message-labels and draft

  • google-mail:update-message-labels transformer: Tests automatic label name-to-ID resolution when updating message labels via exchange variables

  • google-mail:draft transformer: Tests draft creation and update using GoogleMailStreamConstants headers (MAIL_FROM, MAIL_TO, MAIL_SUBJECT, etc.)

  • Threading metadata support: Tests draft replies with proper threadId and Message-ID headers for email threading

All added tests pass with real google cloud environment in both JVM and native modes.

Generated with Claude Code on behalf of Jinyu Chen

fixes #8531

Comment on lines +50 to +53
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-direct</artifactId>
</dependency>
Copy link
Copy Markdown
Contributor

@jamesnetherton jamesnetherton May 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -deployment dependency needs adding into the virtualDependencies profile. You can run this from the project root to add it:

mvn process-resources -Pformat -N

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks done.

@JinyuChen97 JinyuChen97 force-pushed the camel-quarkus-8531 branch from 97c68bb to 7edec4c Compare May 6, 2026 13:30
@aldettinger
Copy link
Copy Markdown
Contributor

The pr implementation looks good, maybe a few questions about the intent.

Do we need that level of test verbosity ? For instance, what does those camel-quarkus tests bring compared to camel tests ?
Labels and drafts are documented functionalities, so we generally double camel tests in this situation.
However, is there an interest in doubling tests for each and every data type transformer ?
Maybe we need a kind of foundation test covering a single data type transformer and that's all ?
Any thoughts ?

@jamesnetherton
Copy link
Copy Markdown
Contributor

Do we need that level of test verbosity ? For instance, what does those camel-quarkus tests bring compared to camel tests ?

It's a good point. I'd say not, unless there's something about a feature that might cause it to behave differently in CQ. E.g different dependency versions, use of reflection or other stuff problematic for native mode.

Maybe we need a kind of foundation test covering a single data type transformer

We already have that.

Given the work is already done, I am ok merging this. It was actually a useful exercise because it's likely nobody has run any of the Google tests for 6+ years 🙈 (they are disabled without the relevant credentials being set).

Message response = producerTemplate.requestBodyAndHeaders("google-mail://messages/get", null, headers,
Message.class);
if (response != null && response.getPayload() != null && response.getPayload().getHeaders() != null) {
for (com.google.api.services.gmail.model.MessagePartHeader header : response.getPayload().getHeaders()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use imports in all cases and avoid FQCN references where possible.

…bels and draft

   - google-mail:update-message-labels transformer: Tests automatic label name-to-ID
     resolution when updating message labels via exchange variables

   - google-mail:draft transformer: Tests draft creation and update using
     GoogleMailStreamConstants headers (MAIL_FROM, MAIL_TO, MAIL_SUBJECT, etc.)

   - Threading metadata support: Tests draft replies with proper threadId and
     Message-ID headers for email threading

   All added tests pass in both JVM and native modes.

   Generated with Claude Code on behalf of Jinyu Chen

   fixes apache#8531
@aldettinger
Copy link
Copy Markdown
Contributor

Given the work is already done, I am ok merging this. It was actually a useful exercise because it's likely nobody has run any of the Google tests for 6+ years 🙈 (they are disabled without the relevant credentials being set).

Ok, that's fine to merge then. And it's always possible to clean up in another ticket anyway. Like we could keep the gmail tests and just remove the data type transformer part if make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Camel 4.19 add test coverage for Gmail DataType Transformers : update-message-labels and draft

3 participants