Package it.hotel.controller.user.validation

Examples of it.hotel.controller.user.validation.UserValidator


 
  public void testValidate() throws SystemException{
   
    Errors errors = createMock(Errors.class);
   
    UserValidator userValidator = new UserValidator();
   
    userValidator.setUserManager(userManager1);
   
    errors.reject("errors.name.required", "errors.name.required");
    errors.reject("errors.surname.required", "errors.surname.required");
    errors.reject("errors.password.notEquals","errors.password.notEquals");
    errors.reject("errors.username.alreadyAssign", "errors.username.alreadyAssign");
 
    EasyMock.expect(userManager1.getUser(user1.getUserName())).andReturn(user1);
   
    expectLastCall().anyTimes();
   
    replay(errors);
    org.easymock.classextension.EasyMock.replay(userManager1);
       
    userValidator.validate(user1, errors);
   
    verify(errors);
    org.easymock.classextension.EasyMock.verify(userManager1);
     
  }
View Full Code Here

TOP

Related Classes of it.hotel.controller.user.validation.UserValidator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.