test(api): fix maskMiddle expected suffix

maskMiddle keeps a 4-char tail, so the masked '...e123' suffix is the
contract, not '...3123'.
This commit is contained in:
lapy 2026-10-11 17:58:02 +01:00
parent 934a349cdd
commit e786e948ec

View file

@ -44,7 +44,7 @@ class SensitiveDataUtilsTest {
void maskMiddle_keeps_four_at_each_end_for_long_strings() { void maskMiddle_keeps_four_at_each_end_for_long_strings() {
String masked = SensitiveDataUtils.maskMiddle("verylongapikeyvalue123"); String masked = SensitiveDataUtils.maskMiddle("verylongapikeyvalue123");
assertTrue(masked.startsWith("very")); assertTrue(masked.startsWith("very"));
assertTrue(masked.endsWith("3123")); assertTrue(masked.endsWith("e123"));
assertTrue(masked.contains("****")); assertTrue(masked.contains("****"));
assertEquals("verylongapikeyvalue123".length(), masked.length()); assertEquals("verylongapikeyvalue123".length(), masked.length());
} }