use of org.simpleflatmapper.jooq.JooqRecordMapperWrapper in project SimpleFlatMapper by arnaudroger.
the class JooqMapperTest method testCacheMapper.
@Test
@SuppressWarnings("unchecked")
public void testCacheMapper() {
SfmRecordMapperProvider recordMapperProvider = new SfmRecordMapperProvider();
RecordType rt = mock(RecordType.class);
Field field1 = mock(Field.class);
when(field1.getName()).thenReturn("id");
when(field1.getType()).thenReturn(long.class);
when(rt.size()).thenReturn(1);
when(rt.fields()).thenReturn(new Field[] { field1 });
JooqRecordMapperWrapper provider1 = (JooqRecordMapperWrapper) recordMapperProvider.<Record, DbObject>provide(rt, DbObject.class);
JooqRecordMapperWrapper provider2 = (JooqRecordMapperWrapper) recordMapperProvider.<Record, DbObject>provide(rt, DbObject.class);
assertSame(provider1.getMapper(), provider2.getMapper());
}
Aggregations