Hello! I'm doing Tests with Mockito, Spring Boot and Lombok. Someone knows how to test a simple class base with only attributes, that is marked with @Data?
@Datapublic clòass MyCLass{ private final UUID id = UUID.randomUID(); private String name; private String surname; private List<Strings> groups;}
@Datapublic clòass MyCLass{ private final UUID id = UUID.randomUID(); private String name; private String surname; private List<Strings> groups;}
- I've put all the setters and getters for all attributes (except id). - Ive set the toString(). - then created 3 instances and set for eachone a different name. - se the .equals from then (the first with itself), first with second, second with third, first with third. - the put for each instance the .hashCode(). - put the .canEqual as the equals.
Running the coverage it still gives
Line: 100% 9/9 Branch: 30% 16/52
Line: 100% 9/9 Branch: 30% 16/52
And the @ Data is marked as "Partial" Someone have tips on how could i fill the Branch? (if i remove all the equals, can equal and hascode it goes 0/52)