Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: internal
packages:
- "@typespec/http-client-java"
---

Add missing tests for `int32SecondsLargerUnit` and `floatSecondsLargerUnit` encode/duration scenarios (query, header, and property).
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
import encode.duration.property.models.FloatMillisecondsLargerUnitDurationProperty;
import encode.duration.property.models.FloatSecondsDurationArrayProperty;
import encode.duration.property.models.FloatSecondsDurationProperty;
import encode.duration.property.models.FloatSecondsLargerUnitDurationProperty;
import encode.duration.property.models.ISO8601DurationProperty;
import encode.duration.property.models.Int32MillisecondsDurationProperty;
import encode.duration.property.models.Int32MillisecondsLargerUnitDurationProperty;
import encode.duration.property.models.Int32SecondsDurationProperty;
import encode.duration.property.models.Int32SecondsLargerUnitDurationProperty;
import java.time.Duration;
import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -43,6 +45,10 @@ public void testQuery() {

queryClient.int32Seconds(SECOND36);

queryClient.int32SecondsLargerUnit(Duration.ofMinutes(2));

queryClient.floatSecondsLargerUnit(Duration.ofMinutes(2).plusSeconds(30));

queryClient.iso8601(DAY40);

queryClient.int32SecondsArray(Arrays.asList(SECOND36, Duration.ofSeconds(47)));
Expand Down Expand Up @@ -71,6 +77,10 @@ public void testHeader() {

headerClient.int32Seconds(SECOND36);

headerClient.int32SecondsLargerUnit(Duration.ofMinutes(2));

headerClient.floatSecondsLargerUnit(Duration.ofMinutes(2).plusSeconds(30));

headerClient.iso8601(DAY40);

headerClient.iso8601Array(Arrays.asList(DAY40, Duration.ofDays(50)));
Expand Down Expand Up @@ -102,6 +112,16 @@ public void testProperty() {
Assertions.assertEquals(SECOND36,
propertyClient.int32Seconds(new Int32SecondsDurationProperty(SECOND36)).getValue());

Assertions.assertEquals(Duration.ofMinutes(2),
propertyClient.int32SecondsLargerUnit(new Int32SecondsLargerUnitDurationProperty(Duration.ofMinutes(2)))
.getValue());

Assertions.assertEquals(Duration.ofMinutes(2).plusSeconds(30),
propertyClient
.floatSecondsLargerUnit(
new FloatSecondsLargerUnitDurationProperty(Duration.ofMinutes(2).plusSeconds(30)))
.getValue());

propertyClient.iso8601(new ISO8601DurationProperty(DAY40));

List<Duration> array = Arrays.asList(SECOND35, Duration.ofSeconds(46, 750_000_000));
Expand Down
Loading