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

Function TestHTTPEndpointParentRequired

expr/http_endpoint_test.go:213–229  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

211}
212
213func TestHTTPEndpointParentRequired(t *testing.T) {
214 root := expr.RunDSL(t, testdata.EndpointHasParent)
215 svc := root.Service("Child")
216 if svc == nil {
217 t.Fatal(`unexpected error, service "Child" not found`)
218 }
219 m := svc.Method("Method")
220 if m == nil || m.Payload == nil {
221 t.Fatal(`unexpected error, method "Method" or its payload not found`)
222 }
223 if !m.Payload.IsRequired("ancestor_id") {
224 t.Errorf(`expected "ancestor_id" is required, but not so`)
225 }
226 if !m.Payload.IsRequired("parent_id") {
227 t.Errorf(`expected "parent_id" is required, but not so`)
228 }
229}
230
231func TestHTTPEndpointFinalization(t *testing.T) {
232 cases := map[string]struct {

Callers

nothing calls this directly

Calls 4

RunDSLFunction · 0.92
IsRequiredMethod · 0.80
ServiceMethod · 0.65
MethodMethod · 0.65

Tested by

no test coverage detected