File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed
tests/codegen/event-stream/src/test
kotlin/aws/sdk/kotlin/tests/codegen/eventstream Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ atomicfu-version = "0.29.0"
1212binary-compatibility-validator-version = " 0.18.0"
1313
1414# smithy-kotlin codegen and runtime are versioned separately
15- smithy-kotlin-runtime-version = " 1.5.15 "
16- smithy-kotlin-codegen-version = " 0.35.15 "
15+ smithy-kotlin-runtime-version = " 1.5.16 "
16+ smithy-kotlin-codegen-version = " 0.35.16 "
1717
1818# codegen
1919smithy-version = " 1.62.0"
Original file line number Diff line number Diff line change @@ -188,6 +188,8 @@ class HttpEventStreamTests {
188188 long = 9_000_000_000L
189189 string = " a tay is a hammer"
190190 timestamp = Instant .fromEpochSeconds(5 )
191+ enum = aws.sdk.kotlin.test.restjson1.model.Enum .fromValue(" DIAMOND" )
192+ intEnum = IntEnum .fromValue(1 )
191193 },
192194 )
193195
@@ -204,6 +206,8 @@ class HttpEventStreamTests {
204206 assertEquals(9_000_000_000L , headers[" long" ]?.expectInt64())
205207 assertEquals(" a tay is a hammer" , headers[" string" ]?.expectString())
206208 assertEquals(Instant .fromEpochSeconds(5 ), headers[" timestamp" ]?.expectTimestamp())
209+ assertEquals(aws.sdk.kotlin.test.restjson1.model.Enum .fromValue(" DIAMOND" ).value, headers[" enum" ]?.expectString())
210+ assertEquals(IntEnum .fromValue(1 ).value, headers[" intEnum" ]?.expectInt32())
207211
208212 val deserialized = deserializedEvent(message)
209213 assertIs<TestStream .MessageWithHeaders >(deserialized)
Original file line number Diff line number Diff line change 1+ $ version : " 2"
2+
13namespace aws.sdk.kotlin.test
24
35use aws.protocols#restJson1
@@ -54,6 +56,8 @@ structure MessageWithHeaders {
5456 @eventHeader short : Short ,
5557 @eventHeader string : String ,
5658 @eventHeader timestamp : Timestamp ,
59+ @eventHeader enum : Enum ,
60+ @eventHeader intEnum : IntEnum ,
5761}
5862structure MessageWithHeaderAndPayload {
5963 @eventHeader header : String ,
@@ -81,3 +85,18 @@ union TestStream {
8185 MessageWithUnboundPayloadTraits : MessageWithUnboundPayloadTraits ,
8286 SomeError : SomeError ,
8387}
88+
89+ enum Enum {
90+ DIAMOND
91+ CLUB
92+ HEART
93+ SPADE
94+ }
95+
96+ intEnum IntEnum {
97+ JACK = 1
98+ QUEEN = 2
99+ KING = 3
100+ ACE = 4
101+ JOKER = 5
102+ }
You can’t perform that action at this time.
0 commit comments