use of org.apache.wicket.request.resource.ContextRelativeResource in project wicket by apache.
the class ContextRelativeResourceCachingTest method mapHandler.
/**
*/
@Test
public void mapHandler() {
ContextRelativeResource resource = new ContextRelativeResource("/style.css");
init(resource, "/test/resource");
Request request = createRequest("test/resource-version-123?bla=4567");
final IRequestHandler handler = tester.getApplication().getRootRequestMapper().mapRequest(request);
assertThat(handler, instanceOf(ResourceReferenceRequestHandler.class));
assertEquals(((ResourceReferenceRequestHandler) handler).getResource(), resource);
}
use of org.apache.wicket.request.resource.ContextRelativeResource in project wicket by apache.
the class ContextRelativeResourceCachingTest method mapRequest.
/**
*/
@Test
public void mapRequest() {
ContextRelativeResource resource = new ContextRelativeResource("/style.css");
init(resource, "/test/resource");
IRequestHandler handler = new ResourceReferenceRequestHandler(new SharedResourceReference(SHARED_NAME));
Url url = tester.getApplication().getRootRequestMapper().mapHandler(handler);
assertNotNull(url);
assertEquals(url, Url.parse("test/resource-version-123"));
}
Aggregations