WebInvoker { public WebResponse invoke(String httpMethod, String path, String entity) { return dispatch.dispatch(new WebRequest(httpMethod, path, entity)); } @Inject  WebInvoker(WebDispatch dispatch); WebResponse invoke(String httpMethod, String path, String entity);  }
@Test public void invoke() { String requestPath = "/one/two%20three?four=five+six&seven="; invoker.invoke("GET", requestPath, null); WebRequest request = verifyDispatcherRequest(); assertEquals("GET", request.getHttpMethod()); assertEquals(null, request.getEntity()); assertEquals(requestPath, request.getPath()); }