INNER CODE UNIT · Go

TestAPIGateway

mweagle/Sparta · apigateway_test.go:59

func TestAPIGateway(t *testing.T) {
	stage := NewStage("v1")
	apiGateway := NewAPIGateway("SpartaAPIGateway", stage)
	lambdaFn, _ := NewAWSLambda(LambdaName(mockLambda1),
		mockLambda1,
		IAMRoleDefinition{})

	// Register the function with the API Gateway
	apiGatewayResource, _ := apiGateway.NewResource("/test", lambdaFn)
	_, resErr := apiGatewayResource.NewMethod("GET", http.StatusOK)
	if resErr != nil {
		t.Fatalf("Failed to create new resource: %s", resErr.Error())
	}
	testProvisionEx(t,
		[]*LambdaAWSInfo{lambdaFn},
		apiGateway,
		nil,
		nil,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…