PageParameters expectedParameters = new PageParameters();
expectedParameters.add("namedKey1", "namedValue1");
expectedParameters.add("namedKey2", "namedValue2");
expectedParameters.set(0, "indexedValue1");
expectedParameters.set(1, "indexedValue2");
RenderPageRequestHandler renderPageRequestHandler = new RenderPageRequestHandler(
new PageProvider(DummyHomePage.class, expectedParameters));
Url url = mapper.mapHandler(renderPageRequestHandler);
// System.err.println(url.toString());
assertEquals(expectedEncrypted, url.toString());
Request request = getRequest(url);
IRequestHandler requestHandler = mapper.mapRequest(request);
assertThat(requestHandler, instanceOf(RequestSettingRequestHandler.class));
requestHandler = ((RequestSettingRequestHandler)requestHandler).getDelegateHandler();
assertThat(requestHandler, instanceOf(RenderPageRequestHandler.class));
RenderPageRequestHandler handler = (RenderPageRequestHandler)requestHandler;
assertEquals(DummyHomePage.class, handler.getPageClass());
PageParameters actualParameters = handler.getPageParameters();
assertEquals(expectedParameters, actualParameters);
}