1.

ExpectedException is found under which package?(a) org.junit.ExpectedException(b) org.junit.Test.ExpectedException(c) org.junit.Rule.ExpectedException(d) org.junit.rules.ExpectedExceptionThe question was posed to me by my college director while I was bunking the class.My question comes from Testing Exception Handling topic in section Mastering JUnit of JUnit

Answer»

The correct choice is (d) org.junit.rules.EXPECTEDEXCEPTION

To elaborate: ExpectedException is a RULE and HENCE, is founde INSIDE the rules package of JUnit.



Discussion

No Comment Found

Related InterviewSolutions