Skip to content

Commit 0ff0527

Browse files
committed
Test callsFilterInListWithUnionWithSensitiveData
1 parent 84930bb commit 0ff0527

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/StructureGeneratorTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,16 @@ public void callsFilterForListWithUnionWithSensitiveData() {
240240
+ " })\n");
241241
}
242242

243+
@Test
244+
public void callsFilterInListWithUnionWithSensitiveData() {
245+
testStructureCodegen("test-list-with-union-with-sensitive-data.smithy",
246+
" export const filterSensitiveLog = (obj: TestUnion): any => {\n"
247+
+ " if (obj.bar !== undefined) return {bar: obj.bar};\n"
248+
+ " if (obj.sensitiveBar !== undefined) return {[sensitiveBar]: SENSITIVE_STRING};\n"
249+
+ " if (obj.$unknown !== undefined) return {[obj.$unknown[0]]: obj.$unknown[1]};\n"
250+
+ " }\n");
251+
}
252+
243253
@Test
244254
public void callsFilterForListWithSensitiveMember() {
245255
testStructureCodegen("test-list-with-sensitive-member.smithy",

0 commit comments

Comments
 (0)