Skip to content

Commit ed6ff67

Browse files
committed
Add Test
Issue gh-13660
1 parent 4d6ff49 commit ed6ff67

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

web/src/main/java/org/springframework/security/web/ObservationFilterChainDecorator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public void doFilter(ServletRequest request, ServletResponse response) throws IO
141141

142142
static final class ObservationFilter implements Filter {
143143

144-
private static final Map<String, String> OBSERVATION_NAMES = new HashMap<>();
144+
static final Map<String, String> OBSERVATION_NAMES = new HashMap<>();
145145

146146
static {
147147
OBSERVATION_NAMES.put("DisableEncodeUrlFilter", "session.urlencoding");

web/src/test/java/org/springframework/security/web/ObservationFilterChainDecoratorTests.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@ void decorateFiltersWhenCompletesThenHasSpringSecurityReachedFilterNameTag(Filte
150150
.isEqualTo(expectedFilterNameTag);
151151
}
152152

153+
// gh-13660
154+
@Test
155+
void observationNamesDoNotContainDashes() {
156+
ObservationFilterChainDecorator.ObservationFilter.OBSERVATION_NAMES.values()
157+
.forEach((name) -> assertThat(name).doesNotContain("-"));
158+
}
159+
153160
static Stream<Arguments> decorateFiltersWhenCompletesThenHasSpringSecurityReachedFilterNameTag() {
154161
Filter filterWithName = new BasicAuthenticationFilter();
155162

0 commit comments

Comments
 (0)