use of example.CoerceBean in project elide by yahoo.
the class EntityDictionaryTest method testCoerce.
@Test
public void testCoerce() throws Exception {
bindEntity(CoerceBean.class);
CoerceBean bean = new CoerceBean();
setValue(bean, "string", 1L);
setValue(bean, "list", ImmutableSet.of(true, false));
setValue(bean, "map", ImmutableMap.of("one", "1", "two", "2"));
setValue(bean, "set", ImmutableList.of(3L, 4L));
assertEquals("1", bean.string);
assertEquals(Arrays.asList(true, false), bean.list);
assertEquals(ImmutableMap.of("one", 1L, "two", 2L), bean.map);
assertEquals(ImmutableSet.of(3.0, 4.0), bean.set);
}
Aggregations