@Test
public void renderFullUrlAsRelativeToBaseUrlWithFirstSegmentsEqualToTheContextPath()
{
// base url without context path and filter path
// 'contextPath' here is a normal segment with the same value
Url baseUrl = Url.parse("contextPath/a/b/c/d");
// here 'contextPath' is the actual context path and should be ignored
Url encodedFullUrl = Url.parse("http://host:8080/contextPath/a/b;jsessionid=123456");
MockWebRequest request = new MockWebRequest(baseUrl);
request.setContextPath("contextPath");
UrlRenderer renderer = new UrlRenderer(request);
String encodedRelativeUrl = renderer.renderRelativeUrl(encodedFullUrl);