Skip to content

Commit 7b70ddf

Browse files
committed
Test callsFilterInMapWithUnionWithSensitiveData
1 parent d8b3d2f commit 7b70ddf

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,17 @@ public void callsFilterForMapWithUnionWithSensitiveData() {
334334
+ " })\n");
335335
}
336336

337+
@Test
338+
public void callsFilterInMapWithUnionWithSensitiveData() {
339+
testStructureCodegen("test-map-with-union-with-sensitive-data.smithy",
340+
" export const filterSensitiveLog = (obj: TestUnion): any => {\n"
341+
+ " if (obj.bar !== undefined) return {bar: obj.bar};\n"
342+
+ " if (obj.sensitiveBar !== undefined) return {[sensitiveBar]: SENSITIVE_STRING};\n"
343+
+ " if (obj.$unknown !== undefined) return {[obj.$unknown[0]]: obj.$unknown[1]};\n"
344+
+ " }\n");
345+
}
346+
347+
337348
@Test
338349
public void callsFilterForMapWithSensitiveMember() {
339350
testStructureCodegen("test-map-with-sensitive-member.smithy",

0 commit comments

Comments
 (0)