UrlUtils { public static TreeMap<String, String> getQueryParams(URI uri, boolean decode) { return getQueryParams(uri.getRawQuery(), decode); } private  UrlUtils(); static TreeMap<String, String> getQueryParams(URI uri, boolean decode); static TreeMap<String, String> getQueryParams(String paramsString, boolean decode); static String urlEncode(String s); static String urlDecode(String s); static String percentEncode(String s); static final String UTF8; }
@Test public void testGetQueryParams_allParamsDecode() { final TreeMap<String, String> params = UrlUtils.getQueryParams(QUERY_PARAMS, true); assertDecodedValue(params); }
@Test public void testGetQueryParams_allParamsNotDecode() { final TreeMap<String, String> params = UrlUtils.getQueryParams(QUERY_PARAMS, false); assertNotDecodedValue(params); }
@Test public void testURIParams_allParamsDecode() { final TreeMap<String, String> params = UrlUtils.getQueryParams(URI_WITH_PARAMS, true); assertDecodedValue(params); }
@Test public void testURIParams_allParamsNotDecode() { final TreeMap<String, String> params = UrlUtils.getQueryParams(URI_WITH_PARAMS, false); assertNotDecodedValue(params); }
@Test public void testGetQueryParams_nullDecode() { final TreeMap<String, String> params = UrlUtils.getQueryParams(EMPTY_PARAM_VALUE, true); assertNotNull(params); assertEquals(0, params.size()); }
@Test public void testGetQueryParams_nullNotDecode() { final TreeMap<String, String> params = UrlUtils.getQueryParams(EMPTY_PARAM_VALUE, false); assertNotNull(params); assertEquals(0, params.size()); }