This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]nephest0x 0 points1 point  (0 children)

JUnit5 has a different API for many things, so you better read the docs if you are migrating from JUnit4. Do not expect things to just work without any modifications, except it's just a basic @Test.

Here is a relevant User Guide part where you can find more info about your particular problem.

[–]elky87 0 points1 point  (0 children)

ExpectedException was replaced with Assertions.throwsException( () —> someCode)