use of org.killbill.billing.util.glue.TestSecurityModuleNoDB 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();
// Shutdown the cache manager to avoid duplicate exceptions
CacheManager.getInstance().shutdown();
final Injector injector = Guice.createInjector(Stage.PRODUCTION, new ShiroModuleNoDB(configSource), new KillBillShiroAopModule(), new TestSecurityModuleNoDB(configSource), new AbstractModule() {
@Override
protected void configure() {
bind(IDBI.class).toInstance(Mockito.mock(IDBI.class));
}
});
final AopTester aopedTester = injector.getInstance(AopTester.class);
verifyAopedTester(aopedTester);
}
use of org.killbill.billing.util.glue.TestSecurityModuleNoDB 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();
// Shutdown the cache manager to avoid duplicate exceptions
CacheManager.getInstance().shutdown();
final Injector injector = Guice.createInjector(Stage.PRODUCTION, new ShiroModuleNoDB(configSource), new KillBillShiroAopModule(), new TestSecurityModuleNoDB(configSource), new AbstractModule() {
@Override
public void configure() {
bind(IDBI.class).toInstance(Mockito.mock(IDBI.class));
bind(IAopTester.class).to(AopTesterImpl.class).asEagerSingleton();
}
});
final IAopTester aopedTester = injector.getInstance(IAopTester.class);
verifyAopedTester(aopedTester);
}
Aggregations