1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Testing in Java

Connected

Exercise

Unit test: Database with a list

Consider the ErrorStore and InfoStore from the lesson, but now our process() method is accepting a list of messages. Given the input list provided, verify each database was called the correct number of times.

Instructions

100 XP
  • Create a mock for the InfoStore.
  • Create a mock for the ErrorStore.
  • Verify how many times the InfoStore mock will be called with the current arguments.
  • Verify how many times the ErrorStore mock will be called with the current arguments.