-
Notifications
You must be signed in to change notification settings - Fork 140
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
NoClassDefFoundError for PreconditionViolationException when running JUnit5 tests #1020
Comments
Would you mind to share a sample project to us? Test Runner is not responsible to resolve the classpath so I guess there's something wrong with the upstream side. (Maybe buildship) I need a sample project to repro the issue and then take a look where is the gap |
Hi @jdneo , I can't share my exact project, but I made a stripped down version to reproduce the issue. See here: Seems like when I remove the following from
Thanks for having a look! |
Please try the following configurations:
|
@jdneo your workaround enabled me to run the tests in VS code. Any idea where is the actual problem and how to address it? |
Hmm, I guess too soon. When I applied this remedy to my original project, not just a demo, it started throwing another error, again related to preconditions:
It went away after I put the following dependency back as well:
|
I guess all of the problem is about the classpath. What I did is find where the missing class comes from and add them into the dependecies. Could I understand the problem has been solved now? |
@jdneo but the problem was not present before vs code update / extension update,on top of that the code is working fine outside of the VS code, in intelliJ, from command line etc. So the problem is not "solved" for VS code, just "worked around". As I already wrote in my first comment, "PreconditionViolationException is now deprecated" so I don't think correct solution is to try and patch the missing classes but rather accommodate for the class being deprecated. |
@michalhosala I got this too but problem is in junit jupiter, some libs absent and |
I can no longer run unit tests for my spring app within VSCode IDE, am only getting the following error when trying to do so:
PreconditionViolationException
is now deprecated, see here, so it would seem Java Test Runner is not aware of it or what. Currently mybuild.gradle
has junit dependencies like this:I had a look at what seemed like a related issue but none of the workarounds from there worked for me.
The text was updated successfully, but these errors were encountered: