If you see the “Maven projects need to be imported” popup in IntelliJ, then do click “Enable Auto-Import”.
You very often see this when you first create new projects and it is easy to miss. But many of my “Why isn’t it finding this class” and “Why didn’t it import that” queries, are because I haven’t noticed the popup sitting patiently in the top right, waiting for me to respond.
Very often the first time you type
@Test and you know you added JUnit as a dependency, and it runs fine from the command line, but IntelliJ doesn’t like it.
If you miss the popup then you can still set the properties using the IntelliJ options: