@Test public void testBaseUrlPassword() { m_genericURLConnection = new StubGenericURLConnection(m_baseUrl); assertNull("Test base URL", m_genericURLConnection.getPassword()); }
protected String getPassword() { String userInfo = this.m_url.getUserInfo(); if (userInfo != null) { if (userInfo.contains(USERINFO_DELIMITER)) { String[] userPass = userInfo.split(USERINFO_DELIMITER); return userPass[1]; } else { logger.warn("Only user name without password configured. Return empty string as password"); return EMPTY_STRING; } } else { logger.warn("No credentials for URL connection configured."); return null; } }
GenericURLConnection extends URLConnection { protected String getPassword() { String userInfo = this.m_url.getUserInfo(); if (userInfo != null) { if (userInfo.contains(USERINFO_DELIMITER)) { String[] userPass = userInfo.split(USERINFO_DELIMITER); return userPass[1]; } else { logger.warn("Only user name without password configured. Return empty string as password"); return EMPTY_STRING; } } else { logger.warn("No credentials for URL connection configured."); return null; } } }
GenericURLConnection extends URLConnection { protected String getPassword() { String userInfo = this.m_url.getUserInfo(); if (userInfo != null) { if (userInfo.contains(USERINFO_DELIMITER)) { String[] userPass = userInfo.split(USERINFO_DELIMITER); return userPass[1]; } else { logger.warn("Only user name without password configured. Return empty string as password"); return EMPTY_STRING; } } else { logger.warn("No credentials for URL connection configured."); return null; } } protected  GenericURLConnection(URL url); }
GenericURLConnection extends URLConnection { protected String getPassword() { String userInfo = this.m_url.getUserInfo(); if (userInfo != null) { if (userInfo.contains(USERINFO_DELIMITER)) { String[] userPass = userInfo.split(USERINFO_DELIMITER); return userPass[1]; } else { logger.warn("Only user name without password configured. Return empty string as password"); return EMPTY_STRING; } } else { logger.warn("No credentials for URL connection configured."); return null; } } protected  GenericURLConnection(URL url);  }
GenericURLConnection extends URLConnection { protected String getPassword() { String userInfo = this.m_url.getUserInfo(); if (userInfo != null) { if (userInfo.contains(USERINFO_DELIMITER)) { String[] userPass = userInfo.split(USERINFO_DELIMITER); return userPass[1]; } else { logger.warn("Only user name without password configured. Return empty string as password"); return EMPTY_STRING; } } else { logger.warn("No credentials for URL connection configured."); return null; } } protected  GenericURLConnection(URL url);   }