MCPcopy Create free account
hub / github.com/goadesign/goa / TestSecureWithSkipRequestBodyEncodeDecode

Function TestSecureWithSkipRequestBodyEncodeDecode

codegen/service/security_test.go:65–85  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestSecureWithSkipRequestBodyEncodeDecode(t *testing.T) {
66 cases := []struct {
67 Name string
68 DSL func()
69 Code string
70 }{
71 {"with-basicauth", testdata.EndpointWithBasicAuthAndSkipRequestBodyEncodeDecodeDSL, testdata.EndpointWithBasicAuthAndSkipRequestBodyEncodeDecodeCode},
72 }
73 for _, c := range cases {
74 t.Run(c.Name, func(t *testing.T) {
75 root := codegen.RunDSL(t, c.DSL)
76 services := NewServicesData(root)
77 require.Len(t, root.Services, 1)
78 fs := EndpointFile("", root.Services[0], services)
79 require.NotNil(t, fs)
80 sections := fs.SectionTemplates
81 code := codegen.SectionCode(t, sections[5])
82 assert.Equal(t, c.Code, code)
83 })
84 }
85}

Callers

nothing calls this directly

Calls 5

RunDSLFunction · 0.92
SectionCodeFunction · 0.92
EndpointFileFunction · 0.85
NewServicesDataFunction · 0.70
RunMethod · 0.45

Tested by

no test coverage detected