Skip to content

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

Open
atharvalade wants to merge 2 commits intoapache:masterfrom
atharvalade:java-tcp-tls-tests-examples
Open

feat(java): add TCP/TLS integration tests and examples#2823
atharvalade wants to merge 2 commits intoapache:masterfrom
atharvalade:java-tcp-tls-tests-examples

Conversation

@atharvalade
Copy link
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
Copy link
Contributor Author

atharvalade commented Feb 26, 2026

Resolved

Test TLS with CA cert, server cert, plain TCP failure, and message flow over TLS
@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
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
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.

Copy link
Member

@mmodzelewski mmodzelewski left a comment

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.

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

2 participants