Search in sources :

Example 21 with IUserSetting

use of org.pentaho.platform.api.usersettings.pojo.IUserSetting in project pentaho-platform by pentaho.

the class UserSettingServiceTest method testGetUserSettingOnlyGlobalExist.

@Test
public void testGetUserSettingOnlyGlobalExist() throws Exception {
    final String settingName = GLOBAL_SETTING_NAME_3;
    final String defaultValue = "defaultValue";
    when(session.getAttribute(eq("SPRING_SECURITY_CONTEXT"))).thenReturn(1);
    final IUserSetting userSetting = userSettingService.getUserSetting(settingName, defaultValue);
    assertEquals(settingName, userSetting.getSettingName());
    assertEquals(GLOBAL_SETTING_VALUE_3, userSetting.getSettingValue());
}
Also used : IUserSetting(org.pentaho.platform.api.usersettings.pojo.IUserSetting) Test(org.junit.Test)

Aggregations

IUserSetting (org.pentaho.platform.api.usersettings.pojo.IUserSetting)21 Test (org.junit.Test)13 ArrayList (java.util.ArrayList)8 IUserSettingService (org.pentaho.platform.api.usersettings.IUserSettingService)6 ExportManifestUserSetting (org.pentaho.platform.plugin.services.importexport.ExportManifestUserSetting)5 HashMap (java.util.HashMap)4 IAnyUserSettingService (org.pentaho.platform.api.usersettings.IAnyUserSettingService)4 Serializable (java.io.Serializable)3 Map (java.util.Map)3 UserExport (org.pentaho.platform.plugin.services.importexport.UserExport)3 GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Facet (org.codehaus.enunciate.Facet)2 IUserRoleListService (org.pentaho.platform.api.engine.IUserRoleListService)2 ITenant (org.pentaho.platform.api.mt.ITenant)2 RoleExport (org.pentaho.platform.plugin.services.importexport.RoleExport)2 IRoleAuthorizationPolicyRoleBindingDao (org.pentaho.platform.security.policy.rolebased.IRoleAuthorizationPolicyRoleBindingDao)2 UserDetailsService (org.springframework.security.core.userdetails.UserDetailsService)2 IOException (java.io.IOException)1 List (java.util.List)1