INNER CODE UNIT · Go

TestALBBase64BodyRequest

akrylysov/algnhsa · alb_test.go:113

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

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

	dump, err := dumpALB(encodedEvent, Options{})
	asrt.NoError(err)
	expected := expectedALBDump
	expected.Body = "Hello from Lambda!"
	asrt.Equal(expected, dump)
}

func TestALBURLEncoding(t *testing.T) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…