Skip to content

test: cover fail-fast relative WebSocket dialing URIs - #1660

Merged
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:test/ws-relative-dialer-guard
Nov 26, 2026
Merged

He-Pin merged 1 commit into
apache:mainfrom
He-Pin:test/ws-relative-dialer-guard

Conversation

@He-Pin

@He-Pin He-Pin commented Nov 26, 2026

Copy link
Copy Markdown
Member

Motivation

The public Scala and Java WebSocket dialers require an absolute URI. The API tests did not directly cover rejection of a relative endpoint.

Modification

Call the public client-flow constructor in each DSL with an ordinary relative path. Check the synchronous argument error and its absolute-URI diagnostic without materializing a flow or opening a network connection.

Result

Protects the existing public API contract. No production change; the caller-managed WebSocket layer is unchanged.

Tests

  • JDK 17: both focused tests passed on Scala 2.13.18 and 3.3.9.
  • Scoped test formatting, license headers and whitespace checks passed.

References

Informed by Netty 4.2's local WebSocket setup tests. No source or wire fixture was copied.

Motivation:
The public WebSocket dialer requires an absolute URI, but its existing
synchronous failure for a relative endpoint was not covered directly.

Modification:
Exercise the public Scala and Java client flow constructors with a
relative URI. Check the URI diagnostic without materializing a flow.

Result:
Pin the existing local API contract without making a network
connection or changing the lower-level WebSocket layer.

Tests:
- JDK 17, Scala 2.13.18 and 3.3.9: both focused checks passed on each.
- Scoped test formatting, license headers, and git diff --check passed.

References:
None - Informed by Netty 4.2's local WebSocket client setup tests.

@pjfanning pjfanning 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.

lgtm

@He-Pin
He-Pin merged commit f7a4859 into apache:main Nov 26, 2026
6 checks passed
@He-Pin
He-Pin deleted the test/ws-relative-dialer-guard branch November 26, 2026 11:34
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.

2 participants