|
3 | 3 | import static org.hamcrest.MatcherAssert.assertThat;
|
4 | 4 | import static org.hamcrest.Matchers.containsString;
|
5 | 5 | import static org.hamcrest.Matchers.equalTo;
|
6 |
| -import static org.hamcrest.Matchers.greaterThan; |
7 | 6 |
|
8 | 7 | import org.junit.jupiter.api.Test;
|
9 | 8 | import software.amazon.smithy.build.MockManifest;
|
@@ -145,42 +144,6 @@ public void escapesRecursiveSymbols() {
|
145 | 144 | assertThat(listSymbol.getName(), equalTo("(_Record)[]"));
|
146 | 145 | }
|
147 | 146 |
|
148 |
| - @Test |
149 |
| - public void errorStructuresAreMetadataBearers() { |
150 |
| - Model model = Model.assembler() |
151 |
| - .addImport(getClass().getResource("output-structure.smithy")) |
152 |
| - .assemble() |
153 |
| - .unwrap(); |
154 |
| - TypeScriptSettings settings = TypeScriptSettings.from(model, Node.objectNodeBuilder() |
155 |
| - .withMember("package", Node.from("example")) |
156 |
| - .withMember("packageVersion", Node.from("1.0.0")) |
157 |
| - .build()); |
158 |
| - |
159 |
| - Shape input = model.expectShape(ShapeId.from("smithy.example#GetFooInput")); |
160 |
| - Shape output = model.expectShape(ShapeId.from("smithy.example#GetFooOutput")); |
161 |
| - Shape error = model.expectShape(ShapeId.from("smithy.example#GetFooError")); |
162 |
| - SymbolProvider provider = TypeScriptCodegenPlugin.createSymbolProvider(model, settings); |
163 |
| - Symbol inputSymbol = provider.toSymbol(input); |
164 |
| - Symbol outputSymbol = provider.toSymbol(output); |
165 |
| - Symbol errorSymbol = provider.toSymbol(error); |
166 |
| - |
167 |
| - // Input and Output does not use MetadataBearer |
168 |
| - assertThat(inputSymbol.getReferences().stream() |
169 |
| - .filter(ref -> ref.getProperty("extends").isPresent()) |
170 |
| - .count(), equalTo(0L)); |
171 |
| - assertThat(outputSymbol.getReferences().stream() |
172 |
| - .filter(ref -> ref.getAlias().equals("$MetadataBearer")) |
173 |
| - .count(), equalTo(0L)); |
174 |
| - |
175 |
| - // Output uses MetadataBearer |
176 |
| - assertThat(errorSymbol.getReferences().stream() |
177 |
| - .filter(ref -> ref.getProperty(SymbolVisitor.IMPLEMENTS_INTERFACE_PROPERTY).isPresent()) |
178 |
| - .count(), greaterThan(0L)); |
179 |
| - assertThat(errorSymbol.getReferences().stream() |
180 |
| - .filter(ref -> ref.getAlias().equals("$MetadataBearer")) |
181 |
| - .count(), greaterThan(0L)); |
182 |
| - } |
183 |
| - |
184 | 147 | @Test
|
185 | 148 | public void createsCommandModules() {
|
186 | 149 | Model model = Model.assembler()
|
|
0 commit comments