(t *testing.T)
| 211 | } |
| 212 | |
| 213 | func 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 | |
| 231 | func TestHTTPEndpointFinalization(t *testing.T) { |
| 232 | cases := map[string]struct { |
nothing calls this directly
no test coverage detected