Search code examples
javamavenintellij-idea

IntelliJ unit tests don't see changes


I have a problem with my Java(Spring-Boot) unit tests on IntelliJ. My actual code and the test-code are on the same module. When I make a change in my code and I want to test it, I right click on the test class and "Run Test" But it doesn't see the actual code change I made earlier, unless I do a "mvn clean install" before I run the test each time(?!)

I might be wrong but I think this problem started after I converted my project into a multi module project. Though as I said in this case all code is in the same module. So cant see the relavance, Any suggestions how can I overcome with weird inconvenient behaviour?


Solution

  • After reading the comments I realized that I cant even make a "Build", that was the real issue. I got all sorts of package and symbol not found errors. I tried to "Invalidate caches restart" on Intellij but didnt help. So I deleted the ".idea" folder and restarted IntelliJ. Then the errors in "build" disappeared, hence the tests was able to make a build after a change. Thanks for leading in right direction.