@Test
  public void testSetUserSetting() throws Exception {
    final String settingName = "settingName";
    final String settingValue = "settingValue";

    assertEquals(4, userSettings.size());
    userSettingService.setUserSetting(settingName, settingValue);
    assertEquals(5, userSettings.size());

    final Serializable value = userSettings.get(UserSettingService.SETTING_PREFIX + settingName);
    assertEquals(settingValue, value);

    verify(repository).setFileMetadata(eq(USER_FOLDER_ID), anyMap());
  }
  @Test
  public void testSetUserSettingByName() throws Exception {
    final String settingName = "settingName";
    final String settingValue = "settingValue";

    IAuthorizationPolicy policy = mock(IAuthorizationPolicy.class);
    when(policy.isAllowed(anyString())).thenReturn(true);
    PentahoSystem.registerObject(policy);

    assertEquals(4, userSettings.size());
    userSettingService.setUserSetting("test", settingName, settingValue);
    assertEquals(5, userSettings.size());

    final Serializable value = userSettings.get(UserSettingService.SETTING_PREFIX + settingName);
    assertEquals(settingValue, value);

    verify(repository).setFileMetadata(eq(USER_FOLDER_ID), anyMap());
  }