@SuppressWarnings("unchecked")
public void testRegisterCustomConverterListToListReverse() {
DefaultConversionService service = new DefaultConversionService();
service.addConverter("princy", new CustomTwoWayConverter());
ConversionExecutor executor = service.getConversionExecutor("princy", List.class, List.class);
final Principal princy1 = new Principal() {
public String getName() {
return "princy1";
}
};
final Principal princy2 = new Principal() {
public String getName() {
return "princy2";
}
};
List<Principal> princyList = new ArrayList<Principal>();
princyList.add(princy1);
princyList.add(princy2);
List<String> list = (List<String>) executor.execute(princyList);
assertEquals("princy1", list.get(0));
assertEquals("princy2", list.get(1));
}