Core Spring Boot Test 5

    Question 1CORE SPRING BOOT - Multi-Document YAML

    How can you define multiple Spring profiles in a single YAML file?

    Question 2CORE SPRING BOOT - Component Scanning

    If you have a class in a sub-package of your main application class, will it be automatically scanned and registered as a bean if it's annotated with @Component?

    Question 3CORE SPRING BOOT - @Primary Annotation

    What is the purpose of the @Primary annotation in Spring Boot?

    Question 4CORE SPRING BOOT - Combining Path and Query Parameters

    How do you correctly handle both path and query parameters in Spring Boot?

    Question 5CORE SPRING BOOT - Optional Dependencies

    How can you mark a dependency as optional in Spring Boot DI?

    Question 6CORE SPRING BOOT - Code Snippet (@Profile with Configuration)

    Consider the following configuration class:

    @Configuration @Profile("test") public class TestConfig { @Bean public String testBean() { return "Test Bean"; } }

    What happens when the "dev" profile is active?

    Question 7CORE SPRING BOOT - Exposing All Endpoints

    By default, which Actuator endpoints are not exposed over HTTP?

    Question 8CORE SPRING BOOT - Best Practices in Exception Handling

    Which of the following is a best practice for exception handling in Spring Boot?

    Question 9CORE SPRING BOOT - Best Practices for Logging

    Which of the following is considered a best practice for logging in Spring Boot?

    Question 10CORE SPRING BOOT - Advantages of Undertow

    Which of the following is an advantage of using Undertow as an embedded server?

    Question 11CORE SPRING BOOT - External Configuration Locations

    How can Spring Boot load configuration files from external locations outside the JAR?

    Question 12CORE SPRING BOOT - Embedded Server Advantage

    What is the primary benefit of using an embedded server in a Spring Boot application?

    Question 13CORE SPRING BOOT - @PostConstruct Annotation

    When is a method annotated with @PostConstruct executed in a Spring Boot bean?

    Question 14CORE SPRING BOOT - Best Practices for REST Endpoints

    Which of the following are considered best practices for REST controllers in Spring Boot?

    Question 15CORE SPRING BOOT - Circular Dependency Handling

    Which DI type is least prone to circular dependency issues in Spring Boot?

    Question 16CORE SPRING BOOT - Best Practices with Profiles

    Which of the following is considered a best practice when using Spring Boot profiles?

    Question 17CORE SPRING BOOT - Best Practices for Actuator

    Which of the following is considered a best practice when using Spring Boot Actuator?

    Question 18CORE SPRING BOOT - Custom Error Attributes

    How can you customize the structure of default error responses in Spring Boot?

    Question 19CORE SPRING BOOT - Code Snippet (Parameterized Logging)

    What will the following SLF4J code output if userId = 101?

    logger.info("Processing user with id: {}", userId);

    Question 20CORE SPRING BOOT - Best Practices for Embedded Servers

    Which of the following is a best practice when using embedded servers in Spring Boot?