Core Spring Boot Test 5

    Question 1: CORE SPRING BOOT - Multi-Document YAML

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

    Question 2: CORE 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 3: CORE SPRING BOOT - @Primary Annotation

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

    Question 4: CORE SPRING BOOT - Combining Path and Query Parameters

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

    Question 5: CORE SPRING BOOT - Optional Dependencies

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

    Question 6: CORE 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 7: CORE SPRING BOOT - Exposing All Endpoints

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

    Question 8: CORE SPRING BOOT - Best Practices in Exception Handling

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

    Question 9: CORE SPRING BOOT - Best Practices for Logging

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

    Question 10: CORE SPRING BOOT - Advantages of Undertow

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

    Question 11: CORE SPRING BOOT - External Configuration Locations

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

    Question 12: CORE SPRING BOOT - Embedded Server Advantage

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

    Question 13: CORE SPRING BOOT - @PostConstruct Annotation

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

    Question 14: CORE SPRING BOOT - Best Practices for REST Endpoints

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

    Question 15: CORE SPRING BOOT - Circular Dependency Handling

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

    Question 16: CORE SPRING BOOT - Best Practices with Profiles

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

    Question 17: CORE SPRING BOOT - Best Practices for Actuator

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

    Question 18: CORE SPRING BOOT - Custom Error Attributes

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

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

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

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

    Question 20: CORE SPRING BOOT - Best Practices for Embedded Servers

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