InterviewSolution
Saved Bookmarks
| 1. |
How Can You Use Junit To Test That The Code Throws Desired Exception? |
|
Answer» JUnit PROVIDES a option of tracing the Exception handling of code. You can test if a code throws desired exception or not. The EXPECTED PARAMETER is USED ALONG with @Test annotation as follows − @Test(expected) JUnit provides a option of tracing the Exception handling of code. You can test if a code throws desired exception or not. The expected parameter is used along with @Test annotation as follows − @Test(expected) |
|