本文整理汇总了Java中org.ligoj.app.iam.IamConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java IamConfiguration类的具体用法?Java IamConfiguration怎么用?Java IamConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IamConfiguration类属于org.ligoj.app.iam包,在下文中一共展示了IamConfiguration类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: prepareData
import org.ligoj.app.iam.IamConfiguration; //导入依赖的package包/类
@Before
public void prepareData() throws IOException {
persistEntities("csv",
new Class[] { DelegateOrg.class, ContainerScope.class, CacheCompany.class, CacheUser.class, CacheGroup.class, CacheMembership.class },
StandardCharsets.UTF_8.name());
CacheManager.getInstance().getCache("container-scopes").removeAll();
iamProvider = Mockito.mock(IamProvider.class);
final IamConfiguration configuration = Mockito.mock(IamConfiguration.class);
Mockito.when(iamProvider.getConfiguration()).thenReturn(configuration);
userRepository = Mockito.mock(IUserRepository.class);
groupRepository = Mockito.mock(IGroupRepository.class);
companyRepository = Mockito.mock(ICompanyRepository.class);
Mockito.when(configuration.getUserRepository()).thenReturn(userRepository);
Mockito.when(configuration.getCompanyRepository()).thenReturn(companyRepository);
Mockito.when(configuration.getGroupRepository()).thenReturn(groupRepository);
}
开发者ID:ligoj,项目名称:plugin-id,代码行数:18,代码来源:AbstractContainerResourceTest.java
示例2: prepareData
import org.ligoj.app.iam.IamConfiguration; //导入依赖的package包/类
@Before
public void prepareData() throws IOException {
persistEntities("csv",
new Class[] { DelegateOrg.class, CacheCompany.class, CacheGroup.class, CacheUser.class, CacheMembership.class },
StandardCharsets.UTF_8.name());
iamProvider = Mockito.mock(IamProvider.class);
final IamConfiguration configuration = Mockito.mock(IamConfiguration.class);
Mockito.when(iamProvider.getConfiguration()).thenReturn(configuration);
userRepository = Mockito.mock(IUserRepository.class);
groupRepository = Mockito.mock(IGroupRepository.class);
companyRepository = Mockito.mock(ICompanyRepository.class);
Mockito.when(configuration.getUserRepository()).thenReturn(userRepository);
Mockito.when(configuration.getCompanyRepository()).thenReturn(companyRepository);
Mockito.when(configuration.getGroupRepository()).thenReturn(groupRepository);
resource = new UserOrgResource();
applicationContext.getAutowireCapableBeanFactory().autowireBean(resource);
resource.setIamProvider(new IamProvider[] { iamProvider });
Mockito.when(companyRepository.getTypeName()).thenReturn("company");
}
开发者ID:ligoj,项目名称:plugin-id,代码行数:20,代码来源:UserOrgResourceTest.java
示例3: getConfiguration
import org.ligoj.app.iam.IamConfiguration; //导入依赖的package包/类
@Override
public IamConfiguration getConfiguration(final String node) {
final IamConfiguration configuration = new IamConfiguration();
final UserLdapRepository repository = getUserLdapRepositoryInternal(node);
configuration.setUserRepository(repository);
configuration.setCompanyRepository(newCompanyLdapRepository(node, repository.getTemplate()));
configuration.setGroupRepository(newGroupLdapRepository(node, repository.getTemplate()));
repository.setCompanyRepository((CompanyLdapRepository) configuration.getCompanyRepository());
repository.setGroupLdapRepository((GroupLdapRepository) configuration.getGroupRepository());
return configuration;
}
开发者ID:ligoj,项目名称:plugin-id-ldap,代码行数:12,代码来源:LdapPluginResource.java
示例4: getConfiguration
import org.ligoj.app.iam.IamConfiguration; //导入依赖的package包/类
@Override
@CacheResult(cacheName = "iam-node-configuration")
public IamConfiguration getConfiguration() {
final String primary = getPrimary();
return servicePluginLocator.getResourceExpected(primary, IamConfigurationProvider.class)
.getConfiguration(primary);
}
开发者ID:ligoj,项目名称:plugin-iam-node,代码行数:8,代码来源:NodeBasedIamProvider.java
示例5: getConfiguration
import org.ligoj.app.iam.IamConfiguration; //导入依赖的package包/类
@Test
public void getConfiguration() {
final NodeBasedIamProvider provider = new NodeBasedIamProvider();
provider.configuration = configuration;
provider.servicePluginLocator = Mockito.mock(ServicePluginLocator.class);
final IamConfiguration iamConfiguration = Mockito.mock(IamConfiguration.class);
final IamConfigurationProvider servicePlugin = Mockito.mock(IamConfigurationProvider.class);
Mockito.when(servicePlugin.getConfiguration("service:id:ldap:dig")).thenReturn(iamConfiguration);
Mockito.when(provider.servicePluginLocator.getResourceExpected("service:id:ldap:dig",
IamConfigurationProvider.class)).thenReturn(servicePlugin);
Assert.assertSame(iamConfiguration, provider.getConfiguration());
}
开发者ID:ligoj,项目名称:plugin-iam-node,代码行数:14,代码来源:NodeBasedIamProviderTest.java
示例6: toSimpleUserUnknown
import org.ligoj.app.iam.IamConfiguration; //导入依赖的package包/类
@Test
public void toSimpleUserUnknown() {
final ConfluencePluginResource resource = new ConfluencePluginResource();
resource.iamProvider = new IamProvider[] { Mockito.mock(IamProvider.class) };
final IamConfiguration iamConfiguration = Mockito.mock(IamConfiguration.class);
Mockito.when(resource.iamProvider[0].getConfiguration()).thenReturn(iamConfiguration);
Mockito.when(iamConfiguration.getUserRepository()).thenReturn(Mockito.mock(IUserRepository.class));
final SimpleUser simpleUser = resource.toSimpleUser("some", "Some People");
Assert.assertEquals("some", simpleUser.getId());
Assert.assertEquals("Some People", simpleUser.getFirstName());
Assert.assertNull(simpleUser.getLastName());
}
开发者ID:ligoj,项目名称:plugin-km-confluence,代码行数:13,代码来源:ConfluencePluginResourceTest.java
示例7: prepareData
import org.ligoj.app.iam.IamConfiguration; //导入依赖的package包/类
@Before
public void prepareData() throws IOException {
// Only with Spring context
persistEntities("csv", new Class[] { SystemConfiguration.class }, StandardCharsets.UTF_8.name());
resource = new SaltedAuthenticationResource();
applicationContext.getAutowireCapableBeanFactory().autowireBean(resource);
resource.iamProvider = new IamProvider[] { Mockito.mock(IamProvider.class) };
final IamConfiguration configuration = Mockito.mock(IamConfiguration.class);
Mockito.when(resource.iamProvider[0].getConfiguration()).thenReturn(configuration);
userRepository = Mockito.mock(IUserRepository.class);
Mockito.when(configuration.getUserRepository()).thenReturn(userRepository);
}
开发者ID:ligoj,项目名称:plugin-sso-salt,代码行数:14,代码来源:SaltedAuthenticationResourceTest.java
示例8: getConfiguration
import org.ligoj.app.iam.IamConfiguration; //导入依赖的package包/类
@Override
@CacheResult(cacheName = "iam-ldap-configuration")
public IamConfiguration getConfiguration() {
return resource.getConfiguration("service:id:ldap:dig");
}
开发者ID:ligoj,项目名称:plugin-id-ldap,代码行数:6,代码来源:LdapIamProvider.java
示例9: init
import org.ligoj.app.iam.IamConfiguration; //导入依赖的package包/类
@Before
public void init() {
companyRepository = Mockito.mock(CompanyLdapRepository.class);
groupRepository = Mockito.mock(GroupLdapRepository.class);
userRepository = Mockito.mock(UserLdapRepository.class);
iamProvider = Mockito.mock(IamProvider.class);
final ApplicationContext applicationContext = Mockito.mock(ApplicationContext.class);
SpringUtils.setSharedApplicationContext(applicationContext);
final IamConfiguration iamConfiguration = new IamConfiguration();
iamConfiguration.setCompanyRepository(companyRepository);
iamConfiguration.setGroupRepository(groupRepository);
iamConfiguration.setUserRepository(userRepository);
Mockito.when(iamProvider.getConfiguration()).thenReturn(iamConfiguration);
companies = new HashMap<>();
companies.put("company", new CompanyOrg("dnc", "Company"));
groups = new HashMap<>();
final Set<String> members = new HashSet<>();
members.add("u");
groupLdap = new GroupOrg("dn", "Group", members);
groups.put("group", groupLdap);
groupLdap2 = new GroupOrg("dn2", "Group2", new HashSet<>());
groups.put("group2", groupLdap2);
user = new UserOrg();
user.setId("u");
user.setFirstName("f");
user.setLastName("l");
user.setCompany("company");
final List<String> userGroups = new ArrayList<>();
userGroups.add("group");
user.setGroups(userGroups);
user.setMails(Collections.singletonList("mail"));
user2 = new UserOrg();
user2.setId("u2");
user2.setFirstName("f");
user2.setLastName("l");
user2.setCompany("company");
user2.setGroups(new ArrayList<>());
users = new HashMap<>();
users.put("u", user);
users.put("u2", user2);
Mockito.when(companyRepository.findAllNoCache()).thenReturn(companies);
Mockito.when(groupRepository.findAllNoCache()).thenReturn(groups);
Mockito.when(userRepository.findAllNoCache(groups)).thenReturn(users);
Mockito.when(companyRepository.findAll()).thenReturn(companies);
Mockito.when(groupRepository.findAll()).thenReturn(groups);
Mockito.when(userRepository.findAll()).thenReturn(users);
CacheManager.getInstance().getCache("ldap").removeAll();
repository = new LdapCacheRepository();
repository.iamProvider = new IamProvider[] { iamProvider };
repository.ldapCacheDao = Mockito.mock(LdapCacheDao.class);
}
开发者ID:ligoj,项目名称:plugin-id-ldap,代码行数:54,代码来源:LdapCacheRepositoryTest.java
注:本文中的org.ligoj.app.iam.IamConfiguration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论