use of org.simpleflatmapper.reflect.getter.UUIDUnspecifiedTypeGetter in project SimpleFlatMapper by arnaudroger.
the class UUIDUnspecifiedTypeGetterTest method test.
@Test
public void test() throws Exception {
UUID uuid = UUID.randomUUID();
@SuppressWarnings("unchecked") Getter<Object, Object> subGetter = mock(Getter.class);
UUIDUnspecifiedTypeGetter<Object> getter = new UUIDUnspecifiedTypeGetter<Object>(subGetter);
when(subGetter.get(any())).thenReturn(uuid.toString(), UUIDHelper.toBytes(uuid), new ByteArrayInputStream(UUIDHelper.toBytes(uuid)), new Date());
assertEquals(uuid, getter.get(null));
assertEquals(uuid, getter.get(null));
assertEquals(uuid, getter.get(null));
try {
getter.get(null);
fail();
} catch (IllegalArgumentException e) {
}
getter.toString();
}
Aggregations