@Test public void should_build_entity_dao() throws Exception { PropertyMeta idMeta = PropertyMetaTestBuilder // .completeBean(Void.class, Long.class) .field("id") .build(); EntityMeta entityMeta = new EntityMeta(); entityMeta.setClusteredEntity(false); entityMeta.setTableName("cf"); entityMeta.setIdMeta(idMeta); entityMeta.setIdClass(Long.class); entityMeta.setPropertyMetas(new HashMap<String, PropertyMeta>()); entityMetaMap.put(CompleteBean.class, entityMeta); builder.buildDao(cluster, keyspace, entityMetaMap, configContext, false); verify(daoFactory) .createDaosForEntity( eq(cluster), eq(keyspace), eq(configContext), eq(entityMeta), any(Map.class), any(Map.class)); }
@Test public void should_build_counter_dao() throws Exception { when(daoFactory.createCounterDao(cluster, keyspace, configContext)).thenReturn(counterDao); ThriftDaoContext context = builder.buildDao(cluster, keyspace, entityMetaMap, configContext, true); ThriftCounterDao counterDao = context.getCounterDao(); assertThat(counterDao).isSameAs(this.counterDao); }