testUtils is a simple set of utilities aimed at helping you test and improve the coverage of your code. For the time being it is only comprised of BeanLikeTester.
This class provides methods to easily and quickly test and improve the test coverage of 'bean like' objects (i.e. objects with setters and getters but that don't necessarily implement the Serializable interface and can have non default constructors).
The beanLike objects:
All the initial values, setters, getters, non default constructors, hashCode(), equals(), toString() can be automatic tested from a map of default and non default property/value.
For example to test this simple bean:
you would use instances of PropertiesAndValues and BeanLikeTester to:
Now, if you want to test an object that defines non default constructors that only set properties, e.g.:
you would first use ConstructorSignatureAndPropertiesMapping to Define the mapping between the constructors' signatures and the properties and then follow the same steps. E.g.: