Search in sources :

Example 1 with EmailValidator

use of org.mamute.validators.EmailValidator in project mamute by caelum.

the class EmailValidatorTest method setup.

@Before
public void setup() {
    users = mock(UserDAO.class);
    messageFactory = mock(MessageFactory.class);
    validator = new MockValidator();
    emailValidator = new EmailValidator(validator, users, messageFactory);
    existant = "existant@brutal.com";
    unexistant = "unexistant@brutal.com";
    when(users.existsWithEmail(existant)).thenReturn(true);
    when(users.existsWithEmail(unexistant)).thenReturn(false);
    when(users.existsWithEmail(null)).thenReturn(false);
}
Also used : EmailValidator(org.mamute.validators.EmailValidator) UserDAO(org.mamute.dao.UserDAO) MessageFactory(org.mamute.factory.MessageFactory) MockValidator(br.com.caelum.vraptor.util.test.MockValidator) Before(org.junit.Before)

Aggregations

MockValidator (br.com.caelum.vraptor.util.test.MockValidator)1 Before (org.junit.Before)1 UserDAO (org.mamute.dao.UserDAO)1 MessageFactory (org.mamute.factory.MessageFactory)1 EmailValidator (org.mamute.validators.EmailValidator)1