public DefaultOverduePosterBase(final NotificationQueueService notificationQueueService, final IDBI dbi, final Clock clock, final CacheControllerDispatcher cacheControllerDispatcher, final NonEntityDao nonEntityDao) { this.notificationQueueService = notificationQueueService; this.transactionalSqlDao = new EntitySqlDaoTransactionalJdbiWrapper(dbi, clock, cacheControllerDispatcher, nonEntityDao); }
public DefaultBlockingStateDao(final IDBI dbi, final Clock clock, final CacheControllerDispatcher cacheControllerDispatcher, final NonEntityDao nonEntityDao) { super(new EntitySqlDaoTransactionalJdbiWrapper(dbi, clock, cacheControllerDispatcher, nonEntityDao), BlockingStateSqlDao.class); this.clock = clock; }
@Inject public DefaultTagDefinitionDao(final IDBI dbi, final TagEventBuilder tagEventBuilder, final PersistentBus bus, final Clock clock, final CacheControllerDispatcher controllerDispatcher, final NonEntityDao nonEntityDao) { super(new EntitySqlDaoTransactionalJdbiWrapper(dbi, clock, controllerDispatcher, nonEntityDao), TagDefinitionSqlDao.class); this.tagEventBuilder = tagEventBuilder; this.bus = bus; }
@Inject public DefaultCustomFieldDao(final IDBI dbi, final Clock clock, final CacheControllerDispatcher controllerDispatcher, final NonEntityDao nonEntityDao, final PersistentBus bus) { super(new EntitySqlDaoTransactionalJdbiWrapper(dbi, clock, controllerDispatcher, nonEntityDao), CustomFieldSqlDao.class); this.bus = bus; }
@Inject public DefaultTagDao(final IDBI dbi, final TagEventBuilder tagEventBuilder, final PersistentBus bus, final Clock clock, final CacheControllerDispatcher controllerDispatcher, final NonEntityDao nonEntityDao) { super(new EntitySqlDaoTransactionalJdbiWrapper(dbi, clock, controllerDispatcher, nonEntityDao), TagSqlDao.class); this.tagEventBuilder = tagEventBuilder; this.bus = bus; }
@Inject public DefaultTenantDao(final IDBI dbi, final Clock clock, final CacheControllerDispatcher cacheControllerDispatcher, final NonEntityDao nonEntityDao) { super(new EntitySqlDaoTransactionalJdbiWrapper(dbi, clock, cacheControllerDispatcher, nonEntityDao), TenantSqlDao.class); }
@Inject public DefaultAuditDao(final IDBI dbi, final Clock clock, final CacheControllerDispatcher cacheControllerDispatcher, final NonEntityDao nonEntityDao) { this.nonEntitySqlDao = dbi.onDemand(NonEntitySqlDao.class); this.transactionalSqlDao = new EntitySqlDaoTransactionalJdbiWrapper(dbi, clock, cacheControllerDispatcher, nonEntityDao); }
@Inject public DefaultPaymentDao(final IDBI dbi, final Clock clock, final CacheControllerDispatcher cacheControllerDispatcher, final NonEntityDao nonEntityDao) { this.transactionalSqlDao = new EntitySqlDaoTransactionalJdbiWrapper(dbi, clock, cacheControllerDispatcher, nonEntityDao); this.paginationHelper = new DefaultPaginationSqlDaoHelper(transactionalSqlDao); }
@Inject public DefaultInvoiceDao(final IDBI dbi, final NextBillingDatePoster nextBillingDatePoster, final PersistentBus eventBus, final Clock clock, final CacheControllerDispatcher cacheControllerDispatcher, final NonEntityDao nonEntityDao, final InternalCallContextFactory internalCallContextFactory) { super(new EntitySqlDaoTransactionalJdbiWrapper(dbi, clock, cacheControllerDispatcher, nonEntityDao), InvoiceSqlDao.class); this.nextBillingDatePoster = nextBillingDatePoster; this.eventBus = eventBus; this.internalCallContextFactory = internalCallContextFactory; this.invoiceDaoHelper = new InvoiceDaoHelper(); this.cbaDao = new CBADao(); }
@Override @BeforeMethod(groups = "slow") public void beforeMethod() throws Exception { super.beforeMethod(); entitySqlDaoTransactionalJdbiWrapper = new EntitySqlDaoTransactionalJdbiWrapper(dbi, clock, cacheControllerDispatcher, nonEntityDao); overdueQueue = notificationQueueService.getNotificationQueue(DefaultOverdueService.OVERDUE_SERVICE_NAME, OverdueCheckNotifier.OVERDUE_CHECK_NOTIFIER_QUEUE); Assert.assertTrue(overdueQueue.isStarted()); testReferenceTime = clock.getUTCNow(); }
@Test(groups = "slow") public void testCacheRecordId() throws Exception { this.transactionalSqlDao = new EntitySqlDaoTransactionalJdbiWrapper(dbi, clock, controlCacheDispatcher, nonEntityDao); final TagModelDao tag = new TagModelDao(clock.getUTCNow(), UUID.randomUUID(), UUID.randomUUID(), ObjectType.TAG); // Verify we start with nothing in the cache Assert.assertEquals(getCacheSize(), 0); insertTag(tag); // Verify we still have nothing after insert in the cache Assert.assertEquals(getCacheSize(), 0); final Long tagRecordId = getTagRecordId(tag.getId()); // Verify we now have something in the cache Assert.assertEquals(getCacheSize(), 1); final Long recordIdFromCache = retrieveRecordIdFromCache(tag.getId()); Assert.assertNotNull(recordIdFromCache); Assert.assertEquals(recordIdFromCache, new Long(1)); Assert.assertEquals(tagRecordId, new Long(1)); Assert.assertEquals(getCacheSize(), 1); } }