Commit 5bd4acf
authored
Fix smoke test missing params (#2795)
If a smoke test case didn't define input `params`, the validation that
normally checks to make sure `params` matches the operation input would
not run. This meant that you could omit `params` even if the operation
input has required members.
I fixed this by manually checking for required members when `params`
aren't defined (I couldn't use NodeValidationVisitor because it needs an
actual node to check, plus the error message will be better this way).
It emits an error, same as NodeValidationVisitor would.
Also removed a branch in the smoke test input param validation logic, which
would check for cases where `params` were provided for an operation with
no input. This code was unreachable because the method being used to get
the operation's input shape, `OperationIndex::expectInputShape`, always
returns a value, and we were checking for null. There wasn't a test case
for this, so I'm not sure why I wrote it that way to begin with.1 parent 4a2ac32 commit 5bd4acf
File tree
3 files changed
+40
-9
lines changed- smithy-smoke-test-traits/src
- main/java/software/amazon/smithy/smoketests/traits
- test/resources/software/amazon/smithy/smoketests/traits/errorfiles
3 files changed
+40
-9
lines changedLines changed: 19 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
75 | | - | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
88 | 91 | | |
89 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
90 | 100 | | |
91 | 101 | | |
92 | 102 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
0 commit comments