Issue
My Junit tests are working fine when I'm testing them, but while building the project the build fails and reason it tells is:
> Task : compileJava FAILED
ge org.junit does not exist
import org.junit.Tes
ge org.junit.runner does not exist
import org.junit.runner.RunWith;
age org.springframework.test.web.servlet.request does not exist
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
and there some others imports too which are being failed
Solution
I figured it out,it was failing to build because,i wrote tests using Junit4 by importing it, but i use Gradle's Junit for test then it works
Answered By - Salman Shaik