verify(service, sessionStatus);
}
@Test
public void testUpdatePreferences_invalidPageSizeValue() {
ModelMap model = new ExtendedModelMap();
HashMap<String, PortalPreference> preferenceMap = new HashMap<String, PortalPreference>();
PortalPreference pageSizePref = new PortalPreferenceImpl(PortalPreferenceKeys.PAGE_SIZE, "invalid");
preferenceMap.put(PortalPreferenceKeys.PAGE_SIZE, pageSizePref);
PortalPreferenceForm form = new PortalPreferenceForm(preferenceMap);
final BindingResult errors = new BeanPropertyBindingResult(form, "form");
SessionStatus sessionStatus = createMock(SessionStatus.class);
replay(service, sessionStatus);
String view = controller.updatePreferences(form, errors, validToken, validToken,REFERRER_ID, model, sessionStatus);
assertEquals(ViewNames.ADMIN_PREFERENCE_DETAIL, view);
assertTrue(errors.hasErrors());
assertTrue(model.containsAttribute("topnav"));
assertTrue(model.containsAttribute("tabs"));
assertFalse("Model has not been cleared", model.isEmpty());
verify(service, sessionStatus);
}