JavaThinking.com
Toggle Menu
Home
Online Kotlin Compiler
Tutorials
Spring Boot
Spring Cloud
Spring Data
Spring MVC
Spring Security
Blog
All Posts
Spring Boot Configuration and Profiles
Check how well you understand application properties,YAML,and environment profiles.
1. What is the default configuration file name in Spring Boot?
application.properties
app.config
spring-boot.config
config.properties
2. Which of the following are valid sources for external configuration in Spring Boot? (Select all that apply)
Environment variables
System properties
Command-line arguments
application.properties files
Java class files
3. Spring Boot profiles can be activated using the spring.profiles.active property.
True
False
4. What annotation is used to bind external properties to a Java class in Spring Boot? (full class name without package)
5. Which file name is used for profile-specific configuration when the 'prod' profile is active?
application-prod.properties
prod-application.yml
spring-prod.config
app-prod.properties
6. Which of the following are valid methods to activate Spring Boot profiles? (Select all that apply)
Using JVM system property -Dspring.profiles.active=dev
Setting environment variable SPRING_PROFILES_ACTIVE=dev
Adding spring.profiles.active=dev in application.properties
Using @ActiveProfiles("dev") annotation in test classes
7. YAML configuration files in Spring Boot can coexist with properties files; their configurations are merged.
True
False
8. What is the default profile name when no profiles are explicitly activated in Spring Boot?
9. Which property is used to specify additional configuration locations in Spring Boot without replacing the default locations?
spring.config.additional-location
spring.config.location
spring.additional.config
app.config.path
10. Which data types can be injected using the @Value annotation in Spring Boot? (Select all that apply)
String
Integer
List
Map
Custom Object
Reset
Answered 0 of 0 — 0 correct