newUser.setPassword(validPass);
newUser.setConfirmPassword(validPass);
newUser.setEmail(validEmail);
SaltSource saltSource = createNiceMock(SaltSource.class);
UserDetails userDetails = createNiceMock(UserDetails.class);
expect(userDetails.getUsername()).andReturn("valid.user");
expect(userDetails.getPassword()).andReturn("valid.password");
expect(saltSource.getSalt(userDetails)).andReturn("salt");
PasswordEncoder passwordEncoder = createNiceMock(PasswordEncoder.class);
expect(passwordEncoder.encodePassword("valid.password", "salt")).andReturn("valid.password");
replay(saltSource, userDetails, passwordEncoder);
ReflectionTestUtils.setField(newAccountService, "saltSource", saltSource);