Search in sources :

Example 1 with DefaultNonEntityDao

use of org.killbill.billing.util.dao.DefaultNonEntityDao in project killbill by killbill.

the class TestKillbillJdbcTenantRealm method beforeMethod.

@Override
@BeforeMethod(groups = "slow")
public void beforeMethod() throws Exception {
    super.beforeMethod();
    // Create the tenant
    final DefaultTenantDao tenantDao = new DefaultTenantDao(dbi, clock, cacheControllerDispatcher, new DefaultNonEntityDao(dbi), Mockito.mock(InternalCallContextFactory.class), securityConfig);
    tenant = new DefaultTenant(UUID.randomUUID(), null, null, UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString());
    tenantDao.create(new TenantModelDao(tenant), internalCallContext);
    // Setup the security manager
    final HikariConfig dbConfig = new HikariConfig();
    dbConfig.setJdbcUrl(helper.getJdbcConnectionString());
    dbConfig.setUsername(helper.getUsername());
    dbConfig.setPassword(helper.getPassword());
    final KillbillJdbcTenantRealm jdbcRealm = new KillbillJdbcTenantRealm(shiroDataSource, securityConfig);
    jdbcRealm.setDataSource(new HikariDataSource(dbConfig));
    securityManager = new DefaultSecurityManager(jdbcRealm);
}
Also used : DefaultNonEntityDao(org.killbill.billing.util.dao.DefaultNonEntityDao) DefaultTenant(org.killbill.billing.tenant.api.DefaultTenant) HikariDataSource(com.zaxxer.hikari.HikariDataSource) TenantModelDao(org.killbill.billing.tenant.dao.TenantModelDao) HikariConfig(com.zaxxer.hikari.HikariConfig) DefaultSecurityManager(org.apache.shiro.mgt.DefaultSecurityManager) InternalCallContextFactory(org.killbill.billing.util.callcontext.InternalCallContextFactory) DefaultTenantDao(org.killbill.billing.tenant.dao.DefaultTenantDao) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

HikariConfig (com.zaxxer.hikari.HikariConfig)1 HikariDataSource (com.zaxxer.hikari.HikariDataSource)1 DefaultSecurityManager (org.apache.shiro.mgt.DefaultSecurityManager)1 DefaultTenant (org.killbill.billing.tenant.api.DefaultTenant)1 DefaultTenantDao (org.killbill.billing.tenant.dao.DefaultTenantDao)1 TenantModelDao (org.killbill.billing.tenant.dao.TenantModelDao)1 InternalCallContextFactory (org.killbill.billing.util.callcontext.InternalCallContextFactory)1 DefaultNonEntityDao (org.killbill.billing.util.dao.DefaultNonEntityDao)1 BeforeMethod (org.testng.annotations.BeforeMethod)1