Skip to content

do we have an equality check method for random generated beans? #272

Closed
@fyh

Description

@fyh

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions