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

Connected

Exercise

Digits with MethodSource

Like most old and popular programming languages, Java has a vast ecosystem, and there are many ways to do one thing.

Consider the LastDigit exercise from the previous lesson. Practice the lesson's syntax by rewriting it using @MethodSource.

Instructions

100 XP
  • Use the correct annotation for a parameterized test that takes its arguments from a method.
  • Point the annotation to the arguments provider method.
  • Use the same syntax three times to create argument pairs.