use of com.enonic.xp.admin.tool.AdminToolDescriptors in project xp by enonic.
the class AdminToolDescriptorServiceImplTest method getByApplication.
@Test
public void getByApplication() {
final AdminToolDescriptors result = this.service.getByApplication(ApplicationKey.from("myapp1"));
assertEquals(1, result.getSize());
final AdminToolDescriptor adminToolDescriptor = result.get(0);
assertEquals("My admin tool", adminToolDescriptor.getDisplayName());
assertEquals("My admin tool description", adminToolDescriptor.getDescription());
assertEquals(1, adminToolDescriptor.getAllowedPrincipals().getSize());
}
use of com.enonic.xp.admin.tool.AdminToolDescriptors in project xp by enonic.
the class AdminToolDescriptorServiceImplTest method getAllowedAdminToolDescriptors.
@Test
public void getAllowedAdminToolDescriptors() throws Exception {
final PrincipalKeys principalKeys = PrincipalKeys.from(PrincipalKey.from("role:system.user.admin"));
AdminToolDescriptors result = this.service.getAllowedAdminToolDescriptors(principalKeys);
assertNotNull(result);
assertEquals(1, result.getSize());
result = this.service.getAllowedAdminToolDescriptors(PrincipalKeys.empty());
assertNotNull(result);
assertEquals(0, result.getSize());
}
Aggregations