Skip to content

test: cover typed Cookie factory value validation - #1675

Merged
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:test/typed-cookie-factory-validation
Nov 26, 2026
Merged

He-Pin merged 1 commit into
apache:mainfrom
He-Pin:test/typed-cookie-factory-validation

Conversation

@He-Pin

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

Copy link
Copy Markdown
Member

Motivation

The public Scala and Java request Cookie factories enforce the cookie-value grammar. The existing parsing tests do not directly cover both construction APIs.

Modification

Add local typed tests for Scala and Java factories. Each verifies that an ordinary value is retained and that a disallowed delimiter is rejected.

Result

The shared factory contract has direct coverage in both frontends. Production behavior is unchanged.

Tests

  • JDK 17 with Scala 2.13.18 and 3.3.9: two focused tests passed on each version after compiling the exact updated spec against existing main-equivalent supporting classes.
  • Scoped Scalafmt and git diff --check passed. No protocol traffic or full CI run before opening.

References

Motivation:
The request Cookie factories enforce the model grammar, but direct Scala and Java construction did not have matching test coverage.

Modification:
Add factory tests that accept a valid application value and reject a disallowed delimiter using the public model APIs.

Result:
Both frontends have direct checks for the shared Cookie contract. Production behavior is unchanged.

References:
RFC 6265 Sections 4.1.1 and 4.2.1; Netty 4.2 ClientCookieEncoderTest.

@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 4215ab4 into apache:main Nov 26, 2026
6 checks passed
@He-Pin
He-Pin deleted the test/typed-cookie-factory-validation branch November 26, 2026 21:36
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