mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Introduce queryParamPredicate in AbstractRequestLoggingFilter
Closes gh-35603 Signed-off-by: Simone Conte <conte@adobe.com>
This commit is contained in:
committed by
Sam Brannen
parent
080bca0b23
commit
87a7507e3a
+4
-3
@@ -108,13 +108,14 @@ class RequestLoggingFilterTests {
|
||||
|
||||
@Test
|
||||
void queryStringIncluded() throws Exception {
|
||||
request.setQueryString("booking=42");
|
||||
request.setQueryString("booking=42&code=73&category=hotel&code=37&category=resort");
|
||||
filter.setIncludeQueryString(true);
|
||||
filter.setQueryParamPredicate(name -> !name.equals("code") && !name.equals("ignore"));
|
||||
|
||||
applyFilter();
|
||||
|
||||
assertThat(filter.beforeRequestMessage).contains("/hotels?booking=42");
|
||||
assertThat(filter.afterRequestMessage).contains("/hotels?booking=42");
|
||||
assertThat(filter.beforeRequestMessage).contains("/hotels?booking=42&code=masked&category=hotel&category=resort");
|
||||
assertThat(filter.afterRequestMessage).contains("/hotels?booking=42&code=masked&category=hotel&category=resort");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user