Пример #1
0
 @Test
 public void testMapOfEnum() {
   DefaultMapperFactory.Builder builder = new DefaultMapperFactory.Builder();
   MapperFactory factory = builder.build();
   MapperFacade mapperFacade = factory.getMapperFacade();
   Entity entity = new Entity();
   entity.setState(State.B);
   final Dto dto = mapperFacade.map(entity, Dto.class);
   Assert.assertEquals(dto.getState(), entity.getState());
 }
Пример #2
0
  @BeforeClass
  public static void init() {

    DefaultMapperFactory.Builder factoryBuilder = new DefaultMapperFactory.Builder();
    factoryBuilder.compilerStrategy(new EclipseJdtCompilerStrategy());
    MapperFactory factory = factoryBuilder.build();

    factory.getConverterFactory().registerConverter(new Converter.Object2String());
    factory.getConverterFactory().registerConverter(new Converter.String2Object());

    mapper = factory.getMapperFacade();
  }