@Test public void testGetUrl() { String url = "https: String expectedUrl = "https: String actualUrl = ""; try { actualUrl = webViewOverlay.getUrl(url, null); assertEquals(expectedUrl, actualUrl); } catch (WebViewOverlayException e) { assert (false); } }
public String getUrl(String baseUrl, HashMap<String, String> params) throws WebViewOverlayException { String finalUrl = null; if (baseUrl instanceof String) { if (params == null || params.isEmpty()) { return baseUrl; } else { finalUrl = baseUrl + "/?"; int counter = 0; for (Map.Entry<String, String>attrib: params.entrySet()) { counter++; finalUrl += attrib.getKey() +"=" + attrib.getValue(); if (counter < params.size()) { finalUrl += "&"; } } } } else { throw new WebViewOverlayException("Invalid URL passed into WebViewOverlay"); } return finalUrl; }
WebViewOverlay implements WebViewOverlayAPI { public String getUrl(String baseUrl, HashMap<String, String> params) throws WebViewOverlayException { String finalUrl = null; if (baseUrl instanceof String) { if (params == null || params.isEmpty()) { return baseUrl; } else { finalUrl = baseUrl + "/?"; int counter = 0; for (Map.Entry<String, String>attrib: params.entrySet()) { counter++; finalUrl += attrib.getKey() +"=" + attrib.getValue(); if (counter < params.size()) { finalUrl += "&"; } } } } else { throw new WebViewOverlayException("Invalid URL passed into WebViewOverlay"); } return finalUrl; } }
WebViewOverlay implements WebViewOverlayAPI { public String getUrl(String baseUrl, HashMap<String, String> params) throws WebViewOverlayException { String finalUrl = null; if (baseUrl instanceof String) { if (params == null || params.isEmpty()) { return baseUrl; } else { finalUrl = baseUrl + "/?"; int counter = 0; for (Map.Entry<String, String>attrib: params.entrySet()) { counter++; finalUrl += attrib.getKey() +"=" + attrib.getValue(); if (counter < params.size()) { finalUrl += "&"; } } } } else { throw new WebViewOverlayException("Invalid URL passed into WebViewOverlay"); } return finalUrl; } WebViewOverlay(Context context); }
WebViewOverlay implements WebViewOverlayAPI { public String getUrl(String baseUrl, HashMap<String, String> params) throws WebViewOverlayException { String finalUrl = null; if (baseUrl instanceof String) { if (params == null || params.isEmpty()) { return baseUrl; } else { finalUrl = baseUrl + "/?"; int counter = 0; for (Map.Entry<String, String>attrib: params.entrySet()) { counter++; finalUrl += attrib.getKey() +"=" + attrib.getValue(); if (counter < params.size()) { finalUrl += "&"; } } } } else { throw new WebViewOverlayException("Invalid URL passed into WebViewOverlay"); } return finalUrl; } WebViewOverlay(Context context); @Override void loadWebViewOverlay(String urlToBeLoaded, HashMap<String, String> params); @Override void loadWebViewOverlay(String urlToBeLoaded, HashMap<String, String> params, String popupTitle); String getUrl(String baseUrl, HashMap<String, String> params); }
WebViewOverlay implements WebViewOverlayAPI { public String getUrl(String baseUrl, HashMap<String, String> params) throws WebViewOverlayException { String finalUrl = null; if (baseUrl instanceof String) { if (params == null || params.isEmpty()) { return baseUrl; } else { finalUrl = baseUrl + "/?"; int counter = 0; for (Map.Entry<String, String>attrib: params.entrySet()) { counter++; finalUrl += attrib.getKey() +"=" + attrib.getValue(); if (counter < params.size()) { finalUrl += "&"; } } } } else { throw new WebViewOverlayException("Invalid URL passed into WebViewOverlay"); } return finalUrl; } WebViewOverlay(Context context); @Override void loadWebViewOverlay(String urlToBeLoaded, HashMap<String, String> params); @Override void loadWebViewOverlay(String urlToBeLoaded, HashMap<String, String> params, String popupTitle); String getUrl(String baseUrl, HashMap<String, String> params); static int LIB_VERSION; static String LIB_VERSION_NAME; }