### Question:
MapInjectionResolver extends InjectionResolver<Param> { static Properties convertStringToProperties(String propsString, char sep) { final Properties properties = new Properties(); if (propsString != null) { ParamTokenizer stoken = new ParamTokenizer(propsString, sep); while (stoken.hasMoreTokens()) { String token = stoken.nextTokenKeepEscapes(); final ParamTokenizer nameTok = new ParamTokenizer(token, '='); String name = null, value = null; if (nameTok.hasMoreTokens()) name = nameTok.nextToken().trim(); if (nameTok.hasMoreTokens()) value = nameTok.nextToken(); if (name == null) throw new IllegalArgumentException( localStrings.getLocalString("PropertyMissingName", "Invalid property syntax, missing property name", propsString)); if (value == null) throw new IllegalArgumentException( localStrings.getLocalString("PropertyMissingValue", "Invalid property syntax, missing property value", token)); if (nameTok.hasMoreTokens()) throw new IllegalArgumentException( localStrings.getLocalString("PropertyExtraEquals", "Invalid property syntax, \"=\" in value", token)); properties.setProperty(name, value); } } return properties; } MapInjectionResolver(CommandModel model,
					ParameterMap parameters);  MapInjectionResolver(CommandModel model,
					ParameterMap parameters,
                                        final MultiMap<String,File> optionNameToUploadedFileMap); void setContext(ExecutionContext context); @Override boolean isOptional(AnnotatedElement element, Param annotation); @Override V getValue(Object component, AnnotatedElement target, Type genericType, Class<V> type); static String getUploadedFileParamValue(final String fieldName,
                final Class fieldType,
                final MultiMap<String,File> optionNameToFileMap); static List<String> getUploadedFileParamValues(
                final String fieldName,
                final Class fieldType,
                final MultiMap<String,File> optionNameToFileMap); static Object convertListToObject(AnnotatedElement target,
                                    Class type, List<String> paramValList); static final LocalStringManagerImpl localStrings; }### Answer:
@Test public void convertStringToPropertiesTest() { String propsStr = "prop1=valA:prop2=valB:prop3=valC"; Properties propsExpected = new Properties(); propsExpected.put("prop1", "valA"); propsExpected.put("prop2", "valB"); propsExpected.put("prop3", "valC"); Properties propsActual = MapInjectionResolver.convertStringToProperties(propsStr, ':'); assertEquals(propsExpected, propsActual); }
@Test public void parsePropertiesEscapeCharTest() { String propsStr = "connectionAttributes=\\;create\\\\\\=true"; Properties propsExpected = new Properties(); propsExpected.put("connectionAttributes", ";create\\=true"); Properties propsActual = null; propsActual = MapInjectionResolver.convertStringToProperties(propsStr, ':'); assertEquals(propsExpected, propsActual); }
@Test public void parsePropertiesEscapeCharTest2() { String propsStr = "connectionAttributes=;create\\=true"; Properties propsExpected = new Properties(); propsExpected.put("connectionAttributes", ";create=true"); Properties propsActual = null; propsActual = MapInjectionResolver.convertStringToProperties(propsStr, ':'); assertEquals(propsExpected, propsActual); }
@Test public void parsePropertiesQuoteTest() { String propsStr = "java.naming.provider.url=\"ldap: "java.naming.security.authentication=simple:" + "java.naming.security.credentials=changeit:" + "java.naming.security.principal=\"uid=admin,ou=People," + "o=foo,o=something\""; Properties propsExpected = new Properties(); propsExpected.put("java.naming.provider.url", "ldap: propsExpected.put("java.naming.security.authentication", "simple"); propsExpected.put("java.naming.security.credentials", "changeit"); propsExpected.put("java.naming.security.principal", "uid=admin,ou=People,o=foo,o=something"); Properties propsActual = MapInjectionResolver.convertStringToProperties(propsStr, ':'); assertEquals(propsExpected, propsActual); }