(t *testing.T)
| 235 | } |
| 236 | |
| 237 | func TestCollisionWithExistingResolverWarns(t *testing.T) { |
| 238 | conf := &Config{ |
| 239 | Resolvers: []ResolverConfig{ |
| 240 | {Name: "ledger", Type: "remote_api", Table: "accounts", Column: "id"}, |
| 241 | }, |
| 242 | } |
| 243 | gj, logBuf := newTestEngineWithTables(t, conf, "public", "accounts") |
| 244 | synth := []ResolverConfig{ |
| 245 | { |
| 246 | Name: "ledger", // matches existing resolver name |
| 247 | Type: "openapi", |
| 248 | Table: "accounts", Column: "id", |
| 249 | Props: ResolverProps{"spec_key": "fin", "operation_id": "getLedger"}, |
| 250 | }, |
| 251 | } |
| 252 | if err := gj.validateOpenAPINoCollisions(synth); err != nil { |
| 253 | t.Fatalf("existing-resolver collision should warn, not error; got: %v", err) |
| 254 | } |
| 255 | if !strings.Contains(logBuf.String(), "fin/getLedger") { |
| 256 | t.Errorf("expected warning identifying the operation; got log: %q", logBuf.String()) |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | func TestNoCollisionsHappyPath(t *testing.T) { |
| 261 | gj, logBuf := newTestEngineWithTables(t, &Config{}, "public", "users", "orders") |
nothing calls this directly
no test coverage detected