Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is mocking?
Think about why we would want to isolate tests.
Name a framework used for mocking in Java.
It sounds like a friendly Italian name!
What is the primary purpose of mocking in unit tests?
Think about what isolation means in testing.
True or False: Mockito can only be used to test methods that interact with databases.
Consider all external factors your code interacts with.
Design a unit test for a service that uses an external API to fetch weather data. How would you mock the API interactions using Mockito?
Think about how you would define a stub response for a specific weather query.
Imagine you have a method that sends notification emails through an external email service. Describe how you would test this method without sending real emails.
Consider what interactions are important to confirm successful email sending.
4 more questions in this section. Enroll free to practise them all.
Enroll free