Let's face it, writing bean property tests is arguably the worst use of time. But they must be made.
For instance. If you are testing a property Stringto propNamecall, for example:
testProperty(target, "propName", String.class);
testProperty(target, "propName", String.class, "expected initial");
It will be verified that:
- There are methods
getand set.- When using the expected value, the test
getcalls assertEqualsfor the given value. - (
get, is) / setbehave as expected.
I could start writing these implementations, but I want to know if there is anything to facilitate this. Other optional attributes can be used to verify that the nullJSR-303 bean is enabled or used to validate the field.
source
share