[Sping Boot/Mockito/Junit] Lombok Coverege testing
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?
- 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
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)
Thank you so much1 Reply
⌛
This post has been reserved for your question.
Hey @Romans! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.