0

My SpringBoot application has three modules

controller

service

dao

I am writing a test case for a class EmployeeDetailsController.java as EmployeeDetailsControllerTest.java inside tests folder of a springboot application.

But when I run the EmployeeDetailsControllerTest I get the below error

java: package com.example.employee.response does not exist 
......
.......

This error is seen for all the imports used inside a java file EmployeeRegistrationController.java and import from other helper classes

I do not understand why it is pointing to the files in java package even when I run a test class inside tests package.

Below is the dependency I have added inside pom.xml

   <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

Below is the structure. Sorry for the naming structure for the post and my project

enter image description here

Timothy Truckle
  • 15,071
  • 2
  • 27
  • 51
J123
  • 61
  • 2
  • 11

1 Answers1

0

The issue got fixed by

Invalidate Caches/restart option of IntelliJ
J123
  • 61
  • 2
  • 11