Skip to content

Add missing encode/duration test coverage for *LargerUnit seconds scenarios#9965

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/add-missing-tests-encode-duration
Closed

Add missing encode/duration test coverage for *LargerUnit seconds scenarios#9965
Copilot wants to merge 2 commits intomainfrom
copilot/add-missing-tests-encode-duration

Conversation

Copy link
Contributor

Copilot AI commented Mar 9, 2026

EncodeDurationTests.java was missing test calls for the int32SecondsLargerUnit and floatSecondsLargerUnit scenarios defined in the http-specs encode/duration spec, leaving 6 scenario paths untested.

Changes

  • testQuery() — adds int32SecondsLargerUnit(Duration.ofMinutes(2)) (expects input=120) and floatSecondsLargerUnit(Duration.ofMinutes(2).plusSeconds(30)) (expects input=150.0)
  • testHeader() — same two calls for header encoding (duration: 120, duration: 150.0)
  • testProperty() — adds round-trip assertions for Int32SecondsLargerUnitDurationProperty and FloatSecondsLargerUnitDurationProperty
  • Adds the two missing model imports (Int32SecondsLargerUnitDurationProperty, FloatSecondsLargerUnitDurationProperty)

The previously commented-out floatMilliseconds/float64Milliseconds cases are intentionally left as-is (known serialization issue: sends 35625.0 instead of 35625).


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…unit seconds scenarios

Co-authored-by: weidongxu-microsoft <53292327+weidongxu-microsoft@users.noreply.github.com>
Copilot AI changed the title [WIP] Add missing tests for encode duration functionality Add missing encode/duration test coverage for *LargerUnit seconds scenarios Mar 9, 2026
@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:java Issue for the Java client emitter: @typespec/http-client-java label Mar 9, 2026
@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@weidongxu-microsoft
Copy link
Contributor

require publish of the fix #9945

auto-merge was automatically disabled March 11, 2026 05:39

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:java Issue for the Java client emitter: @typespec/http-client-java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants