feat(java): add TCP/TLS integration tests and examples#2823
feat(java): add TCP/TLS integration tests and examples#2823atharvalade wants to merge 7 commits intoapache:masterfrom
Conversation
|
Resolved |
Test TLS with CA cert, server cert, plain TCP failure, and message flow over TLS
16e9f5c to
27f9165
Compare
b3d1b55 to
35ce2c5
Compare
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
left a comment
There was a problem hiding this comment.
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.
|
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! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2823 +/- ##
============================================
+ Coverage 71.44% 71.89% +0.44%
- Complexity 708 739 +31
============================================
Files 969 988 +19
Lines 78219 80173 +1954
Branches 60029 61308 +1279
============================================
+ Hits 55884 57638 +1754
- Misses 20002 20170 +168
- Partials 2333 2365 +32
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
…ests - Use log-based wait strategy instead of port probe (TLS server rejects raw TCP health checks) - Fix connectWithoutTls test: run in executor with timeout since blocking client hangs on responses.take() - Fix sendAndReceiveOverTls test: use partition ID 0 (topic has 1 partition, IDs are 0-indexed)
@mmodzelewski added! |
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
TlsConnectionTestintegration test using Testcontainers with TLS certificates mounted fromcore/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. AddedTcpTlsProducerandTcpTlsConsumerexamples usingIggyTcpClient.builder().enableTls().tlsCertificate(...).Local Execution
Passed.
spotlessCheckandcompileJava/compileTestJavaclean in bothexamples/javaandforeign/java.AI Usage
GettingStartedexamples,BaseIntegrationTest, and C# TLS test patterns