Time: 15 minutes
Purpose: This activity helps you get familiar with thrown exceptions
Introduction: You’re had experience using a assertions, now create one for checking for thrown exceptions
Task: public static int parseInt(String s) throws NumberFormatException if it can’t convert to int
Create,
- A JUnit test where a string is successfully converted int
- A JUnit tests which checks for an exception is thrown