Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with your test

src/test/java packages and src/main/java packages should match.
I had same issue where

  • my src/main/java packages were starting with com.comp.example but
  • src/test/java packages were starting with com.sample.example

Because of this spring boot application was not able to pickup the configuration of the application, which it picks up from @SpringBootApplication class.
So test case should fall under the same packages where @SpringBootApplication in src/main/java is written.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)