@Test public void createExecutorWithRequestReturnsRequestExecutor() throws URISyntaxException { HttpPost post = mock(HttpPost.class); URI uri = new URI("http: when(post.getURI()).thenReturn(uri); assertEquals(RequestExecutor.class, factory.createExecutor(post, mock(UsernamePasswordCredentials.class)) .getClass()); }
@Override public RequestExecutor createExecutor(String url, UsernamePasswordCredentials credentials) { return new RequestExecutor(url, new HttpClientFactoryImpl(), settings).setCredentials(credentials); }
RequestExecutorFactoryImpl implements RequestExecutorFactory { @Override public RequestExecutor createExecutor(String url, UsernamePasswordCredentials credentials) { return new RequestExecutor(url, new HttpClientFactoryImpl(), settings).setCredentials(credentials); } }
RequestExecutorFactoryImpl implements RequestExecutorFactory { @Override public RequestExecutor createExecutor(String url, UsernamePasswordCredentials credentials) { return new RequestExecutor(url, new HttpClientFactoryImpl(), settings).setCredentials(credentials); } RequestExecutorFactoryImpl(Settings settings); }
RequestExecutorFactoryImpl implements RequestExecutorFactory { @Override public RequestExecutor createExecutor(String url, UsernamePasswordCredentials credentials) { return new RequestExecutor(url, new HttpClientFactoryImpl(), settings).setCredentials(credentials); } RequestExecutorFactoryImpl(Settings settings); @Override RequestExecutor createExecutor(String url, UsernamePasswordCredentials credentials); @Override RequestExecutor createExecutor(HttpPost request, UsernamePasswordCredentials credentials); }
RequestExecutorFactoryImpl implements RequestExecutorFactory { @Override public RequestExecutor createExecutor(String url, UsernamePasswordCredentials credentials) { return new RequestExecutor(url, new HttpClientFactoryImpl(), settings).setCredentials(credentials); } RequestExecutorFactoryImpl(Settings settings); @Override RequestExecutor createExecutor(String url, UsernamePasswordCredentials credentials); @Override RequestExecutor createExecutor(HttpPost request, UsernamePasswordCredentials credentials);  }