I have set up a new project. The project follows the Maven's default project configuration and naming i.e. I have src->main->java
and src->test->java
.
pom.xml doesn't specify the <sourceDirectory>
and <testDirectory>
because I have the Maven's default location set up. The pom.xml includes the junit dependecy as
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
Project Structure:
I have cleaned and built my project numerous times. However I am not able to import org.junit.Test
in my test class which resides in src/test/java/com/.../service/ServiceClassTest.java
.
I also have eclipse in my machine and I was able to import the Junit's Test class without changing any config. Why is Intellij failing to import the Junit classes ?
EDIT: For that matter, I am also not able to see Mockito classes inside the test class, although the jar has been downloaded. I can see it in the External Libraries view.