sta-szek / pojo-tester

Java testing framework for testing pojo methods. It tests equals, hashCode, toString, getters, setters, constructors and whatever you report in issues ;)
http://www.pojo.pl
GNU Lesser General Public License v3.0
53 stars 26 forks source link

Support Builder-style setters #229

Open pheerai opened 5 years ago

pheerai commented 5 years ago

Even though not strictly POJO compatible, oftentimes (generated) setters behave Builder-like, i.e. returning the instance of the class itself. This kind of setters is currently not supported by this tool, as it's checking the setter for a void return type. A "naïve" approach to this should be fairly easy to implement (widen the scope of return value to the class type itself), but I'm not sure whether (and how) this behavior should be configurable. If there's feedback in any direction, I'd be willing to perform the actual implementation.

GhilesA commented 5 years ago

I think it's an interesting addition to match with more flexible setter. The builder-style setters are common in a lot of project