MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / newNotifier

Function newNotifier

internal/hitlnotify/notifier_test.go:25–43  ·  view source on GitHub ↗

newNotifier wires a notifier talking to a fake SMTP + a fresh test DB. Returns notifier, store, signer, and the smtpDone accessor.

(t *testing.T)

Source from the content-addressed store, hash-verified

23// newNotifier wires a notifier talking to a fake SMTP + a fresh test DB.
24// Returns notifier, store, signer, and the smtpDone accessor.
25func newNotifier(t *testing.T) (
26 *hitlnotify.Notifier,
27 *identity.Store,
28 *approvaltoken.Signer,
29 func() []testutil.SMTPMessage,
30) {
31 t.Helper()
32 smtpAddr, smtpDone := testutil.FakeSMTPServer(t)
33 pool := testutil.TestDB(t)
34 store := identity.NewStore(pool)
35 relay := outbound.NewSMTPRelay(&config.OutboundSMTPConfig{
36 Host: smtpAddr.Host,
37 Port: smtpAddr.Port,
38 FromDomain: notifyFromDomain,
39 })
40 signer := approvaltoken.NewSigner(notifySecret)
41 n := hitlnotify.New(store, relay, signer, notifyFromDomain, publicURL)
42 return n, store, signer, smtpDone
43}
44
45// setupPendingMessage creates a verified HITL-enabled agent with one
46// pending outbound message. Returns (agent, message).

Calls 6

FakeSMTPServerFunction · 0.92
TestDBFunction · 0.92
NewStoreFunction · 0.92
NewSMTPRelayFunction · 0.92
NewSignerFunction · 0.92
NewFunction · 0.92

Tested by

no test coverage detected