9
9
import static org .junit .jupiter .api .Assertions .assertEquals ;
10
10
11
11
public class HTTPPathMetricFilterTest {
12
- final Set <String > pathSet = Set .of ("/v1/identity/map" , "/token/refresh" );
12
+ final Set <String > pathSet = Set .of ("/v1/identity/map" , "/token/refresh" , "/list" , "/list/:siteId/:keyId" );
13
13
14
14
@ ParameterizedTest
15
15
@ ValueSource (strings = {
@@ -18,6 +18,7 @@ public class HTTPPathMetricFilterTest {
18
18
"/unknown-path" ,
19
19
"../" ,
20
20
"/v1/identity/map%55" ,
21
+ "/list/123" ,
21
22
})
22
23
void testPathFiltering_InvalidPaths_Unknown (String actualPath ) {
23
24
String filteredPath = HTTPPathMetricFilter .filterPath (actualPath , pathSet );
@@ -28,6 +29,7 @@ void testPathFiltering_InvalidPaths_Unknown(String actualPath) {
28
29
@ ValueSource (strings = {
29
30
"v1/identity/map?id=bad-escape-code%2" ,
30
31
"token/refresh?refresh_token=SOME_TOKEN<%=7485*4353%>" ,
32
+ "list/12%4/5435"
31
33
})
32
34
void testPathFiltering_InvalidPaths_ParsingError (String actualPath ) {
33
35
String filteredPath = HTTPPathMetricFilter .filterPath (actualPath , pathSet );
@@ -44,6 +46,8 @@ void testPathFiltering_InvalidPaths_ParsingError(String actualPath) {
44
46
"/v1/identity/new/path/../../map, /v1/identity/map" ,
45
47
"token/refresh?refresh_token=123%20%23, /token/refresh" ,
46
48
"v1/identity/map?identity/../map/, /v1/identity/map" ,
49
+ "/list, /list" ,
50
+ "/list/123/key123, /list/:siteId/:keyId"
47
51
48
52
})
49
53
void testPathFiltering_ValidPaths_KnownEndpoints (String actualPath , String expectedFilteredPath ) {
0 commit comments