}
}
@Test
public void testGetAllUsernamesInRoleForTenant() throws Exception {
ITenant defaultTenant = new Tenant( "/pentaho/tenant0", true );
login( "admin", defaultTenant );
JdbcUserRoleListService dao = makePopulatedJdbcUserRoleListService();
dao.setAllUsernamesInRoleQuery(
"SELECT DISTINCT(USERNAME) AS USERNAME FROM AUTHORITIES WHERE AUTHORITY = ? ORDER BY 1" ); //$NON-NLS-1$
dao.afterPropertiesSet();
List<String> allUsers = dao.getUsersInRole( defaultTenant, "ROLE_TELLER" ); //$NON-NLS-1$
assertTrue( "User List should not be empty", allUsers.size() > 0 ); //$NON-NLS-1$
for ( String username : allUsers ) {
System.out.println( "ROLE_TELLER User: " + username ); //$NON-NLS-1$
}
try {
allUsers = dao.getUsersInRole( new Tenant( "/pentaho", true ), "ROLE_TELLER" );
} catch ( UnsupportedOperationException uoe ) {
assertNotNull( uoe );
}
}