### Question:
ConfigurableDispatch extends DefaultDispatch { @Override public URI getDispatchUrl(HttpServletRequest request) { if (getRemoveUrlEncoding()) { String base = request.getRequestURI(); StringBuffer str = new StringBuffer(); str.append(base); String query = request.getQueryString(); if (query != null) { try { query = URLDecoder.decode(query, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { } str.append('?'); str.append(query); } encodeUnwiseCharacters(str); return URI.create(str.toString()); } return super.getDispatchUrl(request); }  @Override Set<String> getOutboundResponseExcludeHeaders(); @Override Set<String> getOutboundResponseExcludedSetCookieHeaderDirectives(); @Override Set<String> getOutboundRequestExcludeHeaders(); boolean getRemoveUrlEncoding(); @Override URI getDispatchUrl(HttpServletRequest request);  }### Answer:
@Test( timeout = TestUtils.SHORT_TIMEOUT ) public void testGetDispatchUrl() { HttpServletRequest request; String path; String query; URI uri; ConfigurableDispatch dispatch = new ConfigurableDispatch(); 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: }