HttpRequest extends CertainlyCloneable<HttpRequest> { public void verifyComplete() { if (path == null) throw new IllegalStateException("HTTP requests must have a path set. Use '/' for top level"); if (httpOperation == null) throw new IllegalStateException("HTTP requests must have an HTTP method defined"); } HttpRequest(); String getScheme(); String getHost(); int getPort(); String getPath(); List<KeyValuePair> getUrlOptions(); String getOption(String key, String defaultValue); List<KeyValuePair> getHeaders(); String getHeader(String key, String defaultValue); long getTimeoutMillis(); Object getPostContent(); HttpOp getHttpOperation(); HttpRequest setScheme(String scheme); HttpRequest setHost(String hostname); HttpRequest setPort(int port); HttpRequest setPath(String path); HttpRequest addUrlOption(String key, String value); HttpRequest setUrlOptions(List<KeyValuePair> options); HttpRequest addHttpHeader(String key, String value); HttpRequest setTimeout(long timeoutMillis); HttpRequest setPostContent(Object content); HttpRequest setHttpOperation(HttpOp op); HttpRequest merge(HttpRequest r); @Override HttpRequest clone(); @Override String toString(); String toString(boolean verbose); void verifyComplete(); boolean equals(Object o);  }
@Test public void testVerifyComplete() { try{ new HttpRequest().setPath("/foo").verifyComplete(); assertTrue(false); } catch (IllegalStateException e) { } try{ new HttpRequest().setHttpOperation(HttpRequest.HttpOp.GET).verifyComplete(); assertTrue(false); } catch (IllegalStateException e) { } new HttpRequest().setHttpOperation(HttpRequest.HttpOp.GET).setPath("/bar").verifyComplete(); }