Fix root path test and add more test cases
This commit is contained in:
@@ -130,6 +130,10 @@ public class DefaultPathSegmentContainerTests {
|
||||
assertEquals("/b/c", PathSegmentContainer.subPath(path, 1).value());
|
||||
assertEquals("/c", PathSegmentContainer.subPath(path, 2).value());
|
||||
|
||||
// root path
|
||||
path = PathSegmentContainer.parse("/", UTF_8);
|
||||
assertEquals("/", PathSegmentContainer.subPath(path, 0).value());
|
||||
|
||||
// trailing slash
|
||||
path = PathSegmentContainer.parse("/a/b/", UTF_8);
|
||||
assertEquals("/b/", PathSegmentContainer.subPath(path, 1).value());
|
||||
|
||||
@@ -39,6 +39,9 @@ public class DefaultRequestPathTests {
|
||||
// context path only
|
||||
testRequestPath("/a/b", "/a/b", "", false, true, false);
|
||||
|
||||
// root path
|
||||
testRequestPath("/", "", "/", false, true, false);
|
||||
|
||||
// empty path
|
||||
testRequestPath("", "", "", true, false, false);
|
||||
testRequestPath("", "/", "", true, false, false);
|
||||
|
||||
Reference in New Issue
Block a user