Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
New
Description
In junit5, a neat assertion method is added which makes testing expected
failures a little more straightforward. The block of code that is
expected to throw is passed in with a lambda expression, and the caught
exception returned for inspection. The usage looks something like this:
IOException e = expectThrows(IOException.class, () -> { throw new IOException("some io error"); }); // assert stuff here about the exception
We should add this to LuceneTestCase until junit5 is available.