@Test
public void testFieldCustomConverter_HashMapField() throws Exception {
// Test that custom field converter works for Map type fields
mapper = getMapper(new String[] { "fieldCustomConverter.xml" });
MapToProperty src = newInstance(MapToProperty.class);
Map<String, String> hashMap = newInstance(HashMap.class);
hashMap.put("fieldA", "someStringValue");
src.setHashMap(hashMap);
SimpleObj dest = mapper.map(src, SimpleObj.class);
// Custom converter specified for the field1 mapping, so verify custom converter was actually used
assertNotNull("dest field1 should not be null", dest.getField1());
StringTokenizer st = new StringTokenizer(dest.getField1(), "-");
assertEquals("dest field1 value should contain a hyphon", 2, st.countTokens());
String token1 = st.nextToken();
assertEquals("1st portion of dest field1 value should equal src field value", src.getHashMap().get("fieldA"), token1);
String token2 = st.nextToken();
assertEquals("dest field1 value should have been appended to by the cust converter",
StringAppendCustomConverter.APPENDED_VALUE, token2);
}