@Test
public void testReverseProxyWithModuleBase() {

	AutomaticDispatcherUrlService adus = new AutomaticDispatcherUrlService();
	// set mock request in context holder
	MockHttpServletRequest mockRequest = new MockHttpServletRequest();
	mockRequest.setScheme("http");
	mockRequest.setServerName("myhost");
	mockRequest.setServerPort(80);
	mockRequest.setContextPath("/test");
	mockRequest.addHeader(X_FORWARD_HOST_HEADER, "geomajas.org");
	mockRequest.addHeader(X_GWT_MODULE_HEADER, "http://geomajas.org/app/Module");
	ServletRequestAttributes attributes = new ServletRequestAttributes(mockRequest);
	RequestContextHolder.setRequestAttributes(attributes);
	Assert.assertEquals("http://geomajas.org/app/d/", adus.getDispatcherUrl());
	// clean up
	RequestContextHolder.setRequestAttributes(null);
}