Add RequestPath tests for modifying the contextPath
This commit is contained in:
@@ -59,4 +59,19 @@ public class DefaultRequestPathTests {
|
||||
assertEquals(pathWithinApplication, requestPath.pathWithinApplication().value());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateRequestPath() throws Exception {
|
||||
|
||||
URI uri = URI.create("http://localhost:8080/aA/bB/cC");
|
||||
RequestPath requestPath = RequestPath.parse(uri, null);
|
||||
|
||||
assertEquals("", requestPath.contextPath().value());
|
||||
assertEquals("/aA/bB/cC", requestPath.pathWithinApplication().value());
|
||||
|
||||
requestPath = requestPath.modifyContextPath("/aA");
|
||||
|
||||
assertEquals("/aA", requestPath.contextPath().value());
|
||||
assertEquals("/bB/cC", requestPath.pathWithinApplication().value());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user