@Test public void one_entry_no_value() { Map<String, String> map = converterToTest.convertToMap("mail.smtp.auth="); assertConfig(map).without("mail.smtp.auth"); }
public Map<String,String> convertToMap(String smtpConfigString) { Map<String,String> map = new TreeMap<>(); if (smtpConfigString==null) { return map; } String[] splitted = smtpConfigString.split(","); for (String splitter: splitted) { String[] keyValuePair = splitter.split("="); if (keyValuePair==null || keyValuePair.length!=2) { continue; } String key= keyValuePair[0]; String value= keyValuePair[1]; if (key==null || value==null) { continue; } map.put(key.trim(), value.trim()); } return map; }
SMTPConfigStringToMapConverter { public Map<String,String> convertToMap(String smtpConfigString) { Map<String,String> map = new TreeMap<>(); if (smtpConfigString==null) { return map; } String[] splitted = smtpConfigString.split(","); for (String splitter: splitted) { String[] keyValuePair = splitter.split("="); if (keyValuePair==null || keyValuePair.length!=2) { continue; } String key= keyValuePair[0]; String value= keyValuePair[1]; if (key==null || value==null) { continue; } map.put(key.trim(), value.trim()); } return map; } }
SMTPConfigStringToMapConverter { public Map<String,String> convertToMap(String smtpConfigString) { Map<String,String> map = new TreeMap<>(); if (smtpConfigString==null) { return map; } String[] splitted = smtpConfigString.split(","); for (String splitter: splitted) { String[] keyValuePair = splitter.split("="); if (keyValuePair==null || keyValuePair.length!=2) { continue; } String key= keyValuePair[0]; String value= keyValuePair[1]; if (key==null || value==null) { continue; } map.put(key.trim(), value.trim()); } return map; }  }
SMTPConfigStringToMapConverter { public Map<String,String> convertToMap(String smtpConfigString) { Map<String,String> map = new TreeMap<>(); if (smtpConfigString==null) { return map; } String[] splitted = smtpConfigString.split(","); for (String splitter: splitted) { String[] keyValuePair = splitter.split("="); if (keyValuePair==null || keyValuePair.length!=2) { continue; } String key= keyValuePair[0]; String value= keyValuePair[1]; if (key==null || value==null) { continue; } map.put(key.trim(), value.trim()); } return map; }  Map<String,String> convertToMap(String smtpConfigString); }
SMTPConfigStringToMapConverter { public Map<String,String> convertToMap(String smtpConfigString) { Map<String,String> map = new TreeMap<>(); if (smtpConfigString==null) { return map; } String[] splitted = smtpConfigString.split(","); for (String splitter: splitted) { String[] keyValuePair = splitter.split("="); if (keyValuePair==null || keyValuePair.length!=2) { continue; } String key= keyValuePair[0]; String value= keyValuePair[1]; if (key==null || value==null) { continue; } map.put(key.trim(), value.trim()); } return map; }  Map<String,String> convertToMap(String smtpConfigString);  }