Skip to content

refactor: modernize Java test code with Java 17 features#1076

Merged
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:refactor/java17-modernization-test-examples
Jun 18, 2026
Merged

refactor: modernize Java test code with Java 17 features#1076
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:refactor/java17-modernization-test-examples

Conversation

@He-Pin

@He-Pin He-Pin commented Jun 18, 2026

Copy link
Copy Markdown
Member

Motivation

Java 17 introduced records and text blocks that make Java code more concise and readable.

Modification

  • Convert SomeData to a record in both Jackson and Jackson3 test modules
  • Convert Bid, GetBids, Bids to records in HttpServerActorInteractionExample
  • Use text blocks for multi-line config strings in Jackson tests
  • Update field accesses to use record accessor methods

Result

Test Java code is more concise and idiomatic for Java 17+, reducing boilerplate.

Tests

  • sbt "http-marshallers-java/http-jackson / Test / compile" (to be verified by CI)
  • sbt "http-marshallers-java/http-jackson3 / Test / compile" (to be verified by CI)
  • sbt "docs / Test / compile" (to be verified by CI)

References

None - code modernization

Motivation:
Java 17 introduced records and text blocks that make Java code more
concise and readable.

Modification:
- Convert SomeData to a record in both Jackson and Jackson3 test modules
- Convert Bid, GetBids, Bids to records in HttpServerActorInteractionExample
- Use text blocks for multi-line config strings in Jackson tests
- Update field accesses to use record accessor methods

Result:
Test Java code is more concise and idiomatic for Java 17+.

Tests:
sbt "http-marshallers-java/http-jackson / Test / compile"
sbt "http-marshallers-java/http-jackson3 / Test / compile"
sbt "docs / Test / compile"

References:
None - code modernization

@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 fcb487e into apache:main Jun 18, 2026
5 checks passed
@He-Pin He-Pin deleted the refactor/java17-modernization-test-examples branch June 18, 2026 21:52
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