public class Issue68TestCase {
@Test
public void testSimpleReverceCase() {
ConfigurableMapper mapper = new ConfigurableMapper() {
@Override
public void configure(MapperFactory mapperFactory) {
mapperFactory.classMap(InvoiceItem.class, InvoiceItemVO.class).byDefault().register();
mapperFactory.classMap(ProjectItem.class, ProjectItemVO.class).byDefault().register();
mapperFactory.classMap(Project.class, ProjectVO.class).byDefault().register();
}
};
ProjectVO projectVO = new ProjectVO();
ProjectItemVO projectItemVO = new ProjectItemVO();
InvoiceItemVO invoiceitemVO = new InvoiceItemVO();
projectItemVO.project = projectVO;
invoiceitemVO.project = projectVO;
projectVO.getProjectItems().add(projectItemVO);
projectVO.name = "Great project";
projectItemVO.getInvoiceItems().add(invoiceitemVO);
invoiceitemVO.getProjectItems().add(projectItemVO);
InvoiceItemProxy invoiceItemProxy = BeanFactory
.createInvoiceItemProxy();
mapper.map(invoiceitemVO, invoiceItemProxy);
}