--- CmdAdd Tests ---
(t *testing.T)
| 466 | // --- CmdAdd Tests --- |
| 467 | |
| 468 | func TestCmdAdd_Success(t *testing.T) { |
| 469 | cb := &mockCallbacks{} |
| 470 | h := newTestHandler(cb) |
| 471 | |
| 472 | fn := newTestFn("test:job1", "add", "job1", []byte(`{}`)) |
| 473 | h.CmdAdd(fn) |
| 474 | |
| 475 | // Config should be in both caches. |
| 476 | _, ok := h.seen.LookupByUID("dyncfg:job1") |
| 477 | assert.True(t, ok, "config should be in seen cache") |
| 478 | |
| 479 | entry, ok := h.exposed.LookupByKey("job1") |
| 480 | require.True(t, ok, "config should be in exposed cache") |
| 481 | assert.Equal(t, StatusAccepted, entry.Status) |
| 482 | } |
| 483 | |
| 484 | func TestCmdAdd_InvalidArgs(t *testing.T) { |
| 485 | cb := &mockCallbacks{} |
nothing calls this directly
no test coverage detected
searching dependent graphs…