|
33 | 33 | import software.amazon.smithy.model.traits.TimestampFormatTrait;
|
34 | 34 | import software.amazon.smithy.model.traits.TimestampFormatTrait.Format;
|
35 | 35 | import software.amazon.smithy.model.traits.XmlNamespaceTrait;
|
| 36 | +import software.amazon.smithy.protocoltests.traits.HttpMessageTestCase; |
| 37 | +import software.amazon.smithy.typescript.codegen.HttpProtocolTestGenerator; |
| 38 | +import software.amazon.smithy.typescript.codegen.TypeScriptSettings; |
36 | 39 | import software.amazon.smithy.typescript.codegen.TypeScriptWriter;
|
37 | 40 | import software.amazon.smithy.typescript.codegen.integration.HttpProtocolGeneratorUtils;
|
| 41 | +import software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator; |
38 | 42 | import software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator.GenerationContext;
|
39 | 43 | import software.amazon.smithy.utils.SmithyInternalApi;
|
40 | 44 |
|
@@ -274,4 +278,21 @@ static String getInputTimestampValueProvider(
|
274 | 278 | TimestampFormatTrait.Format format = httpIndex.determineTimestampFormat(memberShape, DOCUMENT, defaultFormat);
|
275 | 279 | return HttpProtocolGeneratorUtils.getTimestampInputParam(context, inputLocation, memberShape, format);
|
276 | 280 | }
|
| 281 | + |
| 282 | + static void generateProtocolTests(ProtocolGenerator generator, GenerationContext context) { |
| 283 | + new HttpProtocolTestGenerator(context, generator, AwsProtocolUtils::filterProtocolTests).run(); |
| 284 | + } |
| 285 | + |
| 286 | + private static boolean filterProtocolTests( |
| 287 | + ServiceShape service, |
| 288 | + OperationShape operation, |
| 289 | + HttpMessageTestCase testCase, |
| 290 | + TypeScriptSettings settings |
| 291 | + ) { |
| 292 | + // TODO: Consume AWSQueryError trait as a follow-up. |
| 293 | + if (testCase.getId().equals("QueryCustomizedError")) { |
| 294 | + return true; |
| 295 | + } |
| 296 | + return false; |
| 297 | + } |
277 | 298 | }
|
0 commit comments