use of org.pentaho.test.platform.engine.security.MockSecurityHelper in project data-access by pentaho.
the class DatasourceWebServicesSecurityTest method setUp.
@Before
public void setUp() throws Exception {
manager = new MockBackingRepositoryLifecycleManager(new MockSecurityHelper());
repo = context.mock(IUnifiedRepository.class);
booter = new MicroPlatform("target/test-classes/solution1");
booter.define(IPasswordService.class, KettlePasswordService.class, Scope.GLOBAL);
booter.define(IDatabaseConnection.class, DatabaseConnection.class, Scope.GLOBAL);
booter.define(IDatabaseDialectService.class, DatabaseDialectService.class, Scope.GLOBAL);
booter.define(IMondrianCatalogService.class, MondrianCatalogHelper.class, Scope.GLOBAL);
booter.define(ICacheManager.class, CacheManager.class, Scope.GLOBAL);
booter.defineInstance(IUserRoleListService.class, context.mock(IUserRoleListService.class));
final IAuthorizationPolicy policy = context.mock(IAuthorizationPolicy.class);
booter.defineInstance(IAuthorizationPolicy.class, policy);
booter.defineInstance(IUnifiedRepository.class, repo);
booter.setSettingsProvider(new SystemSettings());
booter.start();
context.checking(new Expectations() {
{
oneOf(policy);
will(returnValue(false));
oneOf(policy);
will(returnValue(false));
oneOf(policy);
will(returnValue(false));
}
});
PentahoSessionHolder.setStrategyName(PentahoSessionHolder.MODE_GLOBAL);
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_GLOBAL);
}
Aggregations