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) |
|