|
10 | 10 | import software.amazon.smithy.model.Model;
|
11 | 11 | import software.amazon.smithy.model.node.Node;
|
12 | 12 |
|
13 |
| -@Disabled("WIP") |
14 | 13 | public class CommandGeneratorTest {
|
15 | 14 | @Test
|
16 | 15 | public void addsCommandSpecificPlugins() {
|
17 |
| - testCommmandCodegen("output-structure.smithy", |
18 |
| - " resolveMiddleware(\n" + |
19 |
| - " clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,\n" + |
20 |
| - " configuration: ExampleClientResolvedConfig,\n" + |
21 |
| - " options?: __HttpHandlerOptions\n" + |
22 |
| - " ): Handler<GetFooCommandInput, GetFooCommandOutput> {\n" + |
23 |
| - " this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));\n" + |
24 |
| - "\n" + |
25 |
| - " const stack = clientStack.concat(this.middlewareStack);"); |
| 16 | + testCommmandCodegen( |
| 17 | + "output-structure.smithy", |
| 18 | + "getSerdePlugin(config, this.serialize, this.deserialize)" |
| 19 | + ); |
26 | 20 | }
|
27 | 21 |
|
28 | 22 | @Test
|
29 | 23 | public void writesSerializer() {
|
30 |
| - testCommmandCodegen("output-structure.smithy", |
31 |
| - " private serialize(\n" + |
32 |
| - " input: GetFooCommandInput,\n" + |
33 |
| - " context: __SerdeContext\n" + |
34 |
| - " ): Promise<__HttpRequest> {"); |
| 24 | + testCommmandCodegen( |
| 25 | + "output-structure.smithy", |
| 26 | + "private serialize = " |
| 27 | + ); |
35 | 28 | }
|
36 | 29 |
|
37 | 30 | @Test
|
38 | 31 | public void writesDeserializer() {
|
39 |
| - testCommmandCodegen("output-structure.smithy", |
40 |
| - " private deserialize(\n" + |
41 |
| - " output: __HttpResponse,\n" + |
42 |
| - " context: __SerdeContext\n" + |
43 |
| - " ): Promise<GetFooCommandOutput> {"); |
| 32 | + testCommmandCodegen( |
| 33 | + "output-structure.smithy", |
| 34 | + "private deserialize =" |
| 35 | + ); |
44 | 36 | }
|
45 | 37 |
|
46 | 38 | private void testCommmandCodegen(String file, String expectedType) {
|
|
0 commit comments