-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jukito does not work well with ExpectedException rule #83
Comments
A possible workaround is to use a subclass of
|
+1 Got the same problem |
Using
ExpectedException
to test for expected exception does not work as intended, as Jukito'sInjectedAfterStatements.evaluate()
wraps and rethrows all exceptions asorg.junit.internal.runners.model.MultipleFailureException.MultipleFailureException(List<Throwable>)
This behavior would be ok for multiple exceptions, e.g. when also catching Guice-related exceptions in addition to exceptions which occurred in the actual test. But when there is only one exception, this should be re-thrown directly instead of wrapping it into
MultipleFailureException
.This can actually easily be done by using
org.junit.runners.model.MultipleFailureException.assertEmpty(List<Throwable>)
which first checks if there is only a single exception and if so rethrows it directly. Multiple exceptions are still wrapped into aMultipleFailureException
as it used to be in Jukito.The text was updated successfully, but these errors were encountered: