use of org.killbill.billing.util.glue.TestUtilModuleNoDB.ShiroModuleNoDB in project killbill by killbill.
the class TestTenantModuleWithEmbeddedDB method configure.
@Override
public void configure() {
super.configure();
install(new GuicyKillbillTestWithEmbeddedDBModule(configSource, clock));
install(new NonEntityDaoModule(configSource));
install(new SecurityModule(configSource));
install(new ShiroModuleNoDB(configSource));
install(new MockAccountModule(configSource));
}
use of org.killbill.billing.util.glue.TestUtilModuleNoDB.ShiroModuleNoDB in project killbill by killbill.
the class TestPermissionAnnotationMethodInterceptor method testAOPForInterface.
@Test(groups = "fast")
public void testAOPForInterface() throws Exception {
// Make sure it works as expected without any AOP magic
final IAopTester simpleTester = new AopTesterImpl();
try {
simpleTester.createRefund();
} catch (Exception e) {
Assert.fail(e.getLocalizedMessage());
}
// Now, verify the interception works
configureShiro();
final Injector injector = Guice.createInjector(Stage.PRODUCTION, new ShiroModuleNoDB(configSource), new KillBillShiroAopModule(configSource), new TestSecurityModuleNoDB(configSource), new CacheModule(configSource), new AbstractModule() {
@Override
public void configure() {
bind(IDBI.class).toInstance(Mockito.mock(IDBI.class));
bind(IDBI.class).annotatedWith(Names.named(MAIN_RO_DATA_SOURCE_ID)).toInstance(Mockito.mock(IDBI.class));
bind(IAopTester.class).to(AopTesterImpl.class).asEagerSingleton();
bind(TenantInternalApi.class).toInstance(Mockito.mock(TenantInternalApi.class));
bind(NonEntityDao.class).toInstance(Mockito.mock(NonEntityDao.class));
}
});
final IAopTester aopedTester = injector.getInstance(IAopTester.class);
verifyAopedTester(aopedTester);
}
use of org.killbill.billing.util.glue.TestUtilModuleNoDB.ShiroModuleNoDB in project killbill by killbill.
the class TestPermissionAnnotationMethodInterceptor method testAOPForClass.
@Test(groups = "fast")
public void testAOPForClass() throws Exception {
// Make sure it works as expected without any AOP magic
final IAopTester simpleTester = new AopTester();
try {
simpleTester.createRefund();
} catch (Exception e) {
Assert.fail(e.getLocalizedMessage());
}
// Now, verify the interception works
configureShiro();
final Injector injector = Guice.createInjector(Stage.PRODUCTION, new ShiroModuleNoDB(configSource), new KillBillShiroAopModule(configSource), new TestSecurityModuleNoDB(configSource), new CacheModule(configSource), new AbstractModule() {
@Override
protected void configure() {
bind(IDBI.class).toInstance(Mockito.mock(IDBI.class));
bind(IDBI.class).annotatedWith(Names.named(MAIN_RO_DATA_SOURCE_ID)).toInstance(Mockito.mock(IDBI.class));
bind(TenantInternalApi.class).toInstance(Mockito.mock(TenantInternalApi.class));
bind(NonEntityDao.class).toInstance(Mockito.mock(NonEntityDao.class));
}
});
final AopTester aopedTester = injector.getInstance(AopTester.class);
verifyAopedTester(aopedTester);
}
use of org.killbill.billing.util.glue.TestUtilModuleNoDB.ShiroModuleNoDB in project killbill by killbill.
the class TestTenantModuleNoDB method configure.
@Override
public void configure() {
super.configure();
install(new GuicyKillbillTestNoDBModule(configSource, clock));
install(new MockNonEntityDaoModule(configSource));
install(new MockAccountModule(configSource));
install(new ShiroModuleNoDB(configSource));
install(new KillBillShiroAopModule(configSource));
install(new SecurityModule(configSource));
}
Aggregations