(t *testing.T)
| 258 | } |
| 259 | |
| 260 | func TestNoCollisionsHappyPath(t *testing.T) { |
| 261 | gj, logBuf := newTestEngineWithTables(t, &Config{}, "public", "users", "orders") |
| 262 | synth := []ResolverConfig{ |
| 263 | { |
| 264 | Name: "is_get_user_by_id", Type: "openapi", |
| 265 | Table: "users", Column: "email", |
| 266 | Props: ResolverProps{"spec_key": "is", "operation_id": "getUserById"}, |
| 267 | }, |
| 268 | { |
| 269 | Name: "stripe_get_payment_by_id", Type: "openapi", |
| 270 | Table: "orders", Column: "stripe_id", |
| 271 | Props: ResolverProps{"spec_key": "stripe", "operation_id": "getPaymentById"}, |
| 272 | }, |
| 273 | } |
| 274 | if err := gj.validateOpenAPINoCollisions(synth); err != nil { |
| 275 | t.Fatalf("happy path should not error: %v", err) |
| 276 | } |
| 277 | if logBuf.Len() != 0 { |
| 278 | t.Errorf("happy path should produce no log output; got: %q", logBuf.String()) |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | func TestCollisionCheckHandlesMissingDBInfo(t *testing.T) { |
| 283 | gj := &graphjinEngine{ |
nothing calls this directly
no test coverage detected