@Test
public void avoidPlainTextPassword() {

     UserDTO userDTO = new UserDTO();
     userDTO.setEmail("foobar@email.com.br");
     userDTO.setUserName("foobar");
     userDTO.setFirstName("foo");
     userDTO.setLastName("bar");
     userDTO.setPassword("123456");
     
     String hashPassword = bcrypt.encode(userDTO.getPassword());
     
     Mockito.when(passwordEncoder.encode(Mockito.anyString())).thenReturn(hashPassword);
     
     userService.save(userDTO);
     
     assertTrue(bcrypt.matches(userDTO.getPassword(), hashPassword));
     assertFalse(bcrypt.matches("654321", hashPassword));
     Mockito.verify(userRepository, Mockito.times(1)).save(Mockito.any(User.class));
}