Diffblue requires getters and setters, and also constructor for final attributes. These are easily provided with lombok’s @Data (Getter/Setter) and @RequiredArgsConstructor.
In my project we use these extensively before I got to know about diffblue. Requiring me to delombok the whole project just to get diffblue to work is not an option.
Thanks for getting in touch and thanks for telling us about your use case - I am sorry that we haven’t been able to help you out of the box, but we will see what we can do to help here.
A few of our engineers are having a conversation about this now and we will put together a few suggestions and get back to you soon
We tried to understand what problems you are seeing with Cover on projects that use Lombok yesterday, but for all the examples we tried, Cover produced tests just as expected. In particular, we easily recognize Lombok-generated getters and setters, and use them in tests like we would for hand-written getters and setters. We have tried this with different Lombok settings as well, and both with code compiled by Maven and from IntelliJ directly.
Would you happen to have a concrete example of what doesn’t work for you that you can share with us? We’d love to get to the bottom of this!
I’m not sure if there are any particular configurations to be made, but I have lombok in my maven dependency and installed Intellij lombok plugin.
When I select “write test” for a class, if there is a reference to lombok getter or setter within the class, or absence of constructor for the class to be tested, it throws an error, but works well for classes without lombok use
Just out of curiosity, does test case generation work for that class when you de-lombikify it? I’m wondering whether this is actually a Lombok issue - my first guess would be that the class in question just happens to be hard to test for Cover, and the fact that it uses Lombok is a red herring.
That problem definitely sounds like it could be related. Cover relies on having accurate compiled bytecode, and this sounds like it would cause compilation problems.