@Value “Could not resolve placeholder” in Spring Boot Test

You need to add

@PropertySource(“classpath:application.properties”)

to your class, so it will pick your normal configurations.

If you need different configurations for test you can add

@TestPropertySource(locations=”classpath:test.properties”)

If not just copy paste your config file to test/resources folder, then boot will pick from there.

See this.

Leave a Comment

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