params.put("privacyPolicyAgreement", "true");
params.put("Monotext:language", "it");
params.put("Date:birthdate", "01/01/1981");
result = this.executeRegister(params);
assertEquals(Action.SUCCESS, result);
UserRegistrationAction action = (UserRegistrationAction) this.getAction();
Map<String, List<String>> fieldErrors = action.getFieldErrors();
assertNotNull(fieldErrors);
assertEquals(0, fieldErrors.size());
Set<String> keys = fieldErrors.keySet();
assertEquals(0, keys.size());
params.put("username", username_2);
result = this.executeRegister(params);
assertEquals("expired", result);// Sessione scaduta
result = this.executeInitRegistration();// Ripristino sessione
assertEquals(Action.SUCCESS, result);
result = this.executeRegister(params);
assertEquals(Action.INPUT, result);
action = (UserRegistrationAction) this.getAction();
fieldErrors = action.getFieldErrors();
assertNotNull(fieldErrors);
assertEquals(1, fieldErrors.size());
assertEquals("email", (String) fieldErrors.keySet().iterator().next());
assertEquals((fieldErrors.get("email")).get(0), action.getText("jpuserreg.error.email.alreadyInUse"));
} finally {
this.getUserManager().removeUser(username_1);
_userRegDAO.clearTokenByUsername(username_1);
}
}