@@ -32,25 +32,57 @@ public void init() {
32
32
requestMetric = new RequestMetricInfo ();
33
33
}
34
34
35
+ @ Test
36
+ public void testParsePathSingleSlash () {
37
+ String path = requestMetric .getNormalizedUriPath (NO_MATCH_PATTERNS , NO_IGNORE_PATTERNS , "/" );
38
+ Assertions .assertEquals ("/" , path );
39
+ }
40
+
35
41
@ Test
36
42
public void testParsePathDoubleSlash () {
37
43
String path = requestMetric .getNormalizedUriPath (NO_MATCH_PATTERNS , NO_IGNORE_PATTERNS , "//" );
38
44
Assertions .assertEquals ("/" , path );
39
45
}
40
46
47
+ @ Test
48
+ public void testParsePathMultipleSlash () {
49
+ String path = requestMetric .getNormalizedUriPath (NO_MATCH_PATTERNS , NO_IGNORE_PATTERNS , "/////" );
50
+ Assertions .assertEquals ("/" , path );
51
+ }
52
+
41
53
@ Test
42
54
public void testParseEmptyPath () {
43
55
String path = requestMetric .getNormalizedUriPath (NO_MATCH_PATTERNS , NO_IGNORE_PATTERNS , "" );
44
56
Assertions .assertEquals ("/" , path );
45
57
}
46
58
59
+ @ Test
60
+ public void testParseNullPath () {
61
+ String path = requestMetric .getNormalizedUriPath (NO_MATCH_PATTERNS , NO_IGNORE_PATTERNS , null );
62
+ Assertions .assertEquals ("/" , path );
63
+ }
64
+
47
65
@ Test
48
66
public void testParsePathNoLeadingSlash () {
49
67
String path = requestMetric .getNormalizedUriPath (NO_MATCH_PATTERNS , NO_IGNORE_PATTERNS ,
50
68
"path/with/no/leading/slash" );
51
69
Assertions .assertEquals ("/path/with/no/leading/slash" , path );
52
70
}
53
71
72
+ @ Test
73
+ public void testParsePathNoEndSlash () {
74
+ String path = requestMetric .getNormalizedUriPath (NO_MATCH_PATTERNS , NO_IGNORE_PATTERNS ,
75
+ "/path/with/no/end/slash/" );
76
+ Assertions .assertEquals ("/path/with/no/end/slash" , path );
77
+ }
78
+
79
+ @ Test
80
+ public void testParsePathNoEndDoubleSlash () {
81
+ String path = requestMetric .getNormalizedUriPath (NO_MATCH_PATTERNS , NO_IGNORE_PATTERNS ,
82
+ "/path/with/no/end/double/slash///////" );
83
+ Assertions .assertEquals ("/path/with/no/end/double/slash" , path );
84
+ }
85
+
54
86
@ Test
55
87
public void testParsePathIgnoreNoLeadingSlash () {
56
88
String path = requestMetric .getNormalizedUriPath (NO_MATCH_PATTERNS , ignorePatterns ,
0 commit comments