@Test public void testBaseUrlUsername() { m_genericURLConnection = new StubGenericURLConnection(m_baseUrl); assertNull("Test user URL", m_genericURLConnection.getUsername()); }
protected String getUsername() { String userInfo = this.m_url.getUserInfo(); if (userInfo != null) { if (userInfo.contains(USERINFO_DELIMITER)) { String[] userName = userInfo.split(USERINFO_DELIMITER); return userName[0]; } else { logger.warn("Only user name without password configured. Return user info: '{}'", userInfo); return userInfo; } } else { logger.warn("No credentials for URL connection configured."); return null; } }
GenericURLConnection extends URLConnection { protected String getUsername() { String userInfo = this.m_url.getUserInfo(); if (userInfo != null) { if (userInfo.contains(USERINFO_DELIMITER)) { String[] userName = userInfo.split(USERINFO_DELIMITER); return userName[0]; } else { logger.warn("Only user name without password configured. Return user info: '{}'", userInfo); return userInfo; } } else { logger.warn("No credentials for URL connection configured."); return null; } } }
GenericURLConnection extends URLConnection { protected String getUsername() { String userInfo = this.m_url.getUserInfo(); if (userInfo != null) { if (userInfo.contains(USERINFO_DELIMITER)) { String[] userName = userInfo.split(USERINFO_DELIMITER); return userName[0]; } else { logger.warn("Only user name without password configured. Return user info: '{}'", userInfo); return userInfo; } } else { logger.warn("No credentials for URL connection configured."); return null; } } protected  GenericURLConnection(URL url); }
GenericURLConnection extends URLConnection { protected String getUsername() { String userInfo = this.m_url.getUserInfo(); if (userInfo != null) { if (userInfo.contains(USERINFO_DELIMITER)) { String[] userName = userInfo.split(USERINFO_DELIMITER); return userName[0]; } else { logger.warn("Only user name without password configured. Return user info: '{}'", userInfo); return userInfo; } } else { logger.warn("No credentials for URL connection configured."); return null; } } protected  GenericURLConnection(URL url);  }
GenericURLConnection extends URLConnection { protected String getUsername() { String userInfo = this.m_url.getUserInfo(); if (userInfo != null) { if (userInfo.contains(USERINFO_DELIMITER)) { String[] userName = userInfo.split(USERINFO_DELIMITER); return userName[0]; } else { logger.warn("Only user name without password configured. Return user info: '{}'", userInfo); return userInfo; } } else { logger.warn("No credentials for URL connection configured."); return null; } } protected  GenericURLConnection(URL url);   }