### Question:
URLDecodingDispatch extends DefaultDispatch { @Override public URI getDispatchUrl(final HttpServletRequest request) { String decoded; try { decoded = URLDecoder.decode(request.getRequestURL().toString(), StandardCharsets.UTF_8.name() ); } catch (final Exception e) { decoded = request.getRequestURL().toString(); } final StringBuilder str = new StringBuilder(decoded); final String query = request.getQueryString(); if ( query != null ) { str.append('?'); str.append(query); } return URI.create(str.toString()); } URLDecodingDispatch(); @Override URI getDispatchUrl(final HttpServletRequest request);  }### Answer:
@Test(timeout = TestUtils.MEDIUM_TIMEOUT) public void testGetDispatchUrl() throws Exception { final String path = "https: URI uri; 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("https: }