Skip to content

Commit dab7e03

Browse files
committed
Polish
See gh-28041
1 parent 4bf995f commit dab7e03

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

spring-test/src/main/java/org/springframework/test/web/servlet/setup/MockMvcFilterDecorator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ final class MockMvcFilterDecorator implements Filter {
4949

5050
private static final String ALL_MAPPING_PATTERN = "*";
5151

52-
private static final String EXTENSION_MAPPING_PATTERN = ALL_MAPPING_PATTERN + ".";
52+
private static final String EXTENSION_MAPPING_PATTERN = "*.";
5353

54-
private static final String PATH_MAPPING_PATTERN = "/" + ALL_MAPPING_PATTERN;
54+
private static final String PATH_MAPPING_PATTERN = "/*";
5555

5656
private final Filter delegate;
5757

spring-test/src/test/java/org/springframework/test/web/servlet/setup/MockMvcFilterDecoratorTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,21 +90,25 @@ public void matchExactEmpty() throws Exception {
9090

9191
@Test
9292
public void matchPathMappingAllFolder() throws Exception {
93+
assertFilterInvoked("/test/this", "*");
9394
assertFilterInvoked("/test/this", "/*");
9495
}
9596

9697
@Test
9798
public void matchPathMappingAll() throws Exception {
9899
assertFilterInvoked("/test", "*");
100+
assertFilterInvoked("/test", "/*");
99101
}
100102

101103
@Test
102104
public void matchPathMappingAllContextRoot() throws Exception {
105+
assertFilterInvoked("", "*");
103106
assertFilterInvoked("", "/*");
104107
}
105108

106109
@Test
107110
public void matchPathMappingContextRootAndSlash() throws Exception {
111+
assertFilterInvoked("/", "*");
108112
assertFilterInvoked("/", "/*");
109113
}
110114

0 commit comments

Comments
 (0)