My aplication uses Spring 4.3.1 and JUnit 4.12.
I have been trying test my methods with JUnit test cases.
I placed the @RunWith(SpringJUnit4ClassRunner.class) annotation in my test class, but eclipse complains "Class cannot be resolved to a type".
I read that this was enough for Eclipse to recognize SpringJUnit4ClassRunner, but isn't.
Is there Anything else remaining to do?
Try to:
Adding the dependency spring-test the problem has been solved.
I didn't know there was need for this additional dependence, but someone told me here. Thank you.
I initially said that this measure was not enough because I had written the dependency version name wrongly and Maven was not finding the resource. But now it works!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.