r/learnjava • u/erebrosolsin • Dec 24 '25
How to learn unit/integration tests?
I have paid for a course in Udemy and what it teaches is only syntax. Spending more than 10 minutes for every JUnit method.
The projects I build in spring boot are small that I think it won't be good place to learn unit testing there. Big and more complex ones would be great. Suggest me resources to learn and practice.
13
Upvotes
View all comments
Show parent comment
1
u/erebrosolsin Dec 25 '25 edited Dec 25 '25
Thanks for comprehensive answer. Do you have any resource or any other suggestion before writing these unit test and integration test. I think I will start with my projects but as I am beginner in this topic I have no clue. I know I can google stuff and I already did, but hearing from you would also be great.
For example if we have a code for sorting a list of items, then how should I write unit test. Should I manually check db and find what it has to return and then use asserting for this?