Пример #1
0
  @Test
  public void testBeanMappingBuilder() throws Exception {
    DozerBeanMapper mapper =
        (DozerBeanMapper) context.getBean("factoryWithMappingBuilder", DozerBeanMapper.class);

    Source source = new Source();
    source.setName("John");
    source.setId(2L);
    Destination destination = mapper.map(source, Destination.class);
    assertEquals("John", destination.getValue());
    assertEquals(2L, destination.getId());
  }
Пример #2
0
 private void assertBasicMapping(Mapper mapper) {
   Source source = new Source();
   source.setId(1L);
   Destination destination = mapper.map(source, Destination.class);
   assertEquals(1L, destination.getId());
 }