use of org.pentaho.platform.engine.core.system.SimpleMapCacheManager in project pentaho-platform by pentaho.
the class SpringSecurityPrincipalProvider_Caching_Test method setUp.
@Before
public void setUp() throws Exception {
userResolver = mock(ITenantedPrincipleNameResolver.class);
roleResolver = mock(ITenantedPrincipleNameResolver.class);
cacheManager = spy(new SimpleMapCacheManager());
doReturn(false).when(cacheManager).cacheEnabled(USER_CACHE_REGION);
doReturn(false).when(cacheManager).cacheEnabled(ROLE_CACHE_REGION);
userTenant = new Tenant(USER_PRINCIPLE, true);
roleTenant = new Tenant(ROLE_PRINCIPLE, true);
mp = new MicroPlatform(getSolutionPath());
mp.defineInstance("tenantedUserNameUtils", userResolver);
mp.defineInstance("tenantedRoleNameUtils", roleResolver);
mp.defineInstance(ICacheManager.class, cacheManager);
mp.start();
provider = new SpringSecurityPrincipalProvider();
provider.init(new Properties());
provider = spy(provider);
User user = new User(USER_PRINCIPLE, "", true, true, true, true, new ArrayList<GrantedAuthority>());
doReturn(user).when(provider).internalGetUserDetails(USER_PRINCIPLE);
}
Aggregations