I'm using BeanUtils to map some DTO class to Domain classes (and vice/versa). (using BeanUtils copy properties)
I want to test my code. How do I write test that will fail if someone writes creates an extra property in either the DTO or Domain class.
My attempt which I'm still working on is to traverse BeanUtils.getPropertyDescriptors(class) and find the corresponding getter methods THEN for each class (DTO and Domain) test for equality.
Any thoughts?
Due to project dependency constraints I would rather not use something like Dozer. I am using spring 3's beanutils.