### Question:
HBaseDispatch extends DefaultDispatch { @Override public URI getDispatchUrl(HttpServletRequest request) { return HBaseRequestUtil.decodeUrl(request); }  @Override URI getDispatchUrl(HttpServletRequest request);  }### Answer:
@SuppressWarnings("deprecation") @Test( timeout = TestUtils.SHORT_TIMEOUT ) public void testGetDispatchUrl() throws Exception { HttpServletRequest request; Dispatch dispatch; String path; String query; URI uri; dispatch = new HBaseDispatch(); path = "http: request = EasyMock.createNiceMock( HttpServletRequest.class ); EasyMock.expect( request.getRequestURI() ).andReturn( path ).anyTimes(); EasyMock.expect( request.getRequestURL() ).andReturn( new StringBuffer( path ) ).anyTimes(); EasyMock.expect( request.getQueryString() ).andReturn( null ).anyTimes(); EasyMock.replay( request ); uri = dispatch.getDispatchUrl( request ); assertThat( uri.toASCIIString(), is( "http: path = "http: request = EasyMock.createNiceMock( HttpServletRequest.class ); EasyMock.expect( request.getRequestURI() ).andReturn( path ).anyTimes(); EasyMock.expect( request.getRequestURL() ).andReturn( new StringBuffer( path ) ).anyTimes(); EasyMock.expect( request.getQueryString() ).andReturn( null ).anyTimes(); EasyMock.replay( request ); uri = dispatch.getDispatchUrl( request ); assertThat( uri.toASCIIString(), is( "http: path = "http: request = EasyMock.createNiceMock( HttpServletRequest.class ); EasyMock.expect( request.getRequestURI() ).andReturn( path ).anyTimes(); EasyMock.expect( request.getRequestURL() ).andReturn( new StringBuffer( path ) ).anyTimes(); EasyMock.expect( request.getQueryString() ).andReturn( null ).anyTimes(); EasyMock.replay( request ); uri = dispatch.getDispatchUrl( request ); assertThat( uri.toASCIIString(), is( "http: path = "http: query = "test%26name=test%3Dvalue"; request = EasyMock.createNiceMock( HttpServletRequest.class ); EasyMock.expect( request.getRequestURI() ).andReturn( path ).anyTimes(); EasyMock.expect( request.getRequestURL() ).andReturn( new StringBuffer( path ) ).anyTimes(); EasyMock.expect( request.getQueryString() ).andReturn( query ).anyTimes(); EasyMock.replay( request ); uri = dispatch.getDispatchUrl( request ); assertThat( uri.toASCIIString(), is( "http: }