Eclipse complains about the lack of a Junit gang, even if it is already in the build path

I have Maven / Eclipse setup below and I already added junit as a compile time dependency in pom.xml.

<dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.2</version>
</dependency>

Can someone clarify why Eclipse is prompting me to add junit to create the path?

thanks

enter image description here

+4
source share
2 answers

You need JUnit 4 if you want to use annotations.

<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.12</version>
</dependency>
+2
source

Do the following:

  • Update maven project.

  • Clean up the project.

And then repeat the test

0
source

Source: https://habr.com/ru/post/1609835/


All Articles