use of org.pentaho.platform.plugin.services.security.userrole.jdbc.JdbcUserRoleListService in project pentaho-platform by pentaho.
the class JdbcUserRoleListServiceTest method testGetAllAuthoritiesWithRolePrefix.
@Test
public void testGetAllAuthoritiesWithRolePrefix() throws Exception {
JdbcUserRoleListService dao = makePopulatedJdbcUserRoleListService();
// $NON-NLS-1$
dao.setAllAuthoritiesQuery("SELECT DISTINCT(AUTHORITY) AS AUTHORITY FROM AUTHORITIES ORDER BY 1");
// $NON-NLS-1$
dao.setRolePrefix("ARBITRARY_PREFIX_");
dao.afterPropertiesSet();
List<String> auths = dao.getAllRoles();
// $NON-NLS-1$
assertTrue("Authorities list should not be empty", auths.size() > 0);
for (String role : auths) {
// $NON-NLS-1$
System.out.println("Authority with prefix: " + role);
}
}
Aggregations