} );
}
@Test
public void testMondrianUserSessionUserRoleListMapper() throws Exception {
final MondrianUserSessionUserRoleListMapper mapper = new MondrianUserSessionUserRoleListMapper();
mapper.setSessionProperty( "rolesAttribute" );
try {
String[] roles = SecurityHelper.getInstance().runAsUser( "admin", new Callable<String[]>() {
@Override
public String[] call() throws Exception {
IPentahoSession session = PentahoSessionHolder.getSession();
session.setAttribute( "rolesAttribute", new Object[] { "mondrianRole1", "mondrianRole2", "mondrianRole3" } );
return mapper.mapConnectionRoles( session, "SteelWheelsRoles" );
}
} );
Assert.assertNotNull( roles );
Assert.assertEquals( 3, roles.length );