Replies: 2 comments 3 replies
-
You'll want to have a look at the |
Beta Was this translation helpful? Give feedback.
3 replies
-
That's a rather unusual requirement, but if you really need that you can implement a See Exception Handling in the User Guide for details. We also have an example Though, to be honest, I would typically recommend the use of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Related: Rethrowing Throwables from EDT
I want to test my
InvocationInterceptor
that runs tests in EDT.Among other things, it shouldn't swallow any
Throwable
s. I wrote a test for that.Cool, it fails.
But from the standpoint of my build, it should actually pass.
In other words, I need to write a test that passes if it fails.
How do I do it in JUnit 5 — which, unlike JUnit 4, does not support
Test#expected
?Here's a simplistic MRE. You're not allowed to remove the throw. The error should actually get thrown from the test method. It means you can't wrap it in
assertThrows()
. The test sort of tests itself instead of testing something that happens inside the curly braces.Java 8.
Beta Was this translation helpful? Give feedback.
All reactions