MCPcopy
hub / github.com/dosco/graphjin / TestNoCollisionsHappyPath

Function TestNoCollisionsHappyPath

core/openapi_bridge_test.go:260–280  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

258}
259
260func 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
282func TestCollisionCheckHandlesMissingDBInfo(t *testing.T) {
283 gj := &graphjinEngine{

Callers

nothing calls this directly

Calls 4

newTestEngineWithTablesFunction · 0.85
LenMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected