@Test
public void mapToTest() throws Exception {
RESTEasyContextMapper rcm = new RESTEasyContextMapper();
RESTEasyBindingData rbd = new RESTEasyBindingData();
Context context = new DefaultContext();
context.setProperty("one", Integer.valueOf(1));
rcm.mapTo(context, rbd);
Iterator<Map.Entry<String, List<String>>> entries = rbd.getHeaders().entrySet().iterator();
while (entries.hasNext()) {
Map.Entry<String, List<String>> entry = entries.next();
List<String> values = entry.getValue();
Assert.assertTrue(values.size() == 1);
Assert.assertTrue(entry.getKey().equals("one"));
Assert.assertTrue(values.get(0).equals("1"));
}
RESTEasyBindingData rbd2 = new RESTEasyBindingData();
context.removeProperties();
List<Integer> list = new ArrayList<Integer>();
list.add(Integer.valueOf(1));
list.add(Integer.valueOf(2));
list.add(Integer.valueOf(3));
context.setProperty("numbers", list);
rcm.mapTo(context, rbd2);
entries = rbd2.getHeaders().entrySet().iterator();
while (entries.hasNext()) {
Map.Entry<String, List<String>> entry = entries.next();
List<String> values = entry.getValue();