I have created a simple unit test but IntelliJ is incorrectly highlighting it red. marking it as an error
No beans?
I am using spring-boot 2.0, and intellij 2018.1.1 ultimate edition and I faced the same issue.
I solved by placing @EnableAutoConfiguration in the main application class
@SpringBootApplication @EnableAutoConfiguration class App{ /**/ }