|
52 | 52 | import software.amazon.smithy.model.traits.HttpPrefixHeadersTrait;
|
53 | 53 | import software.amazon.smithy.model.traits.IdempotencyTokenTrait;
|
54 | 54 | import software.amazon.smithy.model.traits.StreamingTrait;
|
| 55 | +import software.amazon.smithy.protocoltests.traits.AppliesTo; |
55 | 56 | import software.amazon.smithy.protocoltests.traits.HttpMessageTestCase;
|
56 | 57 | import software.amazon.smithy.protocoltests.traits.HttpRequestTestCase;
|
57 | 58 | import software.amazon.smithy.protocoltests.traits.HttpRequestTestsTrait;
|
@@ -118,21 +119,21 @@ public void run() {
|
118 | 119 | if (!operation.hasTag("server-only")) {
|
119 | 120 | // 1. Generate test cases for each request.
|
120 | 121 | operation.getTrait(HttpRequestTestsTrait.class).ifPresent(trait -> {
|
121 |
| - for (HttpRequestTestCase testCase : trait.getTestCases()) { |
| 122 | + for (HttpRequestTestCase testCase : trait.getTestCasesFor(AppliesTo.CLIENT)) { |
122 | 123 | onlyIfProtocolMatches(testCase, () -> generateRequestTest(operation, testCase));
|
123 | 124 | }
|
124 | 125 | });
|
125 | 126 | // 2. Generate test cases for each response.
|
126 | 127 | operation.getTrait(HttpResponseTestsTrait.class).ifPresent(trait -> {
|
127 |
| - for (HttpResponseTestCase testCase : trait.getTestCases()) { |
| 128 | + for (HttpResponseTestCase testCase : trait.getTestCasesFor(AppliesTo.CLIENT)) { |
128 | 129 | onlyIfProtocolMatches(testCase, () -> generateResponseTest(operation, testCase));
|
129 | 130 | }
|
130 | 131 | });
|
131 | 132 | // 3. Generate test cases for each error on each operation.
|
132 | 133 | for (StructureShape error : operationIndex.getErrors(operation)) {
|
133 | 134 | if (!error.hasTag("server-only")) {
|
134 | 135 | error.getTrait(HttpResponseTestsTrait.class).ifPresent(trait -> {
|
135 |
| - for (HttpResponseTestCase testCase : trait.getTestCases()) { |
| 136 | + for (HttpResponseTestCase testCase : trait.getTestCasesFor(AppliesTo.CLIENT)) { |
136 | 137 | onlyIfProtocolMatches(testCase,
|
137 | 138 | () -> generateErrorResponseTest(operation, error, testCase));
|
138 | 139 | }
|
|
0 commit comments