INNER CODE UNIT · Go

TestAPIGatewayV1Base64BodyRequest

akrylysov/algnhsa · apigw_v1_test.go:174

func TestAPIGatewayV1Base64BodyRequest(t *testing.T) {
	asrt := assert.New(t)

	event := events.APIGatewayProxyRequest{}
	asrt.NoError(json.Unmarshal([]byte(apiGatewayV1TestEvent), &event))
	event.IsBase64Encoded = true
	event.Body = "SGVsbG8gZnJvbSBMYW1iZGEh"
	encodedEvent, err := json.Marshal(event)
	asrt.NoError(err)

	dump, err := dumpAPIGatewayV1(encodedEvent, Options{})
	asrt.NoError(err)
	asrt.Equal(expectedApiGatewayV1Dump, dump)
}

func TestAPIGatewayV1URLEncoding(t *testing.T) {
	asrt := assert.New(t)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…