Closed
Description
hi, today I was writing some unit tests and found random-beans, I think it's cool and make my life so much easier. I can generate random beans for test data-preparation which have a lot of fields.
for example:
@Autowired
private PersonDao dao;
@Test
public void saveTest() {
Person person = enhancedRandom.nextObject(Person.class);
dao.insertSelective(person);
Person personEntity = dao.selectByPrimaryKey(person.getId());
// test whether person has the same fields as personEntity
}
The problem is I don't know how to easily check fileds equality between generated bean and the selected entity bean using DAO.
So, Is there an equality check method for random generated beans?
Thanks!