Testing Trials - SecretAgentShh/Grademe GitHub Wiki

Testing with Junit

On trying to follow this article I faced a huge problem that the import could not be resolved. Here is some troubleshooting you can try:

  • Check dependencies in the pom file including version clashes.
  • Check the Build path-> configure Build path-> Classpath->Maven Dependencies that it contains the dependencies. If not, manually add them from the library by getting to Classpath as above and Add Library.
  • Update the project after checking by Maven-> Update Project-> Optional(Force update checkbox) but helps to update better and OK.
  • Finally, Download Maven itself to check for the error. Run mvn clean test. Then deal with error using online forums or even ChatGPT. The focus is on learning not mere creation and show off.

Where I went wrong due to oversight on path location of Testing file!

All this just to learn that my Tester file was in src/main/java instead of src/test/java and running a simple mvn clean test -e and Chatgpt-ing the error was the fix. Finally RUN mvn clean test to verify your BUILD SUCCESSFUL then call me to throw a party because we can hand it over to the testers now. Whew!