*
*/
@Test
public void testResolveTypes2() {
MapperFacade mapper = new MyMapper();
Source src = new Source();
src.name = "source 1";
src.description = "source 1 description";
SourceChild srcChild = new SourceChild();
srcChild.name = "source 1";
srcChild.description = "source 1 description";
/*
* Mapping Source to Dest2 causes a mapping to be created
*/
Dest2 dest2 = mapper.map(src, Dest2.class);
/*
* SourceChild is able to use this mapping, so the resolved
* type in this case for SourceChild is 'Source', which
* gets cached in resolvedTypes
*/
Dest2 dest2B = mapper.map(srcChild, Dest2.class);
Assert.assertNotNull(dest2);
Assert.assertNotNull(dest2B);
/*
* But now, since the resolvedType for 'SourceChild' has
* been cached as 'Source', it cannot find the converter
* which has been specifically created for 'SourceChild'
*/
Dest1 dest1 = mapper.map(srcChild, Dest1.class);
Assert.assertNotNull(dest1);
}