@Test public void shouldHashThePasswordAndSetPassword() throws Exception { mockStatic(Encoder.class); when(Encoder.hash("password")).thenReturn("hashedPassword"); User user = new User(); user.setPassword("password"); assertThat(user.getPassword(), is("hashedPassword")); }
public void setPassword(String password) { this.password = Encoder.hash(password); }
User extends BaseModel implements Importable { public void setPassword(String password) { this.password = Encoder.hash(password); } }
User extends BaseModel implements Importable { public void setPassword(String password) { this.password = Encoder.hash(password); } User(Long id, String userName);  User(String userName); }
User extends BaseModel implements Importable { public void setPassword(String password) { this.password = Encoder.hash(password); } 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 setPassword(String password) { this.password = Encoder.hash(password); } User(Long id, String userName);  User(String userName); Boolean isMobileUser(); void validate(); void setPassword(String password); User basicInformation();  }