JUnit Test For Lambda Controller
```java package example.micronaut; import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent; import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent; import io.micronaut.core.type.Argument; import io.micronaut.function.aws.proxy.MockLambdaContext; import io.micronaut.function.aws.proxy.payload1.ApiGatewayProxyRequestEventFunction; import io.micronaut.http.HttpMethod; import io.micronaut.http.HttpStatus; import io.micronaut.serde.ObjectMapper; import io.micronaut.test.extensions.junit5.annotation.MicronautTest; import jakarta.inject.Inject; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Map; import static org.junit.jupiter.api.Assertions.assertEquals; /** * Integration tests for the HomeController class, using Micronaut framework and AWS Lambda. * Tests various endpoints and methods to ensure correct functionality. */ @MicronautTest class HomeControllerTest { private static ApiGatewayProxyRequestEventFunction handler; @Inject ObjectMapper objectMapper; @BeforeAll static void setupSpec() { handler = new ApiGatewayProxyRequestEventFunction(); } @AfterAll static void cleanupSpec() { handler.getApplicationContext().close(); } @Test void testMultiSend() throws IOException { APIGatewayProxyRequestEvent request = new APIGatewayProxyRequestEvent(); request.setPath("/test"); request.setHttpMethod(HttpMethod.GET.toString()); request.setBody("{}"); APIGatewayProxyResponseEvent response = handler.handleRequest(request, new MockLambdaContext()); Map<String, Object> responseMap = objectMapper.readValue(response.getBody(), Argument.mapOf(String.class, Object.class)); Object responseObject = responseMap.get("body"); Map<String, Object> sendgridMap = objectMapper.readValue(responseObject.toString(), Argument.mapOf(String.class, Object.class)); Map<String, Object> sentEmail = (Map<String, Object>) sendgridMap.get("sentEmail"); List