intellij junit @RunWith not resolved

The @RunWith annotation has been replaced with @ExtendWith in JUnit 5.0 and above (which the latest spring version is now using).

Example:

@ExtendWith(SpringExtension.class)
@ContextConfiguration(classes = { SpringTestConfiguration.class })
public class GreetingsSpringTest {
    // ...
}

Quoted from Baeldung:

Note that SpringExtension.class is provided by Spring 5 and integrates the Spring TestContext Framework into JUnit 5.

Ref: https://www.baeldung.com/junit-5-runwith


Simple: your IDE is not configured to for unit testing.

In other words: you are missing all the JUnit related classes. You can see that all those JUnit imports are underlined; as IntelliJ simply doesn't know about the JARs that contain the corresponding classes.

See here on how to fix that.