I've been working on creating a unit test for my java project, and my test keeps on failing even if I made no assertions.
After reading through the stacktrace, I noticed that a method in the retsIQ library I am using is throwing an assertion error. Is there anyway I can ignore this? I'd really rather not decompile and recompile the module.
I should also mention that this exact code works fine if it's not run as a test.
Here is a picture of my test:
Here is a picture of it it not running in a test:
I'll assume two things: 1) your project is maven-based; 2) those two code fragments are exactly the same (except for the
assertTrue(true);
line, which does nothing, by the way).Maybe your problem is caused by the fact that "run" and "test" configurations have different classpaths. You may have a wrong version of some library in the test classpath or even miss some library, which eventually leads to this exception.
I suggest you re-check all test-scoped dependencies in pom.xml. You can also print project dependency tree using Maven Dependency Plugin (but I'm not sure whether it can print test dependencies separately):
Alternatively you can go to "Project Structure" > "Modules" > "Dependencies" tab in Intellij Idea and look through all entries with "Test" scope.