erase TracTrac passwords in log output

This commit is contained in:
Axel Uhl
2024-04-23 09:57:56 +02:00
parent d5fbf81ae1
commit 230e9b4601
7 changed files with 32 additions and 10 deletions
@@ -0,0 +1,14 @@
package com.sap.sailing.domain.test.tractrac;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class PasswordSuppressionTest {
@Test
public void testPasswordSuppression() {
assertEquals("https://em.paris1.tractrac.com/update_race_status?eventid=cbdd7370-daea-013c-d54d-342e996a9920&raceid=a90b8e50-e24a-013c-39f7-0eeb2fba6aa7&username=john.doe%40example.com&password=****&race_status=ABORTED",
"https://em.paris1.tractrac.com/update_race_status?eventid=cbdd7370-daea-013c-d54d-342e996a9920&raceid=a90b8e50-e24a-013c-39f7-0eeb2fba6aa7&username=john.doe%40example.com&password=Humba&race_status=ABORTED"
.replaceAll("password=([^&]*)&", "password=****&"));
}
}