0

I am writing the unit test for the first time. In order to create the test file in IntelliJ, I created a *Test.java by using shortcut [https://www.jetbrains.com/help/idea/create-tests.html]. Now when I am trying to run mvn test it is not running any tests.

pom.xml

      <dependency>
          <groupId>org.junit.jupiter</groupId>
          <artifactId>junit-jupiter</artifactId>
          <version>5.6.2</version>
          <scope>test</scope>
      </dependency>
  1. Few answers from SO I found was to check the name. I checked and the name of the file is <classNametoTest>Test.java and I can also see the JUnit symbol on the file.
  2. I have another folder named test (in root directory). In order to verify, I tried to rename the folder and did mvn clean package -> mvn test. Not tests run.
  3. Test folder is there in src as well [https://stackoverflow.com/questions/6178583/maven-does-not-find-junit-tests-to-run]
harry123
  • 760
  • 1
  • 7
  • 22

1 Answers1

0

can you check if you have @Test is imported from org.junit.jupiter.api.Test

sanjeevRm
  • 1,541
  • 2
  • 13
  • 24