0

I want to run test methods of the test code files that are under /spring-boot/src/test/java/com/example/springboot/. enter image description here

I thought I need to use those files as source folder. However, when I build path /com/example/springboot, the import stuff can't be resolved. enter image description here

So I want to know why the error happens, and how I can run the test methods, thank you.

jimi1206
  • 1
  • 3
  • 1
    In the first screenshot, the tests are not in a source folder, so they will not be compiled and therefore cannot be executed. In the second screenshot, the tests are in a regular instead of a test source folder, so test scope dependencies will not be resolved. Does right-click the project folder and _Maven > Update Project..._ fix your issue (I guess you edit the Java Build Path manually instead of doing this)? Otherwise, show your `pom.xml` (as text, not as screenshot). – howlger Jan 31 '21 at 08:52
  • @howler Problem solved thanks to your answer, thanks a lot! – jimi1206 Feb 02 '21 at 09:59

0 Answers0