File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
codegen/smithy-aws-kotlin-codegen/src/test/kotlin/software/amazon/smithy/kotlin/codegen/aws/protocols Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 44 */
55package software.amazon.smithy.kotlin.codegen.aws.protocols
66
7+ import io.kotest.matchers.string.shouldNotContain
78import software.amazon.smithy.kotlin.codegen.test.*
89import kotlin.test.Test
910
@@ -145,4 +146,20 @@ class RpcV2CborTest {
145146 val serializeBody = serializer.lines(" override suspend fun serialize(context: ExecutionContext, input: PutFooStreamingRequest): HttpRequestBuilder {" , " }" )
146147 serializeBody.shouldContainOnlyOnceWithDiff(""" builder.headers.setMissing("Content-Type", "application/vnd.amazon.eventstream")""" )
147148 }
149+
150+ @Test
151+ fun testEventStreamInitialRequestDoesNotSerializeStreamMember () {
152+ val ctx = model.newTestContext(" CborExample" )
153+
154+ val generator = RpcV2Cbor ()
155+ generator.generateProtocolClient(ctx.generationCtx)
156+
157+ ctx.generationCtx.delegator.finalize()
158+ ctx.generationCtx.delegator.flushWriters()
159+
160+ val documentSerializer = ctx.manifest.expectFileString(" /src/main/kotlin/com/test/serde/PutFooStreamingRequestDocumentSerializer.kt" )
161+
162+ val serializeBody = documentSerializer.lines(" serializer.serializeStruct(OBJ_DESCRIPTOR) {" , " }" )
163+ serializeBody.shouldNotContain(" input.messages" ) // `messages` is the stream member and should not be serialized in the initial request
164+ }
148165}
You can’t perform that action at this time.
0 commit comments