assertEquals(2, dest.size());
}
@Test
public void testDozerMultiTypeMapContainingCollections() throws Exception {
DozerBeanMapper dozerBeanMapper = new DozerBeanMapper();
// Setting up test data, multiple types in a single Map
DozerExampleEntry entry = new DozerExampleEntry();
{
entry.getMap().put("A", "foobar");
entry.getMap().put("B", new Date(0));
entry.getMap().put("C", Boolean.TRUE);
// This array list will produce the problem
// Remove it and the test case will succeed
ArrayList<String> genericList = new ArrayList<String>();
genericList.add("something");
entry.getMap().put("D", genericList);
entry.getMap().put("E", new BigDecimal("0.00"));
}
DozerExampleEntry mapped = dozerBeanMapper.map(entry, DozerExampleEntry.class);
// All the fields which are visited/mapped before the
// ArrayList are mapped successfully and to correct type
assertEquals("foobar", mapped.getMap().get("A"));
assertEquals(new Date(0), mapped.getMap().get("B"));