use of org.opencastproject.adminui.usersettings.UserSettings in project opencast by opencast.
the class TestUserSettingsEndpoint method createUserSettings.
private UserSettings createUserSettings(int start, int finish, int limit, int offset, int total) {
UserSettings userSettings = new UserSettings();
for (int i = 1; i <= 10; i++) {
UserSetting userSetting = new UserSetting(i, "key-" + i, "value-" + i);
userSettings.addUserSetting(userSetting);
}
userSettings.setTotal(total);
userSettings.setLimit(limit);
userSettings.setOffset(offset);
return userSettings;
}
use of org.opencastproject.adminui.usersettings.UserSettings in project opencast by opencast.
the class TestUserSettingsEndpoint method setupUserSettingsService.
private void setupUserSettingsService() throws UserSettingsServiceException {
int start = 1;
int finish = 10;
int limit = 100;
int offset = 0;
int total = 10;
UserSettings userSettings = createUserSettings(start, finish, limit, offset, total);
userSettingsService = EasyMock.createNiceMock(UserSettingsService.class);
EasyMock.expect(userSettingsService.findUserSettings(limit, 0)).andReturn(userSettings);
final Capture<String> inputKey = new Capture<String>();
final Capture<String> inputValue = new Capture<String>();
EasyMock.expect(userSettingsService.addUserSetting(EasyMock.capture(inputKey), EasyMock.capture(inputValue))).andAnswer(new IAnswer<UserSetting>() {
public UserSetting answer() {
UserSetting userSetting = new UserSetting(19, inputKey.getValue(), inputValue.getValue());
return userSetting;
}
});
userSettingsService.deleteUserSetting(18L);
EasyMock.expectLastCall();
EasyMock.expect(userSettingsService.updateUserSetting(18, EXAMPLE_KEY, EXAMPLE_VALUE)).andReturn(new UserSetting(18L, EXAMPLE_KEY, EXAMPLE_VALUE));
EasyMock.replay(userSettingsService);
}
Aggregations