Bird
0
0

Which of the following is the correct way to name a properties file for a test profile named testdb?

easy📝 Syntax Q12 of 15
Spring Boot - Testing Spring Boot Applications
Which of the following is the correct way to name a properties file for a test profile named testdb?
Aapplication.properties.testdb
Btestdb-application.properties
Capplication-testdb.properties
Dapplication_testdb.properties
Step-by-Step Solution
Solution:
  1. Step 1: Recall Spring Boot profile file naming

    Spring Boot uses the pattern application-{profile}.properties for profile-specific config files.
  2. Step 2: Match the pattern with the profile name

    For profile testdb, the correct file name is application-testdb.properties.
  3. Final Answer:

    application-testdb.properties -> Option C
  4. Quick Check:

    Profile file = application-{profile}.properties [OK]
Quick Trick: Use application-{profile}.properties naming [OK]
Common Mistakes:
  • Placing profile name after .properties
  • Using underscores instead of hyphens
  • Reversing the order of profile and application

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes