Today, I tested a piece of code with JUnit and reported an error method initialization error not found:: the following problems occurred:
Double click this to display the following error:
Query the Internet and say it’s the JUnit version:
Then I won’t use JUnit, the liberty, and download the latest junit4_Replace the rack package of 12
The query on the Internet also said that there was a lack of shelf bags. The problem was solved as follows:
In addition to junit-4.12.jar, two dependent jar packages are also introduced: hamcrest-core-1.3.rc2.jar and hamcrest-library-1.3.rc2.jar
Here, the problems of all netizens have been solved, and everyone is happy. However, I found that my problem still didn’t exist, or the above error, until I found in a comment on a forum that my method needs to add public. Wipe
Now JUnit is back to normal. Although it still reports an error, it is a problem in the code
Solve the problem
Similar Posts:
- [Solved] JUnit test error: Java lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
- java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
- Failed to resolve: junit:junit:4.12 [How to Solve]
- junitjava.lang.Exception: No tests found matching
- Android Studio: Could not download junit.jar (junit:junit:4.12)
- [Solved] java.lang.Exception: No runnable methods at org.junit.runners.BlockJUnit4ClassRunner.validateIns…
- [Solved] java.lang.NoClassDefFoundError: org/junit/runner/manipulation/Filter
- [Solved] IDEA Error: Failed to resolve org.junit.platform:junit-platform-launcher
- JUnit error: Java. Lang. exception: the test class should have only one public constructor
- [Solved] ### Error querying database. Cause: java.sql.SQLException: The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognized or represents more XXXXX