use of org.apache.wicket.mock.MockWebRequest in project wicket by apache.
the class UrlRendererTest method renderUrlWithTrailingDotsInQueryString.
/**
* https://issues.apache.org/jira/browse/WICKET-5468
*/
@Test
public void renderUrlWithTrailingDotsInQueryString() {
UrlRenderer r1 = new UrlRenderer(new MockWebRequest(Url.parse("some/path")));
assertEquals("./path?a=b..", r1.renderUrl(Url.parse("some/path?a=b..")));
}
use of org.apache.wicket.mock.MockWebRequest in project wicket by apache.
the class UrlRendererTest method renderFullUrlWithFragment.
/**
* https://issues.apache.org/jira/browse/WICKET-5970
*/
@Test
public void renderFullUrlWithFragment() {
UrlRenderer renderer = new UrlRenderer(new MockWebRequest(Url.parse("authorize")));
Url urlWithFragment = Url.parse("http://localhost:8080/redirect#access_token=123456");
assertEquals("access_token=123456", urlWithFragment.getFragment());
String renderedUrl = renderer.renderFullUrl(urlWithFragment);
assertEquals("http://localhost:8080/redirect#access_token=123456", renderedUrl);
}
use of org.apache.wicket.mock.MockWebRequest in project wicket by apache.
the class UrlRendererTest method renderFullUrlAsRelativeToBaseUrlWithoutComposedFilterPath.
@Test
public void renderFullUrlAsRelativeToBaseUrlWithoutComposedFilterPath() {
// base url without context path and filter path
Url baseUrl = Url.parse("a/b/c/d");
Url encodedFullUrl = Url.parse("http://host:8080/context/path/a/b;jsessionid=123456");
MockWebRequest request = new MockWebRequest(baseUrl);
request.setContextPath("context/path");
UrlRenderer renderer = new UrlRenderer(request);
String encodedRelativeUrl = renderer.renderRelativeUrl(encodedFullUrl);
assertEquals("../../b;jsessionid=123456", encodedRelativeUrl);
}
use of org.apache.wicket.mock.MockWebRequest in project wicket by apache.
the class UrlRendererTest method test15.
/**
* WICKET-4935 prevent another double slash
*/
@Test
public void test15() {
UrlRenderer r1 = new UrlRenderer(new MockWebRequest(Url.parse("private/AdminPage")));
assertEquals("../signIn;jsessionid=16k3wqa9c4sgq1cnp7fisa20u", r1.renderRelativeUrl(Url.parse("/signIn;jsessionid=16k3wqa9c4sgq1cnp7fisa20u")));
}
use of org.apache.wicket.mock.MockWebRequest in project wicket by apache.
the class UrlRendererTest method renderUrlWithManyDotsAtTheEnd1.
/**
* https://issues.apache.org/jira/browse/WICKET-6230
*/
@Test
public void renderUrlWithManyDotsAtTheEnd1() {
UrlRenderer renderer = new UrlRenderer(new MockWebRequest(Url.parse("a")));
String renderedUrl = renderer.renderUrl(Url.parse("abc..."));
assertEquals("./abc...", renderedUrl);
}
Aggregations