use of org.simpleflatmapper.map.property.RenameProperty in project SimpleFlatMapper by arnaudroger.
the class AbstractMapperFactoryTest method testAliases.
@Test
public void testAliases() {
MapperFactory mapperFactory = new MapperFactory();
mapperFactory.addAlias("a", "aa");
mapperFactory.addAliases(new HashMap<String, String>() {
{
put("b", "bb");
put("c", "cc");
}
});
Assert.assertArrayEquals(new Object[] { new RenameProperty("aa") }, mapperFactory.columnDefinitions().getColumnDefinition(new SampleFieldKey("a", 0)).properties());
Assert.assertArrayEquals(new Object[] { new RenameProperty("bb") }, mapperFactory.columnDefinitions().getColumnDefinition(new SampleFieldKey("b", 0)).properties());
Assert.assertArrayEquals(new Object[] { new RenameProperty("cc") }, mapperFactory.columnDefinitions().getColumnDefinition(new SampleFieldKey("c", 0)).properties());
Assert.assertArrayEquals(new Object[] {}, mapperFactory.columnDefinitions().getColumnDefinition(new SampleFieldKey("d", 0)).properties());
}
Aggregations