In my case the problem was that in that I tried to mock class from another repo and within the code of that class another class was used from another repo that wasn't imported in the repo I run the test, so adding the missing import solved it.
Hope it helps anyone