Write an idea test class, use @Test, and then report an error. Possible reasons for the error are as follows:
1. First, check whether you are lazy and write the class name as test when creating the class
If the class name is test, it cannot be used, but the fully qualified name can be used.
2. The jar package version number used is too low
The @Test annotation can only be used in versions above junit4. If a lower version is used, the annotation method cannot be used.
3. The test folder is not set to test resource root
The setting method is as follows:
I haven’t encountered such a situation yet.
If none of the above methods can be solved, you can try to change the version of JUnit and try several more versions. Some people on the Internet say that the scope label needs to be deleted. This situation has not been encountered for the time being. I don’t know whether it is feasible. I can try it
Similar Posts:
- [Solved] Cannot resolve symbol ‘SpringJUnit4ClassRunner’
- Idea write JUnit test case found:…empty test suite
- junitjava.lang.Exception: No tests found matching
- [Solved] Junit4 unit test error: Method ‘initializationError’ not found. Opening the test class.
- Springboot: solve the problem of failed to load ApplicationContext
- [Solved] IDEA Error: Failed to resolve org.junit.platform:junit-platform-launcher
- Mockito can’t solve the problem of mockfinal class
- java.lang.Exception: No runnable methods
- [Solved] Mybatis Codes Error: java.lang.ClassNotFoundException: Cannot find class: com.mysql.jdbc.Driver
- [Solved] java.lang.Exception: No runnable methodsĀ at org.junit.runners.BlockJUnit4ClassRunner.validateIns…