IRL I'm new to unit testing. Currently, at my company, we're looking to start implementing unit testing for our Java-based applications.
I've taken the lead on this, but I'm having some issues during the way to the implementation.
I'm experienced in QA Automation testing (acceptance & e2e testing, both API and UI), but I'm struggling with my new task, cause I have a few questions that I can't give answer myself, and apparently none of my co-workers is experienced on this.
The code I will be writing unit tests against is written in Java, and recently we've migrated to Quarkus.
- What is the best practice to organize test data?
- What should be mocked when testing a given class?
- How to share mocked services (classes)?
- Can I mock my entire layer with the DB communication (saw some comments never mock smth that's not yours)?
- What in fact means In-Memory DB, and can it be used in my case?
I'm feeling like I've forgotten smth to ask, so if you guys have anything in mind, any advice on how to move forward with this please let me know.
Or if you know any Github repo that has some really good examples about this, please share it with me.
p.s I've done some examples using quarkus-junit5, and mockito for mocking purposes, also mockito-inline for mocking utility classes.
Aucun commentaire:
Enregistrer un commentaire