title: TestNG: How to test for mandatory exceptions?
body: <p>I'd like to write a TestNG test to make sure an exception is thrown under a specific condition, and fail the test if the exception is not thrown. Is there an easy way to do this without having to create an extra boolean variable?</p>
  
  <p>A related blog post on this subject: <a href="http://konigsberg.blogspot.com/2007/11/testng-and-expectedexceptions-ive.html" rel="noreferrer">http://konigsberg.blogspot.com/2007/11/testng-and-expectedexceptions-ive.html</a></p>