INNER CODE UNIT · Go
TestAPIGatewayRequest
mweagle/Sparta · apigateway_test.go:40
func TestAPIGatewayRequest(t *testing.T) {
requestBody := &testRequest{
Message: randVal,
}
mockRequest, mockRequestErr := spartaAWSEvents.NewAPIGatewayMockRequest("helloWorld",
http.MethodGet,
nil,
requestBody)
if mockRequestErr != nil {
t.Fatal(mockRequestErr)
}
resp, respErr := testAPIGatewayLambda(context.Background(), *mockRequest)
if respErr != nil {
t.Fatal(respErr)
} else {
t.Log(fmt.Sprintf("%#v", resp))
}
}