@@ -7,8 +7,11 @@ package software.amazon.smithy.rust.codegen.core.testutil
7
7
8
8
import software.amazon.smithy.model.Model
9
9
import software.amazon.smithy.rust.codegen.core.smithy.CodegenContext
10
+ import software.amazon.smithy.rust.codegen.core.smithy.protocols.AwsJson
11
+ import software.amazon.smithy.rust.codegen.core.smithy.protocols.AwsJsonVersion
10
12
import software.amazon.smithy.rust.codegen.core.smithy.protocols.Protocol
11
13
import software.amazon.smithy.rust.codegen.core.smithy.protocols.RestJson
14
+ import software.amazon.smithy.rust.codegen.core.smithy.protocols.RestXml
12
15
13
16
private fun fillInBaseModel (
14
17
protocolName : String ,
@@ -137,57 +140,57 @@ object EventStreamTestModels {
137
140
//
138
141
// awsJson1_1
139
142
//
140
- // TestCase(
141
- // protocolShapeId = "aws.protocols#awsJson1_1",
142
- // model = awsJson11(),
143
- // requestContentType = "application/x-amz-json-1.1",
144
- // responseContentType = "application/x-amz-json-1.1",
145
- // validTestStruct = """{"someString":"hello","someInt":5}""",
146
- // validMessageWithNoHeaderPayloadTraits = """{"someString":"hello","someInt":5}""",
147
- // validTestUnion = """{"Foo":"hello"}""",
148
- // validSomeError = """{"Message":"some error"}""",
149
- // validUnmodeledError = """{"Message":"unmodeled error"}""",
150
- // ) { AwsJson(it, AwsJsonVersion.Json11) },
143
+ TestCase (
144
+ protocolShapeId = " aws.protocols#awsJson1_1" ,
145
+ model = awsJson11(),
146
+ requestContentType = " application/x-amz-json-1.1" ,
147
+ responseContentType = " application/x-amz-json-1.1" ,
148
+ validTestStruct = """ {"someString":"hello","someInt":5}""" ,
149
+ validMessageWithNoHeaderPayloadTraits = """ {"someString":"hello","someInt":5}""" ,
150
+ validTestUnion = """ {"Foo":"hello"}""" ,
151
+ validSomeError = """ {"Message":"some error"}""" ,
152
+ validUnmodeledError = """ {"Message":"unmodeled error"}""" ,
153
+ ) { AwsJson (it, AwsJsonVersion .Json11 ) },
151
154
152
155
//
153
156
// restXml
154
157
//
155
- // TestCase(
156
- // protocolShapeId = "aws.protocols#restXml",
157
- // model = restXml(),
158
- // requestContentType = "application/xml",
159
- // responseContentType = "application/xml",
160
- // validTestStruct = """
161
- // <TestStruct>
162
- // <someString>hello</someString>
163
- // <someInt>5</someInt>
164
- // </TestStruct>
165
- // """.trimIndent(),
166
- // validMessageWithNoHeaderPayloadTraits = """
167
- // <MessageWithNoHeaderPayloadTraits>
168
- // <someString>hello</someString>
169
- // <someInt>5</someInt>
170
- // </MessageWithNoHeaderPayloadTraits>
171
- // """.trimIndent(),
172
- // validTestUnion = "<TestUnion><Foo>hello</Foo></TestUnion>",
173
- // validSomeError = """
174
- // <ErrorResponse>
175
- // <Error>
176
- // <Type>SomeError</Type>
177
- // <Code>SomeError</Code>
178
- // <Message>some error</Message>
179
- // </Error>
180
- // </ErrorResponse>
181
- // """.trimIndent(),
182
- // validUnmodeledError = """
183
- // <ErrorResponse>
184
- // <Error>
185
- // <Type>UnmodeledError</Type>
186
- // <Code>UnmodeledError</Code>
187
- // <Message>unmodeled error</Message>
188
- // </Error>
189
- // </ErrorResponse>
190
- // """.trimIndent(),
191
- // ) { RestXml(it) },
158
+ TestCase (
159
+ protocolShapeId = " aws.protocols#restXml" ,
160
+ model = restXml(),
161
+ requestContentType = " application/xml" ,
162
+ responseContentType = " application/xml" ,
163
+ validTestStruct = """
164
+ <TestStruct>
165
+ <someString>hello</someString>
166
+ <someInt>5</someInt>
167
+ </TestStruct>
168
+ """ .trimIndent(),
169
+ validMessageWithNoHeaderPayloadTraits = """
170
+ <MessageWithNoHeaderPayloadTraits>
171
+ <someString>hello</someString>
172
+ <someInt>5</someInt>
173
+ </MessageWithNoHeaderPayloadTraits>
174
+ """ .trimIndent(),
175
+ validTestUnion = " <TestUnion><Foo>hello</Foo></TestUnion>" ,
176
+ validSomeError = """
177
+ <ErrorResponse>
178
+ <Error>
179
+ <Type>SomeError</Type>
180
+ <Code>SomeError</Code>
181
+ <Message>some error</Message>
182
+ </Error>
183
+ </ErrorResponse>
184
+ """ .trimIndent(),
185
+ validUnmodeledError = """
186
+ <ErrorResponse>
187
+ <Error>
188
+ <Type>UnmodeledError</Type>
189
+ <Code>UnmodeledError</Code>
190
+ <Message>unmodeled error</Message>
191
+ </Error>
192
+ </ErrorResponse>
193
+ """ .trimIndent(),
194
+ ) { RestXml (it) },
192
195
)
193
196
}
0 commit comments