Advanced Spring Boot Test 1

    Question 1SPRING BOOT TESTING - @SpringBootTest Purpose

    What is the primary purpose of using `@SpringBootTest` in a test class?

    Question 2SPRING BOOT AOP - Core Concept

    What is the main purpose of AOP in Spring Boot?

    Question 3SPRING BOOT CACHING- Enabling Caching

    Which annotation is used to enable caching in a Spring Boot application?

    Question 4SPRING BOOT MICROSERVICES- Core Concept of Microservices

    What is the main advantage of using Microservices architecture with Spring Boot?

    Question 5SPRING BOOT ASYNC- Enabling Async Processing

    Which annotation enables asynchronous method execution in Spring Boot?

    Question 6SPRING BOOT AWS - Storing Files in S3

    Which AWS service is primarily used for storing and retrieving unstructured data like images, videos, and documents in Spring Boot apps?

    Question 7SPRING BOOT TESTING - Slicing Annotations

    Which of the following annotations provides slice testing for JPA repositories?

    Question 8SPRING BOOT AOP - Key Terminology

    In Spring AOP, what does the term Join Point refer to?

    Question 9SPRING BOOT CACHING- Cacheable Annotation

    What does the @Cacheable annotation do?

    Question 10SPRING BOOT MICROSERVICES- Service Discovery

    Which tool is commonly used for service discovery in Spring Boot microservices?

    Question 11SPRING BOOT ASYNC- Basic @Async Usage

    Which statement about @Async is correct?

    Question 12SPRING BOOT AWS - Code Snippet (Upload File to S3)

    What does this code snippet do?

    @Autowired private AmazonS3 amazonS3; public void uploadFile(String bucket, String key, File file) { amazonS3.putObject(bucket, key, file); }

    Question 13SPRING BOOT TESTING - Mocking Dependencies

    What does the `@MockBean` annotation do in a Spring Boot test?

    Question 14SPRING BOOT AOP - Advice Types

    Which of the following is not a valid advice type in Spring AOP?

    Question 15SPRING BOOT CACHING- Code Snippet (@Cacheable)

    What does this method do?

    @Cacheable("users") public User findUserById(Long id) { return userRepository.findById(id).orElseThrow(); }

    Question 16SPRING BOOT MICROSERVICES- Code Snippet (Eureka Client)

    What does this configuration do?

    @SpringBootApplication @EnableEurekaClient public class OrderServiceApplication { public static void main(String[] args) { SpringApplication.run(OrderServiceApplication.class, args); } }

    Question 17SPRING BOOT ASYNC- Code Snippet (@Async)

    What will happen when the sendEmail() method is called?

    @Service public class EmailService { @Async public void sendEmail(String recipient) { System.out.println("Sending email to: " + recipient); } }

    Question 18SPRING BOOT AWS - Connecting to EC2

    Which statement is true about AWS EC2 in Spring Boot apps?

    Question 19SPRING BOOT TESTING - Code Snippet (MockMvc)

    What does the following test verify?

    @Autowired private MockMvc mockMvc; @Test void testHelloEndpoint() throws Exception { mockMvc.perform(get("/hello")) .andExpect(status().isOk()) .andExpect(content().string("Hello World")); }

    Question 20SPRING BOOT AOP - Code Snippet (Before Advice)

    What does this aspect do?

    @Aspect @Component public class LoggingAspect { @Before("execution(* com.example.service.UserService.*(..))") public void logBefore() { System.out.println("Before method in UserService"); } }