Skip to content

Commit 1282f37

Browse files
committed
ECWID-172338 Option and attribute names are masked in logs - formatting updates
1 parent 7a01ff6 commit 1282f37

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/test/kotlin/com/ecwid/apiclient/v3/MaskUtilsUnitTest.kt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,23 @@ class MaskUtilsUnitTest {
3535
@Test
3636
fun testMaskLogKeyValueStringWithNameParameter() {
3737
val logString =
38-
"UpdatedProduct(name={unmasked}, attributes=[AttributeValue(name={unmasked})], options=[RadioOption(name={unmasked})], billingPerson=BillingPerson(name={unmasked}), shippingAddresses=[ShippingAddress(name={unmasked}), ShippingAddress(name={unmasked})], personInfo=PersonInfo(name={unmasked}))"
38+
"UpdatedProduct(name={unmasked}, " +
39+
"attributes=[AttributeValue(name={unmasked})], " +
40+
"options=[RadioOption(name={unmasked})], " +
41+
"billingPerson=BillingPerson(name={unmasked}), " +
42+
"shippingAddresses=[ShippingAddress(name={unmasked}), " +
43+
"ShippingAddress(name={unmasked})], " +
44+
"personInfo=PersonInfo(name={unmasked}))"
3945
val securePatterns = createSecurePatterns()
4046
val maskedLogString = logString.maskLogString(securePatterns)
41-
val expectedMaskedLogString = "UpdatedProduct(name={unmasked}, attributes=[AttributeValue(name={unmasked})], options=[RadioOption(name={unmasked})], billingPerson=BillingPerson(name={u***ed}), shippingAddresses=[ShippingAddress(name={u***ed}), ShippingAddress(name={u***ed})], personInfo=PersonInfo(name={u***ed}))"
47+
val expectedMaskedLogString =
48+
"UpdatedProduct(name={unmasked}, " +
49+
"attributes=[AttributeValue(name={unmasked})], " +
50+
"options=[RadioOption(name={unmasked})], " +
51+
"billingPerson=BillingPerson(name={u***ed}), " +
52+
"shippingAddresses=[ShippingAddress(name={u***ed}), " +
53+
"ShippingAddress(name={u***ed})], " +
54+
"personInfo=PersonInfo(name={u***ed}))"
4255
assertEquals(expectedMaskedLogString, maskedLogString)
4356
}
4457

0 commit comments

Comments
 (0)