Advanced Spring Boot Configuration Properties Mastery
Test your understanding of advanced configuration properties in Spring Boot applications.
Questions in this quiz
12 questions on Advanced Spring Boot Configuration Properties Mastery. Work through them here, then start the quiz to answer them and see your score.
1.Which of the following is the correct way to define a custom property in application.properties?
- Acustom.property=value
- Bproperty.custom=value
- Ccustom:property=value
- Dproperty=custom:value
2.How can you access a custom configuration property in a Spring Boot application?
- A@Property("custom.property")
- B@Config("custom.property")
- C@CustomValue("custom.property")
- D@Value("${custom.property}")
3.What is the purpose of the @ConfigurationProperties annotation in Spring Boot?
- ATo define a configuration class
- BTo set default property values
- CTo enable property encryption
- DTo bind a class to properties
4.Which of the following is true about Spring Boot profiles?
- AThey are used to define bean scopes
- BThey allow different configurations for different environments
- CThey are used to manage logging levels
- DThey are used to manage dependencies
5.How do you specify a profile-specific property file in Spring Boot?
- Aapplication.profile.properties
- Bapplication-{profile}.properties
- Capplication_profile.properties
- Dapplication.profile.config
6.What is the default location for Spring Boot configuration files?
- Asrc/main/java
- Bsrc/config
- Csrc/main/resources
- Dsrc/main/webapp
7.Which property is used to set the server port in a Spring Boot application?
- Aport.server
- Bserver_port
- Cport
- Dserver.port
8.How can you enable a configuration property to be overridden by an environment variable?
- APrefix the property with 'env.'
- BSet the property in application.yml
- CUse the same property name as the environment variable
- DUse the @Override annotation
9.What is the correct way to include a YAML configuration file in a Spring Boot application?
- Aconfig.yml
- Bapplication.yaml
- Capplication.yml
- Dsettings.yaml
10.Which of the following is a valid way to define a list property in application.yml?
- Alist: - item1 - item2
- Blist: [item1, item2]
- Clist: {item1, item2}
- Dlist: item1, item2
11.How can you define a default value for a property in Spring Boot?
- A@DefaultValue("property=default")
- B@Property("property:default")
- C@ConfigValue("property=default")
- D@Value("${property:default}")
12.Which annotation is used to enable support for configuration properties in a Spring Boot application?
- A@EnableConfig
- B@ConfigurationSupport
- C@EnableProperties
- D@EnableConfigurationProperties