When I try to run some unit tests, the following error is raised:
java.lang.NoClassDefFoundError: org/junit/runner/manipulation/Filter
at java.lang.Class.for
In my case the error had the same stack trace, (ending with java.lang.Class.forName0(Native Method)
) but the error message was different:
java.lang.VerifyError: (class: org/junit/runner/manipulation/Alphanumeric, method: create signature: (Lorg/junit/runner/manipulation/Ordering$Context;)Lorg/junit/runner/manipulation/Ordering;) Wrong return type in function
The cause turned out to be that I had upgraded JUnit from 4.11 to 4.13.1, because GitHub's "dependabot" suggested so, on some public project of mine, and even created merge requests ready for me to accept, and I thought "sure, why not, what could possibly go wrong?" Conclusion: don't trust GitHub's dependabot.