Skip to content

feat(java): add TCP/TLS integration tests and examples#2823

Merged
mmodzelewski merged 2 commits into
apache:masterfrom
atharvalade:java-tcp-tls-tests-examples
Mar 10, 2026
Merged

feat(java): add TCP/TLS integration tests and examples#2823
mmodzelewski merged 2 commits into
apache:masterfrom
atharvalade:java-tcp-tls-tests-examples

Conversation

@atharvalade

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #2805

Rationale

The Java SDK had TLS builder methods but no integration tests connecting to a TLS server and no TLS examples.

What changed?

Existing tests only verified TLS builder method chaining but never actually connected to a TLS server.

Added TlsConnectionTest integration test using Testcontainers with TLS certificates mounted from core/certs/. Tests cover: TLS connection with CA cert, TLS connection with server cert, plain TCP failure when TLS is required, and full send/receive message flow over TLS. Added TcpTlsProducer and TcpTlsConsumer examples using IggyTcpClient.builder().enableTls().tlsCertificate(...).

Local Execution

Passed. spotlessCheck and compileJava/compileTestJava clean in both examples/java and foreign/java.

AI Usage

  1. Opus 4.6
  2. guided by existing GettingStarted examples, BaseIntegrationTest, and C# TLS test patterns
  3. Compiled and linted locally, verified code follows existing patterns exactly
  4. Yes

@atharvalade

atharvalade commented Feb 26, 2026

Copy link
Copy Markdown
Contributor Author

Resolved

@atharvalade atharvalade force-pushed the java-tcp-tls-tests-examples branch from 16e9f5c to 27f9165 Compare February 26, 2026 17:37
@atharvalade atharvalade changed the title Add TCP/TLS integration tests and examples for Java SDK feat(java): add TCP/TLS integration tests and examples Feb 26, 2026
@atharvalade atharvalade force-pushed the java-tcp-tls-tests-examples branch from b3d1b55 to 35ce2c5 Compare February 26, 2026 18:11
@mmodzelewski

Copy link
Copy Markdown
Member

WIP

It's best if you mark WIP PRs as drafts — that way it's clearly visible from the list that they're not pending maintainer action.

@atharvalade

Copy link
Copy Markdown
Contributor Author

WIP

It's best if you mark WIP PRs as drafts — that way it's clearly visible from the list that they're not pending maintainer action.

Will keep that in mind. Though these issues aren't WIP anymore. I'll update the comments.

@mmodzelewski mmodzelewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Cheers @atharvalade. I'll have a proper look at this later. Just a quick note - could you include these examples in the README? They're picked up by the run-java-examples-from-readme.sh script in the CI. Unless they're actually executed as part of the build, they’ll likely become outdated quite fast.

@github-actions

github-actions Bot commented Mar 6, 2026

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs.

If you need a review, please ensure CI is green and the PR is rebased on the latest master. Don't hesitate to ping the maintainers - either @core on Discord or by mentioning them directly here on the PR.

Thank you for your contribution!

@github-actions github-actions Bot added the S-stale Inactive issue or pull request label Mar 6, 2026
@codecov

codecov Bot commented Mar 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.07%. Comparing base (5d3b793) to head (40c0425).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2823      +/-   ##
============================================
- Coverage     70.11%   70.07%   -0.04%     
  Complexity      776      776              
============================================
  Files          1028     1028              
  Lines         85279    85279              
  Branches      62654    62665      +11     
============================================
- Hits          59792    59758      -34     
- Misses        22963    22984      +21     
- Partials       2524     2537      +13     
Flag Coverage Δ
csharp 67.45% <ø> (-0.17%) ⬇️
go 36.37% <ø> (ø)
java 56.26% <ø> (ø)
node 91.37% <ø> (-0.07%) ⬇️
python 81.43% <ø> (ø)
rust 70.64% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 14 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot removed the S-stale Inactive issue or pull request label Mar 8, 2026
@atharvalade

Copy link
Copy Markdown
Contributor Author

Cheers @atharvalade. I'll have a proper look at this later. Just a quick note - could you include these examples in the README? They're picked up by the run-java-examples-from-readme.sh script in the CI. Unless they're actually executed as part of the build, they’ll likely become outdated quite fast.

@mmodzelewski added!

@atharvalade atharvalade requested a review from mmodzelewski March 8, 2026 09:17
Comment thread .github/actions/java-gradle/pre-merge/action.yml Outdated
@atharvalade atharvalade force-pushed the java-tcp-tls-tests-examples branch 2 times, most recently from 5a55b5d to f739cc5 Compare March 10, 2026 14:42
@atharvalade atharvalade force-pushed the java-tcp-tls-tests-examples branch from f739cc5 to ccb8a27 Compare March 10, 2026 15:08
@mmodzelewski mmodzelewski merged commit c151006 into apache:master Mar 10, 2026
61 checks passed
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.

Java SDK: Add TCP/TLS integration tests and examples

3 participants