use of org.mamute.controllers.BrutalValidator in project mamute by caelum.
the class SignupValidatorTest method setup.
@Before
public void setup() {
validator = new MockValidator();
messageFactory = new MessageFactory(bundle);
emailValidator = new EmailValidator(validator, users, messageFactory);
javax.validation.Validator javaxValidator = Validation.buildDefaultValidatorFactory().getValidator();
BrutalValidator brutalValidator = new BrutalValidator(javaxValidator, validator, messageFactory);
userValidator = new UserValidator(validator, emailValidator, messageFactory, brutalValidator);
signupValidator = new SignupValidator(validator, userValidator, messageFactory, users);
when(users.existsWithEmail(VALID_EMAIL)).thenReturn(false);
when(users.existsWithName(VALID_USER_NAME)).thenReturn(false);
}
use of org.mamute.controllers.BrutalValidator in project mamute by caelum.
the class UserPersonalInfoValidatorTest method setup.
@Before
public void setup() {
this.bundle = mock(BundleFormatter.class);
this.validEmail = "artur.adam@email.com.br";
this.users = mock(UserDAO.class);
this.validator = new MockValidator();
this.messageFactory = new MessageFactory(mock(ResourceBundle.class));
this.emailValidator = new EmailValidator(validator, users, messageFactory);
javax.validation.Validator javaxValidator = Validation.buildDefaultValidatorFactory().getValidator();
BrutalValidator brutalValidator = new BrutalValidator(javaxValidator, validator, messageFactory);
this.infoValidator = new UserPersonalInfoValidator(validator, emailValidator, messageFactory, bundle, brutalValidator);
}
Aggregations