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

Connected

Exercise

Unit test: Database message

Consider the ErrorStore and InfoStore from the lesson. Suppose the process(String message) method is used on a [WARN] message, which means it would end up in neither database. Write a test to verify that.

Instructions

100 XP
  • Verify the message did not end up in infoStore.
  • Verify it also did not end up in errorStore using the times() verify approach.
  • In that same statement, add the database method, save(), that wasn't called.