@Test public void appendMappedQueryParamsWithNoPath() throws Exception { assertEquals("http: }
static String appendQueryParameters( final CharSequence url, final Map<?, ?> params ) { final String baseUrl = url.toString(); if( params == null || params.isEmpty() ) return baseUrl; final StringBuilder result = new StringBuilder(baseUrl); addPathSeparator(baseUrl, result); addParamPrefix(baseUrl, result); Entry<?, ?> entry; Object value; Iterator<?> iterator = params.entrySet().iterator(); entry = (Entry<?, ?>) iterator.next(); result.append(entry.getKey().toString()); result.append('='); value = entry.getValue(); if( value != null ) result.append(value); while( iterator.hasNext() ) { result.append('&'); entry = (Entry<?, ?>) iterator.next(); result.append(entry.getKey().toString()); result.append('='); value = entry.getValue(); if( value != null ) result.append(value); } return result.toString(); }
KieServerHttpRequest { static String appendQueryParameters( final CharSequence url, final Map<?, ?> params ) { final String baseUrl = url.toString(); if( params == null || params.isEmpty() ) return baseUrl; final StringBuilder result = new StringBuilder(baseUrl); addPathSeparator(baseUrl, result); addParamPrefix(baseUrl, result); Entry<?, ?> entry; Object value; Iterator<?> iterator = params.entrySet().iterator(); entry = (Entry<?, ?>) iterator.next(); result.append(entry.getKey().toString()); result.append('='); value = entry.getValue(); if( value != null ) result.append(value); while( iterator.hasNext() ) { result.append('&'); entry = (Entry<?, ?>) iterator.next(); result.append(entry.getKey().toString()); result.append('='); value = entry.getValue(); if( value != null ) result.append(value); } return result.toString(); } }
KieServerHttpRequest { static String appendQueryParameters( final CharSequence url, final Map<?, ?> params ) { final String baseUrl = url.toString(); if( params == null || params.isEmpty() ) return baseUrl; final StringBuilder result = new StringBuilder(baseUrl); addPathSeparator(baseUrl, result); addParamPrefix(baseUrl, result); Entry<?, ?> entry; Object value; Iterator<?> iterator = params.entrySet().iterator(); entry = (Entry<?, ?>) iterator.next(); result.append(entry.getKey().toString()); result.append('='); value = entry.getValue(); if( value != null ) result.append(value); while( iterator.hasNext() ) { result.append('&'); entry = (Entry<?, ?>) iterator.next(); result.append(entry.getKey().toString()); result.append('='); value = entry.getValue(); if( value != null ) result.append(value); } return result.toString(); } private  KieServerHttpRequest(final URL url); private  KieServerHttpRequest(final String urlString); private  KieServerHttpRequest(RequestInfo requestInfo); private  KieServerHttpRequest(URL stringUrl, String username, String password); private  KieServerHttpRequest(String stringUrl, String username, String password); }
KieServerHttpRequest { static String appendQueryParameters( final CharSequence url, final Map<?, ?> params ) { final String baseUrl = url.toString(); if( params == null || params.isEmpty() ) return baseUrl; final StringBuilder result = new StringBuilder(baseUrl); addPathSeparator(baseUrl, result); addParamPrefix(baseUrl, result); Entry<?, ?> entry; Object value; Iterator<?> iterator = params.entrySet().iterator(); entry = (Entry<?, ?>) iterator.next(); result.append(entry.getKey().toString()); result.append('='); value = entry.getValue(); if( value != null ) result.append(value); while( iterator.hasNext() ) { result.append('&'); entry = (Entry<?, ?>) iterator.next(); result.append(entry.getKey().toString()); result.append('='); value = entry.getValue(); if( value != null ) result.append(value); } return result.toString(); } private  KieServerHttpRequest(final URL url); private  KieServerHttpRequest(final String urlString); private  KieServerHttpRequest(RequestInfo requestInfo); private  KieServerHttpRequest(URL stringUrl, String username, String password); private  KieServerHttpRequest(String stringUrl, String username, String password); static void setKeepAlive( final boolean keepAlive ); static void setMaxConnections( final int maxConnections ); static KieServerHttpRequest deleteRequest(final URL url ); static KieServerHttpRequest putRequest(final URL url ); static KieServerHttpRequest getRequest(final String urlString ); static KieServerHttpRequest getRequest(final URL url ); static KieServerHttpRequest postRequest(final URL url ); static KieServerHttpRequest newRequest(final String url ); static KieServerHttpRequest newRequest(final URL url ); static KieServerHttpRequest newRequest(final String url, String username, String password ); static KieServerHttpRequest newRequest(final URL url, String username, String password ); KieServerHttpRequest get(final String relativeUrl ); KieServerHttpRequest get(); KieServerHttpRequest post(final String relativeUrl ); KieServerHttpRequest post(); KieServerHttpRequest put(final String relativeUrl ); KieServerHttpRequest put(); KieServerHttpRequest delete(final String relativeUrl ); KieServerHttpRequest delete(); KieServerHttpRequest ignoreCloseExceptions(final boolean ignore ); boolean ignoreCloseExceptions(); KieServerHttpRequest bufferSize(final int size ); int bufferSize(); KieServerHttpRequest setUncompress(final boolean uncompress ); KieServerHttpRequest followRedirects(final boolean followRedirects ); URI getUri(); KieServerHttpRequest timeout(final long timeoutInMilliseconds ); KieServerHttpRequest relativeRequest(String relativeUrlString, String httpMethod ); KieServerHttpRequest relativeRequest(String relativeUrlString ); KieServerHttpRequest disconnect(); KieServerHttpRequest resetStream(); KieServerHttpRequest followRedirets(final boolean followRedirects ); URL getUrl(); String getMethod(); String getHeader( final String name ); KieServerHttpRequest header(final String name, final Object value ); KieServerHttpRequest headers(final Map<String, String> headers ); List<String> getRequestHeader( String headerName ); KieServerHttpRequest acceptEncoding(final String acceptEncoding ); KieServerHttpRequest acceptCharset(final String acceptCharset ); KieServerHttpRequest basicAuthorization(final String name, final String password ); KieServerHttpRequest tokenAuthorization(final String token ); KieServerHttpRequest contentType(final String contentType ); KieServerHttpRequest contentType(final String contentType, final String charset ); KieServerHttpRequest accept(final String accept ); KieServerHttpRequest body(final CharSequence value ); OutputStreamWriter writer(); KieServerHttpRequest query(final Object name, final Object value ); KieServerHttpRequest query(final Map<?, ?> values ); KieServerHttpRequest form(final Object name, final Object value, String charset ); KieServerHttpRequest form(final Object name, final Object value ); KieServerHttpRequest form(final Map<?, ?> values, final String charset ); KieServerHttpRequest form(final Map<?, ?> values ); KieServerHttpResponse response(); KieServerHttpRequest trustAllCerts(); KieServerHttpRequest trustAllHosts(); static void setProxyHost( final String host ); static void setProxyPort( final int port ); static void setNonProxyHosts( final String... hosts ); KieServerHttpRequest useProxy(final String proxyHost, final int proxyPort ); KieServerHttpRequest proxyAuthorization(final String proxyAuthorization ); KieServerHttpRequest proxyBasic(final String name, final String password ); @Override String toString(); @Override KieServerHttpRequest clone(); }
KieServerHttpRequest { static String appendQueryParameters( final CharSequence url, final Map<?, ?> params ) { final String baseUrl = url.toString(); if( params == null || params.isEmpty() ) return baseUrl; final StringBuilder result = new StringBuilder(baseUrl); addPathSeparator(baseUrl, result); addParamPrefix(baseUrl, result); Entry<?, ?> entry; Object value; Iterator<?> iterator = params.entrySet().iterator(); entry = (Entry<?, ?>) iterator.next(); result.append(entry.getKey().toString()); result.append('='); value = entry.getValue(); if( value != null ) result.append(value); while( iterator.hasNext() ) { result.append('&'); entry = (Entry<?, ?>) iterator.next(); result.append(entry.getKey().toString()); result.append('='); value = entry.getValue(); if( value != null ) result.append(value); } return result.toString(); } private  KieServerHttpRequest(final URL url); private  KieServerHttpRequest(final String urlString); private  KieServerHttpRequest(RequestInfo requestInfo); private  KieServerHttpRequest(URL stringUrl, String username, String password); private  KieServerHttpRequest(String stringUrl, String username, String password); static void setKeepAlive( final boolean keepAlive ); static void setMaxConnections( final int maxConnections ); static KieServerHttpRequest deleteRequest(final URL url ); static KieServerHttpRequest putRequest(final URL url ); static KieServerHttpRequest getRequest(final String urlString ); static KieServerHttpRequest getRequest(final URL url ); static KieServerHttpRequest postRequest(final URL url ); static KieServerHttpRequest newRequest(final String url ); static KieServerHttpRequest newRequest(final URL url ); static KieServerHttpRequest newRequest(final String url, String username, String password ); static KieServerHttpRequest newRequest(final URL url, String username, String password ); KieServerHttpRequest get(final String relativeUrl ); KieServerHttpRequest get(); KieServerHttpRequest post(final String relativeUrl ); KieServerHttpRequest post(); KieServerHttpRequest put(final String relativeUrl ); KieServerHttpRequest put(); KieServerHttpRequest delete(final String relativeUrl ); KieServerHttpRequest delete(); KieServerHttpRequest ignoreCloseExceptions(final boolean ignore ); boolean ignoreCloseExceptions(); KieServerHttpRequest bufferSize(final int size ); int bufferSize(); KieServerHttpRequest setUncompress(final boolean uncompress ); KieServerHttpRequest followRedirects(final boolean followRedirects ); URI getUri(); KieServerHttpRequest timeout(final long timeoutInMilliseconds ); KieServerHttpRequest relativeRequest(String relativeUrlString, String httpMethod ); KieServerHttpRequest relativeRequest(String relativeUrlString ); KieServerHttpRequest disconnect(); KieServerHttpRequest resetStream(); KieServerHttpRequest followRedirets(final boolean followRedirects ); URL getUrl(); String getMethod(); String getHeader( final String name ); KieServerHttpRequest header(final String name, final Object value ); KieServerHttpRequest headers(final Map<String, String> headers ); List<String> getRequestHeader( String headerName ); KieServerHttpRequest acceptEncoding(final String acceptEncoding ); KieServerHttpRequest acceptCharset(final String acceptCharset ); KieServerHttpRequest basicAuthorization(final String name, final String password ); KieServerHttpRequest tokenAuthorization(final String token ); KieServerHttpRequest contentType(final String contentType ); KieServerHttpRequest contentType(final String contentType, final String charset ); KieServerHttpRequest accept(final String accept ); KieServerHttpRequest body(final CharSequence value ); OutputStreamWriter writer(); KieServerHttpRequest query(final Object name, final Object value ); KieServerHttpRequest query(final Map<?, ?> values ); KieServerHttpRequest form(final Object name, final Object value, String charset ); KieServerHttpRequest form(final Object name, final Object value ); KieServerHttpRequest form(final Map<?, ?> values, final String charset ); KieServerHttpRequest form(final Map<?, ?> values ); KieServerHttpResponse response(); KieServerHttpRequest trustAllCerts(); KieServerHttpRequest trustAllHosts(); static void setProxyHost( final String host ); static void setProxyPort( final int port ); static void setNonProxyHosts( final String... hosts ); KieServerHttpRequest useProxy(final String proxyHost, final int proxyPort ); KieServerHttpRequest proxyAuthorization(final String proxyAuthorization ); KieServerHttpRequest proxyBasic(final String name, final String password ); @Override String toString(); @Override KieServerHttpRequest clone(); static final String CHARSET_UTF8; static final String HEADER_PROXY_AUTHORIZATION; static final String HEADER_REFERER; static final String HEADER_SERVER; static final String PARAM_CHARSET; }