@Test public void shouldThrowErrorOnInvalidUsername() throws Exception { User user = make(a(defaultUser)); user.setUserName("Mohan Das"); user.setEmail("abc@gmail.com"); expectedException.expect(DataException.class); expectedException.expectMessage("user.userName.invalid"); user.validate(); }
public void validate() { validateEmail(); validateUserName(); }
User extends BaseModel implements Importable { public void validate() { validateEmail(); validateUserName(); } }
User extends BaseModel implements Importable { public void validate() { validateEmail(); validateUserName(); } User(Long id, String userName);  User(String userName); }
User extends BaseModel implements Importable { public void validate() { validateEmail(); validateUserName(); } User(Long id, String userName);  User(String userName); Boolean isMobileUser(); void validate(); void setPassword(String password); User basicInformation(); }
User extends BaseModel implements Importable { public void validate() { validateEmail(); validateUserName(); } User(Long id, String userName);  User(String userName); Boolean isMobileUser(); void validate(); void setPassword(String password); User basicInformation();  }